1. Hamming Code System
Name- Dilshad Ahmad
Roll No-MT/EC/10007/19
Subject Code-EC564
Name- Richa Anand
Roll No-MT/EC/10014/19
Subject Code-EC564
ECE Dept. , BIT Mesra, Ranchi, 835215
5/30/2020
1
2. Content
Introduction
Errors
Type of Errors
Hamming Bound
Hamming Code system
Implementation of Hamming Code
Syndrome and Decoding
MATLAB Implementation Flow chart
Source Code
Output
Conclusion
5/30/2020
2
3. Introduction
Data can be corrupted during transmission, For reliable communication, errors must be
detected and corrected
So we required a ‘Coding technique’ to overcome these errors at receiver.
There is always some Bit Error Rate so to maintain some QoS we do encoding and
Decoding with a particular coding Scheme
So There are Various coding scheme used according to need and Application, like
Hamming code, cyclic coding convolutional code etc.
5/30/2020
3
4. Errors
What is Error?
o Error is a condition when the output information does not match with the input information. During
transmission, digital signals suffer from noise that can introduce errors in the binary bits travelling
from one system to other.
o That means a 0 bit may change to 1 or a 1 bit may change to 0.
Error Detection: Error detection is the detection of errors caused by noise or other
impairments during transmission from the transmitter to the receiver.
Error correction: Error correction is the detection of errors and reconstruction of the original,
error-free data.
5/30/2020
4
5. Type of Error:
There are Mainly Three Types of Errors Occurs
1. Single bit error.
2. Multi bits error.
3. Burst bits error.
1 0 1 0 1 0 1 1 1 0 1 0
Single bit error: In a frame, there is only one bit, anywhere though, which is corrupt
1 0 1 0 1 0 0 1 1 0 1 0
Multi bit error: Frame is received with more than one bits in corrupted state.
1 0 1 0 1 0 0 1 1 1 1 1
Burst bit error: Frame contains more than1 consecutive bits corrupted..
5/30/2020
5
6. Hamming code:
Around 1947 Richard W. Hamming developed technique for detecting and correcting single bit
errors in transmitted data. His technique requires that three parity bits (or check bits) be
transmitted with every four data bits. The algorithm is called a (7, 4) code, because it requires seven
bits to encoded four bits of data.
In communication, Hamming codes are a family of linear error-correcting. Hamming codes can
detect up to two-bit or correct one-bit errors without detection of uncorrected errors.
0 0 1 1 0 1 0 1 1 1 1 0 1 0
0 0 1 1 0 1 0
1 1 1 1 0 1 0
Detection
Hamming Decoding
At Receiver
2 bit Detected
At Transmitter
1 0 1 1 0 1 0
Channel
At Receiver
1 bit Error Corrected
Now Lets See what is these Hamming codes…
5/30/2020
6
7. Hamming Bound
Any ( n, k ) code which is capable of correcting ‘t’ errors should satisfy the following condition
Called Hamming Bound
2 𝑛−𝑘 ≥ 𝑖=0
𝑡
𝑛𝐶𝑖 For t=1(Single Error Correcting code)
2 𝑛−𝑘 ≥n+1
Any code which satisfy the equality condition in the hamming bound called perfect code
For n=7, k=4 Equality condition hold
So (7,4 ) single error correcting perfect code is called Hamming code
5/30/2020
7
8. Implementation of Hamming Code
To implement Hamming code firstly we calculate Parity Bits
Generator Matrix- It is matrix of [I,P] use to encode message bits
For Example
p1 = d2 + d3 + d4
p2 = d1 + d3 + d4
p3 = d1 + d2 + d4
5/30/2020
8
9. Continued…
So for any Message bits (4 bits) we can get code directly using Generator matrix
C=[d]*[G]
We send this Codeword through Channel and at receiver we decode this codeword
using parity check matrix also we find error is there or not
Let at Receiver we get a received codeword “r”
5/30/2020
9
10. Syndrome and Decoding
Syndrome-The pattern of errors, called the error syndrome, identifies the bit in error.
If all parity bits are correct, there is no error. Otherwise, the sum of the positions of the
erroneous parity bits identifies the erroneous bit.
S=[r]. [HT]
If S =0 No Errors
S ≠ 0 Errors are there and we got Error Vector e
S also gives location of error and this location vector verified from [HT]
5/30/2020
10
11. Continued…
At last after getting the error vector e
Correct codeword= r + e
This Syndrome Decoding for Hamming Code and error vector can’t correct more than
one error vector
For correction more errors we have to add more redundancy
5/30/2020
11
15. Conclusion
Hamming Code system is very much important where we need only one
error correction and two error detection system, it is very easy to
implement and for large number of block of bits it is more efficient.
5/30/2020
15