HAMMING CODE PPT | Error Detection And Correction | Theoretical Computer Science

# 8 Bit Hamming Code Correction And Detection

Presented by TE-1 -Shoubhik Pande -Vijay Nair -Viral Nagda -Pritesh Varsolkar

39 44 45 50

but cannot be corrected  An error-correction code  generates multiple parity check bits  the check bits generate a unique pattern.Error Detection and Correction  Improve the performance of communication network  A simple error detection scheme  a parity bit  a single bit error can be detected. called a syndrome  the specific bit in error can be identified .

Hamming Code  k parity bits are added to an n-bit data word to form a new word of n+k bits  Criteria: (2k –1  n + k)  The bit positions are numbered in sequence from 1 to n + k  Those positions numbered as a power of 2 are reserved for the parity bits  The remaining bits are the data bits .

6. n = 8  k = 4 Bit position: 1 2 3 4 5 6 7 8 9 10 11 12 P1 P2 1 P4 1 0 0 P8 0 1 0 0  Calculate the parity bits: even parity  assumption P1 = XOR of bits (3. 6. 7. 12) = 1  0  0  0 = 1 P8 = XOR of bits (9. 7. 10. Bit position: 1 2 3 4 5 6 7 8 9 10 11 12 0 0 1 1 1 0 0 1 0 1 0 0 . 9. 10. 11) = 1  1  0  0  0 = 0 P2 = XOR of bits (3. 5. 11) = 1  0  0  1  0 = 0 P4 = XOR of bits (5. 12) = 0  1  0  0 = 1  Store the 12-bit composite word in memory. 11. 7.Example: 8-bit data word 11000100  Include 4 parity bits and the 8-bit word  12 bits 2k –1  n + k.

7. 7. P4) C8 = XOR of bits (8. P1) C2 = XOR of bits (2. 11)=XOR of bits(1. 10. P8)  If no error has occurred Bit position: 1 2 3 4 5 6 7 8 9 10 11 12 0 0 1 1 1 0 0 1 0 1 0 0  C = C8C4C2C1 = 0000 . 10. 5.How to Check?  When the 12 bits are read from the memory  Check bits are calculated C1 = XOR of bits (1. 3. 3. 12)=XOR of bits(4. 7. 11. 11)=XOR of bits(2. 9. P2) C4 = XOR of bits (4. 6. 9. 12)=XOR of bits(8. 6. 5.

12) = 0 C8C4C2C1 = 0001  error in bit 5  C8C4C2C1 = 0101  Two-bit error  errors in bits 1 and 5  C8C4C2C1 = 0100  can not detect !! . 11. 11) = 1 C2 = XOR of bits (2. 3. 12) = 0 C8 = XOR of bits (8. 9. 6. 5. 10. 9. 10. 3.When Error Happen !!  One-bit error  error in bit 1      C1 = XOR of bits (1. 6. 7. 11) = 0 C4 = XOR of bits (4. 7. 5. 7.

5. 9. 11) = 1  C4 = XOR of bits (4. 7. 12-bit Hamming code word containing 8 bits of data and 4 parity bits is read from memory. 7.  What was the original 8-bit data word that was written into memory if the 12-bit word read out is 000011101010?  Answer Bit position: 1 2 3 4 5 6 7 8 9 10 11 12 P1 P2 0 P4 1 1 1 P8 1 0 1 0  C1 = XOR of bits (1. 12) = 0  C=0110  Error in bit 6  correct 8-bit data 01011010 . 3. 11) = 0  C2 = XOR of bits (2. 7. 5. 3. 10. 9. 6. 10. 12) = 1  C8 = XOR of bits (8. 11. 6.

9. 5. 11) C2 = XOR of bits (2. 7. 7. 11) C4 = XOR of bits (4. 9. 12) …. 7. 10. 3. 3. 11. cb for 2k-1=XOR of bits with 2k-1 set in their bit # .How to Determine Check Bits Locations?  Bit position: 1 2 3 4 5 6 7 8 9 10 11 12 P1 P2 D7 P4 D6 D5 D4 P8 D3 D2 D1 D0  Check bits (cb) locations: C1 = XOR of bits (1. 12) C8 = XOR of bits (8. 10. 6. 5. 6.

: the previous 12-bit coded word 0 0 1 1 1 0 0 1 0 1 0 0 P13  0 0 1 1 1 0 0 1 0 1 0 0 1 (even parity).  The additional parity bit is the XOR of all the other bits  E.g. .Single-Error Correction. Double-Error Detection  Hamming code  Can detect and correct only a single error  Multiple errors may not be detected  Hamming code + a parity bit  Can detect double errors and correct a single error.

 VHDL implementation of Hamming code can be part of soft core communication system. .Applications:  Hamming code is useful for detecting and correcting errors.

THANK YOU .

Sign up to vote on this title