CODES
CODES
Chapter Codes
Reference:
1. Malvino and Leach, Digital Principles & applications, 7th
edition, TMH, 2010
2. Morris Mano, “Digital design”, Prentice Hall of India, Third
Edition.
Learning outcomes
Weighted Codes
Non-Weighted Codes
Alphanumeric Codes
Error Detecting Codes
Error Correcting Codes
Weighted codes:
Weighted codes:
4 bit code: a3 a2 a1 a0
8 4 2 1
2 4 2 1
8 4 -2 -1
Department of Electronics and Communication Engineering, MIT, Manipal
Binary coded decimal codes
Weighted codes:
Bn Bn-1 . . . . B1
Gn Gn-1 . . . . G1 ?
Formulae:
Gn = Bn ; Gn-1 = Bn XOR Bn-1 ….. G1 = B2 XOR B1
FORMULAE:
Bn = Gn ; Bn-1 = Bn XOR Gn-1 ….. B1 = B2 XOR G1
Problem: (1 1 0 1)GRAY = ( ? )2
GRAY: 1 1 0 1
?
BINARY: 1 0 0 1
Self-complementing code:
A code is said to be self-complementing, if the code word of the
9’s complement of N can be obtained from the code word of N
by converting all the 0’s into 1’s and all 1’s into 0’s.
P1 P2 D3 P3 D2 D1 D0
B 3 ⨁ B6 ⨁ B7
B 5 ⨁ B6 ⨁ B7
Checking,
B 1 ⨁ B3 ⨁ B5 ⨁ B7
B 2 ⨁ B3 ⨁ B6 ⨁ B7
B 4 ⨁ B5 ⨁ B6 ⨁ B7
Is received it as: 1 0 1 0 0 0 1
i.e. D5 gets corrupted.
P1 P2 D3 P4 D5 D6 D7
0 1 0 1
0
1
0
0 1 0 0 1 0 1
7-bit Hamming code: