1/12
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
How do you convert to 1’s complement?
Just the complement
How do you convert to 2’s
Take complement and add 1
With 2’s complement, what is the leftmost bit?
Negative weight
How do you compute an IEEE 754 Standard for Single Precision (32bit) Floating Point?
1st bit = sign (S)
next 8 bits = exponent (E)
next 23 bits = fraction (F)
number = (-1)S * 1.F * 2E-127 (the bias is 2k-1-1 (for 8 byte (32bit) = 127)
Example: 1 1000001 01000000000000000000000
S = 1
E = 12910
F = 0.012 = 0.25
(-1)1 × 1.25 × 22 = -5.0
What happens when you put a smaller signed number into a bigger signed number?
Sign extension
In hex what is A?
10
Big endian vs little endian? What is x86 32bit?
Big = MSB leftmost — 0xE9 = 2^8 × 14 + 2^0 × 9
little = MSB rightmost — 0xAE9 = 2^16 × 9 + 2^8 × 14 + 2^0 × 10
Little Endian
When does overflow happen?
Signed — sum exceeds 127 or goes below -128
Unsigned — sum exceeds 255
When does underflow happen?
Unsigned — sum goes below 0
When you add bits, what does 2 in a column mean?
Column becomes 0 and add a 1 to the left column
01
01 += 10
How do you get the negative of a number in binary?
Take it’s positive and run 2’s complement
What is arithmetic shift? Logical shift?
Arithmetic = sign extension (based on MSB)
Logical = always 0s (cuz unsigned)
What does echo do Linux? Grep?
Display line of text
Print lines matching pattern