Professional Documents
Culture Documents
NUMBER SYSTEMS
AND CODES
Objectives
1.1
Binary Numbers
remainder
remainder
remainder
remainder
remainder
remainder
remainder
1
1
1
0
1
0
1
MSB
=
=
=
LSB
26
25
24
23
22
21
20
Bit Weights
binary number
24
16
+
+
22 + 21 + 20
4 + 2 + 1
+
26
64
+
8710.
remainder 2
remainder 1
remainder 4
=
=
=
MSD
82
81
LSD
80
Octal Digit Weights
(4 x 82 ) +
256
+
26610.
(1 x 81) +
8
+
(2 x 80)
2
Octal Number
100
111
001
Octal number
Binary number
010
110
Binary number
Octal number
Decimal
0
1
2
3
4
Binary
0000
0001
0010
0011
0100
5
5
6
7
8
9
10
11
12
13
14
15
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
remainder 7
remainder 10
remainder 1
LSB
A
MSB
=
=
=
MSD
82
81
LSD
80
Hex Digit Weights
Hex Number
(7 x 80)
7
6
For example, 1A716
1
1 1010 01112.
1010
0111
1111
1101
0110
BCD Code
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
Conversion between BCD and decimal is accomplished by replacing a 4bit BCD for each decimal digit. For example, 87410 = 1000 0111 0100BCD.
7
decimal number
BCD code
BCD is not another number system like binary, octal, decimal and
hexadecimal. It is in fact the decimal system with each digit encoded in its
binary equivalent. A BCD code is not the same as a straight binary
number. For example, the BCD code requires 12 bits, while the straight
binary number requires only 10 bits to represent 87310.
87410 =
87410 =
11011010102
1000 01110100BCD
binary
BCD
1
9
7
8
BCD code
decimal number
8
Exercises
1.
2.
3.
4.
5.