Exercise
What is 1011001001
in binary (base 2) in hexadecimal (base 16)?
Solution
Each group of 4 bits (binary digits) corresponds to a single hexadecimal digit. It is easy to work with 4 bit binary numbers. The place values are:
2^3 2^2 2^1 2^0
8 4 2 1
The range of values is 0 - 15
, inclusive. 0 - 9
are already hexadecimal digits. 10 - 15
are represented in hexadecimal as A - F
.
10: A
11: B
12: C
13: D
14: E
15: F
Split the binary number into groups of 4 bits, starting from the right.
10 1100 1001
If the number of bits is not evenly divisible by 4, add leading zeros to the left side, if desired.
0010 1100 1001
Convert each group of 4 bits into its hexadecimal digit equivalent independently.
0010 1100 1001
2 C 9
1011001001
in binary (base 2) is 2C9
in hexadecimal (base 16).
Alternative approach
This problem can also be solved by converting from binary into decimal (base 10) then converting from decimal into hexadecimal.
1011001001
in binary is 713
in decimal.
713
in decimal is 2C9
in hexadecimal.
Enumerated 4 bit numbers
Binary | Decimal | Hexadecimal |
---|---|---|
0000 |
0 |
0 |
0001 |
1 |
1 |
0010 |
2 |
2 |
0011 |
3 |
3 |
0100 |
4 |
4 |
0101 |
5 |
5 |
0110 |
6 |
6 |
0111 |
7 |
7 |
1000 |
8 |
8 |
1001 |
9 |
9 |
1010 |
10 |
A |
1011 |
11 |
B |
1100 |
12 |
C |
1101 |
13 |
D |
1110 |
14 |
E |
1111 |
15 |
F |