Binary, octal and hexadecimal 93
Table 10.2
Decimal
Binary
Octal
Hexadecimal
0
0000
0
0
1
0001
1
1
2
0010
2
2
3
0011
3
3
4
0100
4
4
5
0101
5
5
6
0110
6
6
7
0111
7
7
8
1000
10
8
9
1001
11
9
10
1010
12
A
11
1011
13
B
12
1100
14
C
13
1101
15
D
14
1110
16
E
15
1111
17
F
16
10000
20
10
17
10001
21
11
18
10010
22
12
19
10011
23
13
20
10100
24
14
21
10101
25
15
22
10110
26
16
23
10111
27
17
24
11000
30
18
25
11001
31
19
26
11010
32
1A
27
11011
33
1B
28
11100
34
1C
29
11101
35
1D
30
11110
36
1E
31
11111
37
1F
32
100000
40
20
Problem 16. Convert the following hexadecimal
numbers into their decimal equivalents:
(a) C9 16 (b) BD 16
(a) C9 16 = C × 16
1
+ 9 × 16
0
= 12 × 16 + 9 × 1
= 192 + 9 = 201
Thus C9 16 = 201 10
(b) BD 16 = B × 16
1
+ D × 16
0
= 11 × 16 + 13 × 1 = 176 + 13 = 189
Thus BD 16 = 189 10
Problem 17. Convert 1A4E 16 into a decimal
number.
1A4E 16 = 1 × 16
3
+ A × 16
2
+ 4 × 16
1
+ E × 16
0
= 1 × 16
3
+ 10 × 16
2
+ 4 × 16
1
+ 14 × 16
0
= 1 × 4096 + 10 × 256 + 4 × 16 + 14× 1
= 4096 + 2560 + 64 + 14 = 6734
Thus 1A4E 16 = 6734 10
(b) Converting from decimal to hexadecimal
This is achieved by repeatedly dividing by 16 and noting
the remainder at each stage, as shown below for 26 10 .
0
1 A least significant bit
Remainder
10 ; A 16
1 ; 1 16
16 1
16 26
most significant bit
Hence 26 10 = 1A 16
Similarly, for 447 10
1 B F
0
Remainder
15 ; F 16
11 ; B 16
1 ; 1 16
16
1
16 27
16 447
Thus 447 10 = 1BF 16
Table 10.2
Decimal
Binary
Octal
Hexadecimal
0
0000
0
0
1
0001
1
1
2
0010
2
2
3
0011
3
3
4
0100
4
4
5
0101
5
5
6
0110
6
6
7
0111
7
7
8
1000
10
8
9
1001
11
9
10
1010
12
A
11
1011
13
B
12
1100
14
C
13
1101
15
D
14
1110
16
E
15
1111
17
F
16
10000
20
10
17
10001
21
11
18
10010
22
12
19
10011
23
13
20
10100
24
14
21
10101
25
15
22
10110
26
16
23
10111
27
17
24
11000
30
18
25
11001
31
19
26
11010
32
1A
27
11011
33
1B
28
11100
34
1C
29
11101
35
1D
30
11110
36
1E
31
11111
37
1F
32
100000
40
20
Problem 16. Convert the following hexadecimal
numbers into their decimal equivalents:
(a) C9 16 (b) BD 16
(a) C9 16 = C × 16
1
+ 9 × 16
0
= 12 × 16 + 9 × 1
= 192 + 9 = 201
Thus C9 16 = 201 10
(b) BD 16 = B × 16
1
+ D × 16
0
= 11 × 16 + 13 × 1 = 176 + 13 = 189
Thus BD 16 = 189 10
Problem 17. Convert 1A4E 16 into a decimal
number.
1A4E 16 = 1 × 16
3
+ A × 16
2
+ 4 × 16
1
+ E × 16
0
= 1 × 16
3
+ 10 × 16
2
+ 4 × 16
1
+ 14 × 16
0
= 1 × 4096 + 10 × 256 + 4 × 16 + 14× 1
= 4096 + 2560 + 64 + 14 = 6734
Thus 1A4E 16 = 6734 10
(b) Converting from decimal to hexadecimal
This is achieved by repeatedly dividing by 16 and noting
the remainder at each stage, as shown below for 26 10 .
0
1 A least significant bit
Remainder
10 ; A 16
1 ; 1 16
16 1
16 26
most significant bit
Hence 26 10 = 1A 16
Similarly, for 447 10
1 B F
0
Remainder
15 ; F 16
11 ; B 16
1 ; 1 16
16
1
16 27
16 447
Thus 447 10 = 1BF 16
