Hamming Code
Hamming Code
Hamming Code
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.
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:
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: