0% found this document useful (2 votes)
769 views6 pages

Hamming Code: Error Detection & Correction

Hamming codes can detect single and up to 3 bit errors, and correct single-bit errors. They work by adding redundant check bits that are calculated from the data bits. At the receiver, the check bits are used to detect and locate any errors by comparing the received and calculated check bit values. Example problems demonstrate how hamming codes encode data, detect and locate errors, and recover the original data.

Uploaded by

stsbangalore
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (2 votes)
769 views6 pages

Hamming Code: Error Detection & Correction

Hamming codes can detect single and up to 3 bit errors, and correct single-bit errors. They work by adding redundant check bits that are calculated from the data bits. At the receiver, the check bits are used to detect and locate any errors by comparing the received and calculated check bit values. Example problems demonstrate how hamming codes encode data, detect and locate errors, and recover the original data.

Uploaded by

stsbangalore
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
  • Introduction to Hamming Code
  • Example 1: Basic Encoding
  • Receiver's Error Detection
  • Error Identification and Correction
  • Example 2: Using (7,4) Code
  • Example 3: Decoding a Message

Hamming Code –

Error Detection and Correction

In data communication, a hamming code is


an error-correcting code named after its
inventor, Richard Hamming.

Hamming codes can detect single and


up to 3 bits error, and correct single-bit
error as well.

1
Hamming Code –
Error Detection and Correction
Example 1: Given data 1001101 (MSB left). Using Hamming
(11,7), determine the coded message.
To determine the coded message: The check bits marked x
are calculated by adding(using Modulo-2) the four-bit
binary numbers corresponding to bits positions with a
binary 1. In this e.g..
Step 1 11 10 9 8 7 6 5 4 3 2 1 (bit position)
1 0 0 x 1 1 0 x 1 x x (x are check bits)
Step 2
Step 3
11 = 1 0 1 1 Modulo-2
11 10 9 8 7 6 5 4 3 2 1
7 = 0 1 1 1 means
1 0 0 1 1 1 0 0 1 0 1 6 = 0 1 1 0 Exclusive OR
3 = 0 0 1 1+ (xor)
1 0 0 1
Transmitted coded message = 100111001012
2
Hamming Code –
Error Detection and Correction
From example 1:
At receiver’s end, the following steps will be
carried out to check for 1-bit error.
 Binary numbers corresponding to bit positions
with binary 1 are added (Modulo-2)

Received message 11 = 1 0 1 1
8 = 1 0 0 0
11 10 9 8 7 6 5 4 3 2 1 7 = 0 1 1 1
1 0 0 1 1 1 0 0 1 0 1 6 = 0 1 1 0 No errors
3 = 0 0 1 1
1 = 0 0 0 1+
The result of the 0 0 0 0
Modula-2 addition
Gives the bit in error. 3
Hamming Code –
Error Detection and Correction
From example 1: If the received data has an error
occurring in one of the bits, the resultant Modulo-2
addition pin-points the error.
11 = 1 0 1 1
8 = 1 0 0 0
If received data is:
7 = 0 1 1 1
11 10 9 8 7 6 5 4 3 2 1 6 = 0 1 1 0
1 0 0 1 1 1 1 0 1 0 1 5 = 0 1 0 1
3 = 0 0 1 1
Result indicates that 1 = 0 0 0 1+
error occurred at bit 5, 0 1 0 1
hence invert bit 5 to correct
the error.
LSB
So the original coded data = 100111001012
4
LSB
Hamming Code –
Error Detection and Correction
The example which we have dealt with is called the Hamming
(11, 7) code consisting of 7 data bits and 4 redundant bits
called check bits.
Another frequently used Hamming code is the Hamming (7, 4)
code which consist of 4 data bits and 3 redundant bits.

Example 2 : Encode the data 1010 with Hamming (7, 4),


assuming that the left most bit is the MSB.

Step 1: 7 6 5 4 3 2 1

5
Hamming Code –
Error Detection and Correction
Example 3: A message, 10010011000 coded using
hamming (11,7) was received by PC X. What is the
original data sent?
Answer:

1 
In data communication, a hamming code is 
an error-correcting code named after its  
inventor, Richard Hamming.  
 
Hammin
2 Hamming Code –  Error Detection and Correction  
Hamming Code –  
Error Detection and Correction  
To determine the coded m
3 
From example 1: 
At receiver’s end, the following steps will be  
carried out to check for 1-bit error. 

Binary numbers
4 
From example 1: If the received data has an error 
occurring in one of the bits, the resultant Modulo-2 
addition pin-poin
5 
The example which we have dealt with is called the Hamming 
(11, 7) code consisting of 7 data bits and 4 redundant bits 
c
6 
Example 3: A message, 10010011000 coded using  
hamming (11,7) was received by PC X. What is the  
original data sent? 
An

You might also like