1/25
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
size of data type char in bytes
1 byte
size of data type short in bytes
2 bytes
size of data type int in bytes
4 bytes
size of data type long in bytes
8 bytes
size of data type char* in bytes
8 bytes
Little endian
least significant byte to the most significant byte
Big endian
Most significant byte to the least significant byte.
What happens to the equivalent hexadecimal value of 2n as n increases by 4?
The hexadecimal value is multiplied by 10. (e.g. 24 = 0x10, 28 = 0x100, 212 = 0x1000)
Rule for Bitwise (~) NOT
flip each bit. (0→1, 1→0)
Rule for Bitwise (&) AND
If both bits are 1, the resulting bit will be 1, otherwise 0.
Rule for Bitwise (^) EXCLUSIVE OR (XOR)
If both are the same you get a 0. If different you get a 1.
Rule for Bitwise (|) OR
1 if either bit is 1.
Use bitwise ________ to extract a subset of the bits in a value.
AND
Use bitwise ________ to set a subset of bits in a string of bits.
OR
Use bitwise ________ to toggle a subset of bits in a string of bits.
XOR
The Left Shift Operator is a binary operator that is the equivalent to ________ the bit pattern with 2k (assuming shift k bits to the left).
multiplying.
The Right Shift Operator is a binary operator that is the equivalent to ________ the bit pattern with 2k (assuming shift k bits to the right).
dividing
The difference between logical right shift and arithmetic right shift.
Logical shift shifts in zeros (used for unsigned). Arithmetic shifts replicates the sign bit (used for signed integers).
True or False: Unsigned data always uses logical right shift
TRUE
Signed Magnitude
Flip the first bit (sign bit): 0 = positive, 1 = negative. EX: -5 → 10000101, +5 → 00000101.
2’s Complement
Invert all bits, then add 1.
1’s Complement
Invert all bits
116 in binary
0001
216 in binary
0010
416 in binary
0100
816 in binary
1000