Professional Documents
Culture Documents
Implementation of 16-Bit Hamming Code Encoder and Decoder For Single Bit Error Detector and Corrector
Implementation of 16-Bit Hamming Code Encoder and Decoder For Single Bit Error Detector and Corrector
Abstract : The search for correcting codes led to the Hamming code perfect 1-bit Error Correcting
Codes and then extended. Hamming code 1-bit Error Correcting and 2-bit Error Detecting Codes. In
mathematical terms, Hamming codes are a class of binary linear codes. For each integer p>2, there is a
code with ‘p’ parity bits and ((2^p)-p-1) data bits. The main aspect of this Hamming encoder and
decoder is to know how a code can be encoded and decoded using Hamming code. This project is
implemented for Hamming code single – bit error detection and single – bit error correction. For
Implementing this Single bit error detector and corrector Xilinx ISE 12.1i and the Micro wind Layout
Editor Tools was used. Hamming codes are widely used in computing, telecommunications and other
applications. It can only detect and correct the number of bits but cannot solve the problem.
Keword : Parity, Error Correction Codes (ECC), Error Detection Codes (EDC), Cross Talk, Soft Error,
Hamming Code.
I. INTRODUCTION
In the late 1940’s RICHARD HAMMING recognized that the future evolution of computers
required greater reliability, in particular the ability to not only to detect errors, but correct them. Thus
Hamming code is called error detecting and correcting code. The code uses a number of parity bits
located at certain positions in the code group.
The theory of error detecting and correcting codes is that branch of engineering and mathematics
which deals with the reliable transmission and storage of data. Imagine two individuals, call them the
sender and there receiver .The sender wishes to transmit a sequence of binary digits across a medium
called a channel to the receiver. If she sends a one, a one will probably be received, and if she sends a
zero, a zero will probably be received. The channel, however, is not totally reliable. Therefore,
occasionally, a transmitted one will be received as a zero, and a transmitted zero as a one. The sender is
unable to prevent the channel from making such errors. Can something be done to reduce their effects?
Hamming codes can detect and correct single-bit errors. In other words, the hamming distance
between the transmitted and received code-words must be zero or one for reliable communication.
Alternatively, it can detect (but not correct) up to two simultaneous bit errors.
In contrast, the simple parity code cannot correct errors, nor can it be used to detect more than
one error(such as where two bits are transposed).
2^p>=n+p+1
Where n = no. of bits entered, p=parity bits.
II. IMPLEMENTATION
A. Overview
Hamming algorithm is an error correction code that can be used to detect single and double-bit
errors and correct single-bit errors that can occur when binary data is transmitted from one device into
TRANSMITTER RECIVER
D. Calculation of P(0)
The positions of all the data bits which are mentioned in decimal system are converted into binary
system. The binary location number of parity bit p0 has a 1 for its right-most digit. This parity bit
checks all bit locations, including itself, that have 1s in the same location in the binary location
numbers. Therefore, parity bit p0 checks bit locations 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21 and assigns
p(0).
TABLE I
TABLE II
F. Calculation of P (2)
The binary location number of parity bit p2 has a 1 for its third right-most digit. This parity bit
checks all bit locations, including itself, that have 1s in the same location in the binary location
numbers. Therefore, parity bit p2 checks bit locations 4, 5, 6, 7, 12, 13, 14, 15, 20, 21 and assigns p(2).
TABLE III
G. calculation of P (3)
The binary location number of parity bit p3 has a 1 for its second left-most digit. This parity bit
checks all bit locations, including itself, that have 1s in the same location in the binary location
numbers. Therefore, parity bit p3 checks bit locations 8, 9, 10,11, 12, 13, 14,15 and assigns p(3).
TABLE IV
H . Calculation of P(4)
The binary location number of parity bit p4 has a 1 for its left-most digit. This parity bit checks
all bit locations, including itself, that have 1s in the same location in the binary location numbers.
Therefore, parity bit p4 checks bit locations 16, 17, 18, 19, 20, 21 and assigns p(4).
TABLE V
I . Formulae
The receiver takes the transmission and recalculates the new parity bits, using the same sets of
bits used by the sender. Plus, the relevant parity bits for each set. Then it assembles the new parity
values into a binary number in the descending order of parity position. Suppose if the bit has changed
Input d 0000000011000001
Output p 00100
Output hc 0000000001100000100
where d is data bits, p is parity values, hc is encoded data
Input h 000000000110000010100
Output syn 00000
Received rd 0000000011000001
data
Received rp 00100
parity
Generated gp 00100
parity
TABLE IX
Fig. 9. Single – bit error detection and correction layout with i/o pads
III. CONCLUSION
The RTL schematic diagrams are show in the figure. Successful implementation of the Hamming Code
Single Bit Error Detection and Correction using the Xilinx ISE.12.3 version and output wave forms are
shown in figure:10.Successfully implemented using Microwind Layout Editor Tool output waveform
are shown in figure 10. This Hamming Encoder can be implemented for any Memory circuit and in
communication devices to prevent Data loss.
REFERENCES
[1] www.wikipedia.org
[2] www.google.com [fig .1]
[ 3] HAMMING R. W. “Error detection and error correcting codes” Bell system tech. jour., 29,
1950:147-160.
[4] Shu Lin and Daniel j. Costello, jr., error control coding (Englewood clifff, new jersey: Pretence
hall 1983).
[5] Modern digital Electronics, 3rd edition by R. P. Jain.