Number Systems: Question 2
Syllabus 1.1
A small robotics kit uses 8-bit binary registers to store component ID codes on its control board. The accompanying manual lists the same codes in denary and in hexadecimal, so that different worksheets can refer to them consistently.
(a) Convert the denary value 173 to an 8-bit binary number. Show your working. [2]
(b) Convert the hexadecimal value 6B to an 8-bit binary number. Show your working. [2]
(c) Convert the binary value 10011101 to a hexadecimal value. Show your working. [2]
Show worked solution Hide worked solution
Worked solution
Part (a): Denary to 8-bit binary (173)
Use the binary place values 128, 64, 32, 16, 8, 4, 2, 1. Working from the largest place value down, mark a 1 wherever that place value is used to build up the total, and a 0 otherwise.
- 173 - 128 = 45, so the 128 column = 1
- 45 < 64, so the 64 column = 0
- 45 - 32 = 13, so the 32 column = 1
- 13 < 16, so the 16 column = 0
- 13 - 8 = 5, so the 8 column = 1
- 5 - 4 = 1, so the 4 column = 1
- 1 < 2, so the 2 column = 0
- 1 - 1 = 0, so the 1 column = 1
Reading the columns from 128 down to 1 gives 10101101.
Check: 128 + 32 + 8 + 4 + 1 = 173. Correct.
So 173 in denary = 10101101 in 8-bit binary.
Part (b): Hexadecimal to 8-bit binary (6B)
Each hexadecimal digit converts to exactly 4 bits, so a 2-digit hexadecimal value converts to an 8-bit binary value.
- 6 =
0110 - B = 11 in denary =
1011
Combining the two nibbles in the same order as the hexadecimal digits gives 0110 + 1011 = 01101011.
Check: 01101011 = 64 + 32 + 8 + 2 + 1 = 107, and 6B in hexadecimal = (6 x 16) + 11 = 96 + 11 = 107. Correct.
So 6B in hexadecimal = 01101011 in 8-bit binary.
Part (c): Binary to hexadecimal (10011101)
Split the 8-bit binary value into two nibbles (groups of 4 bits), starting from the left: 1001 and 1101.
1001= 8 + 1 = 91101= 8 + 4 + 1 = 13 = D
Combining the two hexadecimal digits in the same order as the nibbles gives 9D.
Check: 10011101 = 128 + 16 + 8 + 4 + 1 = 157, and 9D in hexadecimal = (9 x 16) + 13 = 144 + 13 = 157. Correct.
So 10011101 in binary = 9D in hexadecimal.
Final answers
- (a) 173 =
10101101 - (b) 6B =
01101011 - (c)
10011101= 9D