Professional Documents
Culture Documents
UNIT V Notes 2
UNIT V Notes 2
UNIT V Notes 2
0 0 0 1 1
0 0 1 0 2
0 0 1 1 3
0 1 0 0 4
0 1 0 1 5
0 1 1 0 6
0 1 1 1 7
1 0 0 0 8
1 0 0 1 9
1 0 1 0 10
1 0 1 1 11
1 1 0 0 12
LSB=1,3,5,7,9,11
Next BIT=2,3,6,7,10,11
Next Bit=4,5,6,7,12
MSB=8,9,10,11,12
P1=XOR(3,5,7,9,11)=XOR(1,1,0,0,0)=0
P2=XOR(3,6,7,10,11)=XOR(1,0,0,1,0)=0
P4=1
P8=1
1 2 3 4 5 6 7 8 9 10 11 12
0 0 1 1 1 0 0 1 0 1 0 0
• LSB=1,3,5,7,9,11
• Next BIT=2,3,6,7,10,11
• Next Bit=4,5,6,7,12
• MSB=8,9,10,11,12
• After reading 12 bits they are checked for errors
• Check bits:
• C1=XOR(1,3,5,7,9,11)=XOR(0,1,1,0,0,0)=0
• C2=XOR(2,3,6,7,10,11)=0
• C4=XOR(4,5,6,7,12)=0
• C8=XOR(8,9,10,11,12)=0
• c1C2C4C8=0000 no error
• C=C1C2C4C8not equal to 0 ,an error
• If check bit=0 ,designates even parity
• If check bit=1 ,designates odd parity
• If c≠0, The 4-bit binary number gives position of erroneous bit, correct the error by
complementing the corresponding bit.
• C=C1C2C4C8 = 0101=5 error in position 5
Single‐Error Correction, Double‐Error Detection
• The Hamming code can detect and correct only a single error.
• By adding another parity bit to the coded word, the Hamming code can be used to
correct a single error and detect double errors.
• 8‐bit data word 11000100 (n=8)
• Let k=5
• n+k=8+5=13 bits
1 2 3 4 5 6 7 8 9 10 11 12 13
P1 P2 1 P4 1 0 0 P8 0 1 0 0 P13