Search This Blog

Saturday, 5 December 2015

VHDL Code of (7,4) Hamming Code Encoder

Name of Pins
Direction
Width
Datain
Input
4
Hamout
Output
7


Hamming code is useful in Error Correction in Linear Block Code. This code will encode four bits of data and generate seven bits of code by adding three bits as parity bits. It was introduced by Richard W. Hamming. This algorithm can detect one and two bit error and can correct one bit error. Given below code will generate (7,4) Systematic Hamming Encoder. This encoder will use Least Significant 4 bits as data inputs and Most 3 significant bits as a parity bits.
Parity bits equations are given below

p0 = datain(0) xor datain(1) xor datain(3)
p1 = datain(0) xor datain(2) xor datain(3)
p2 = datain(1) xor datain(2) xor datain(3)