Professional Documents
Culture Documents
Lecture 4 Binary Codes
Lecture 4 Binary Codes
Lecture Outline
1010 becomes
= -6 (in four bits) = -6 (in eight bits)
Binary Codes
Increasing Precision
= 10
• 6-3-1-1 Code
Decimal 6-3-1-1
N = w3 a3 + w2 a2 + w1a1 + w0 a0 Digit Code
0 0000
N = 6 × a3 + 3 × a2 + 1× a1 + 1× a0 1 0001
2 0011
Example: 3 0100
4 0101
o Encode 4 via a 6-3-1-1 code; 5 0111
4 = 6 × 0 + 3 × 1 + 1× 0 + 1× 1 6 1000
7 1001
– Hence, 4 = 0101 as a 6-3-1-1 code 8 1011
4 = 6 × 0 + 3 × 1 + 1× 1 + 1× 0 9 1100
8-4-2-1
Decimal 6-3-1-1 Excess-3 2-out-of-5 Gray
Code
Digit Code Code Code Code
(BCD)
0 0000 0000 0011 00011 0000
1 0001 0001 0100 00101 0001
2 0010 0011 0101 00110 0011
3 0011 0100 0110 01001 0010
4 0100 0101 0111 01010 0110
5 0101 0111 1000 01100 1110
6 0110 1000 1001 10001 1010
7 0111 1001 1010 10010 1011
8 1000 1011 1011 10100 1001
9 1001 1100 1100 11000 1000
Binary Codes
ASCII Codes
Binary Codes
Binary Codes: Examples