Lecture 001

Lab 0 no grace submission, released. Due Friday 11:59pm

Bits

Bits Transition Pages

Bits Transition Pages

Bits: 0s or 1s, but represented between 0.0V and 1.1V (vultage). There exists transition period.

Byte: 8 bits (256 different values, represent in Hexadecimal, base 16) Hexadecimal: one hex is 4 bits

Datatype in C

Operators

Boolean Algebra: developed by George Bool

Bit Vector:

Representing, Manipulating Sets using bits

Sets

Sets

Logical Operators

Operators: &&, ||, !

Shifts: (good for hardware)

Twos Complement

Negation with twos complement: easy

Bits in twos complement

Bits in twos complement

With 15213

With 15213

Unsigned representation: [0, 2^w - 1] Twos complement: [-2^(w-1), 2^(w-1) - 1]

Observation:

Preserving Bit Pattern

In terms of +- largest bits

In terms of +- largest bits

Graphically Thinking

Graphically Thinking

In terms of weights

In terms of weights

constants are int32 in C unsigned constants has a U as suffix.

Casting:

If there is a mixed signed and unsigned in expression, everything will be cast to unsigned (therefore using unsigned relation).

Operation on signed and unsigned

Operation on signed and unsigned

Extension and Trunking

Extension: extend left bits (keep negative) to preserve value

Trunking

Trunking
Trunking: just cut down if you can actually represent (not losing representation). Otherwise, keep bit pattern

TODO: what is x86 and x86-64 represent TODO: review 15122 bits

Table of Content