Hardware Reference
In-Depth Information
Decimal
Binary
Octal
Hex
0
0
0
0
1
1
1
1
2
10
2
2
3
11
3
3
4
100
3
3
5
101
5
5
6
110
6
6
7
111
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
20
10100
24
14
30
11110
36
1E
40
101000
50
28
50
110010
62
32
60
111100
74
3C
70
1000110
106
46
80
1010000
120
50
90
1011010
132
5A
100
11001000
144
64
1000
1111101000
1750
3E8
2989
101110101101
5655
BAD
Figure A-3. Decimal numbers and their binary, octal, and hexadecimal equiv-
alents.
A.3 CONVERSION FROM ONE RADIX TO ANOTHER
Conversion between octal or hexadecimal numbers and binary numbers is easy.
To convert a binary number to octal, divide it into groups of 3 bits, with the 3 bits
immediately to the left (or right) of the decimal point (often called a binary point)
forming one group, the 3 bits immediately to their left, another group, and so on.
Each group of 3 bits can be directly converted to a single octal digit, 0 to 7, accord-
ing to the conversion given in the first lines of Fig. A-3. It may be necessary to add
one or two leading or trailing zeros to fill out a group to 3 full bits. Conversion
from octal to binary is equally trivial. Each octal digit is simply replaced by the e-
quivalent 3-bit binary number. Conversion from hexadecimal to binary is just like
 
 
Search WWH ::




Custom Search