
Chapter 1 Exercises
1. It will take 6 bits to represent 40 items: “Log2 40=5.32”
so the next integer is 6.
2. The largest unsigned integer that can be represented in 7
bits is 127. With 7 bits, the biggest number we can
represent will be 26 and the smallest is 20 or 1. We take the sum of all
the bits minus 1: “26 + 25 + 26 + 26 + 22 + 21 +20 – 1 = 128-1 = 127”
3. To convert the value 120 to binary using 8 bits, we divide the number by
2, 8 times, if we have a rest, we put a 1, if there is no rest we put a 0. The
result is 0b01111000.
4. To convert 89 to HEX, we divide 89 by 16 = 5, the remainder is 9 which
will be the last HEX number. After dividing 5 by 16, the result is 0 and
the remainder is 5 which will be the first HEX. The result is 0x59.
5. To convert 0xF4 from HEX to Binary we split the number. Using 8 bits in
total, we know that F represents 15 which is 0b1111 in binary. We know
that 4 represents 0b0100 in binary. The final result will then be
0b11110100.
6. To convert 0xF4 to decimal, we know that HEX is on a 16 base. The first
bit is 4 and we multiply it by 160: “1*4=4”, the second bit is F(or 15) we
multiply by 161 : “16*15=240”. After adding the two numbers we get 244
in decimal.