Number Representation
./section-00.pdf
(a) 0b10010011 -decimal-> 147
-hex-> 0x93
(b) 0xD3AD -decimal-> 54189
-binary-> 1101 0011 1010 1101
(c) 63 -binary-> 0011 1111
-hex-> 0x3F
(d) 0b00100100 -decimal-> 36
-hex-> 0x24
(e) 0xB33F -decimal-> 45887
-binary-> 1011 0011 0011 1111
(g) 39 -binary-> 0010 0111
-hex-> 0x27
(h) 0x7EC4 -decimal-> 32452
-binary-> 0111 1110 1100 0100
(i) 437 -binary-> 0001 1011 0101
-hex-> 0x1B5
MSB has a negative value, all others are positive.
Assume 8-bit integers, answer for cases unsigned integers, biased bias -127, two's compliment.
- (a) [Unsigned] 255, 0
- (b) [Biased] 128, -127
- (c) [Two’s Complement] 127, -128
- (a) [Unsigned] 0000 0000, 0000 0001, -
- (b) [Biased] 0111 1111, 1000 0000, 0111 1110
- (c) [Two’s Complement] 0000 0000, 0000 0001, 1111 1111
- (a) [Unsigned] 0001 0001, -
- (b) [Biased] 1001 0000, 0110 1110
- (c) [Two’s Complement] 0001 0001, 1110 1111
2.2.6 Explain where each of the three radices shines and why it is preferred over other bases in a given context.
- binary - computers
- decimal - humans
- hex - shorthand for binary, inbetween
Bitstrings can be used to represent anything inside the computer n bits can be used to represent 2^n distinct things
2
0