3. Hexadecimal numbers
Hexadecimal uses the digits 0-9 and the letters A-F, so counting would look like this:
0 1 2 3 4 5 6 7 8 9 A B C D E F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 21 21 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
30 31 32 32 … etc
3
4. Binary to Hexadecimal
1. Draw the table
a. eg 10110001 add it to your table
b. Divide it into groups of 4 bits starting from the right
hand side
c. In each group start 23 22 21 20
d. Add up the values in each group and from the
heaxadecimal table replace the value
23 22 21 20 23 22 21 20
1 0 1 1 0 0 0 1
8 + 0 + 2 + 1 = 11 0 + 0 + 0 + 1 = 1
B 1
4
5. Binary to Decimal (Denary)
1. Draw the table
a. eg 10010001 add it to your table
b. Add all the values in the second row that have a 1 in
the third row
c. 128+16+1 = 145
27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
1 0 0 1 0 0 0 1
5
6. Hexadecimal to Decimal
• Eg. B1 (2 characters)
• Draw the table
162 161 160
256 16 1
B 1
Decimal value 11 1
11x16 =176 1x1 =1
176 + 1 = 177
Decimal to
hexadecimal
from table
slide 2
Multiply these
values eg 11x16
and 1x1 then add
the results
6
7. Decimal to hexadecimal
• Eg 255
• Divide by 16
• 255/16 = 15 and a remainder of 15
• 15/16 = 0 and a remainder of 15
decimal 15 15
hexadecimal F F
Result = FF
Most significant
Least significant
7
8. Decimal to hexadecimal
eg 325
325/16 = 20 and a remainder of 5
20/16 =1 and a remainder of 4
1/16 = 0 and a remainder of 1
32510
1 4 5
Result = 14516 or 0x145
Most significant
Least significant
8
10. Decimal to Binary
Eg 324
324/2 = 162 and a remainder of 0
162/2 = 81 and a remainder of 0
81/2 = 40 and a remainder of 1
40/2 = 20 and a remainder of 0
20/2 = 10 and a remainder of 0
10/2 = 5 and a remainder of 0
5/2 = 2 and a remainder of 1
2/2 =1 and a remainder of 0
1/2 = 0 and a remainder of 1
The result is 101000100
Most significant
Least significant
10