Chapter 1
Chapter 1
NUMBER SYSTEMS
AND CODES
Objectives
Note that the last remainder becomes the most significant bit (MSB) and
the first remainder becomes the least significant bit (LSB).
3
MSB LSB
26 25 24 23 22 21 20 Bit Weights
1 0 1 0 1 1 1 binary number
= 26 + 24 + 22 + 21 + 20
= 64 + 16 + 4 + 2 + 1
= 8710.
MSD LSD
82 81 80 Octal Digit Weights
4 1 2 Octal Number
= (4 x 82 ) + (1 x 81) + (2 x 80)
= 256 + 8 + 2
= 26610.
4
4 7 2 Octal number
↓ ↓ ↓
100 111 001 Binary number
The hexadecimal number (base 16) uses the digits 0 through 9 plus the
letters A, B, C, D, E and F. The letter A stands for decimal 10, B for 11, C
for 12, D for 13, E for 14 and F for 15.
0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5
5 5 0101
6 6 0110
7 7 0111
8 8 1000
9 9 1001
A 10 1010
B 11 1011
C 12 1100
D 13 1101
E 14 1110
F 15 1111
To convert the hex number 1A716 to a decimal number, multiply each hex
value by the weight of the digit and sum the results.
MSD LSD
162 161 160 Hex Digit Weights
1 A 7 Hex Number
1 A 7
↓ ↓ ↓
0001 1010 0111
6
8 7 4 decimal number
↓ ↓ ↓
1000 0111 0100 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
7
Exercises