DESIGN OF HAMMING CODE FOR 64 BIT SINGLE ERROR DETECTION AND CORRECTION USING VHDL

: - Hamming code is an efficient error detection and correction technique which can be used to detect single and burst errors, and correct errors. In communication system information data transferred from source to destination by channel, which may be corrupted due to a noise. So to find original information we use Hamming code. In this paper, we have described how we can generate 7 redundancy bit for 64 bit information data. These redundancy bits are to be interspersed at the bit positions (n = 1, 2, 4, 8, 16, 32 and 64) of the original data bits, so to transmit 64 bit information data we need 7 redundancy bit generated by even parity check method to make 71 bit data string. At the destination receiver point, we receive 71 bit data, this receives data may be corrupted due to noise. In Hamming technique the receiver will decided if data have an error or not, so if it detected the error it will find the position of the error bit and corrects it. This paper presents the design of the transmitter and the receiver with Hamming code redundancy technique using VHDL. The Xilinx ISE 10.1 Simulator was used for simulating VHDL code for both the transmitter and receiver sides.


INTRODUCTION
The theory of linear block codes is well established since many years ago. In 1948 Shannon's work showed that any communication channel could be characterized by a capacity at which information could be reliably transmitted. In 1950, Hamming introduced a single error correcting and double error detecting codes with its geometrical model (1). Hamming(7,4)-code. Hamming codes can detect up to two-bit errors or correct one-bit errors.
By contrast, the simple parity code cannot correct errors, and can detect only an odd number of bits in error. Hamming codes are perfect codes, that is, they achieve the highest possible rate for codes with their block length and minimum distance 3 (2, 3) .
Due to the limited redundancy that Hamming codes add to the data, they can only detect and correct errors when the error rate is low. This is the case in computer memory (Error Checking & Correction, ECC memory), where bit errors are extremely rare and Hamming codes are widely used. In this context, an extended Hamming code having one extra parity bit is often used. Extended Hamming codes achieve a Hamming distance of 4, which allows the decoder to distinguish between when at most one bit error occurred and when two bit errors occurred. In this sense, extended Hamming codes are single-errorcorrecting (SED) and double-error-detecting (DED). The ECC functions described in this application note are made possible by Hamming code, a relatively simple yet powerful ECC code. It involves transmitting data with multiple check bits (parity) and decoding the associated check bits when receiving data to detect errors. The check bits are parallel parity bits generated from XORing certain bits in the original data word. If bit error(s) are introduced in the codeword, several check bits show parity errors after decoding the retrieved codeword. The combination of these check bit errors display the nature of the error. In addition, the position of any single bit error is identified from the check bits (2,4) .
Error detection and correction codes are used in many common systems including: storage devices (CD, DVD, DRAM), mobile communication (cellular telephones, wireless, microwave links), digital television, and high-speed modems. Hamming codes is a Forward Error Correction (FEC), as a fundamental principle of channel coding techniques, provides the ability to correct transmission errors without requiring a feedback channel for a correct retransmission. The exact correction capability of an FEC code varies depending on the coding schemes used (5,6) .
The basic idea for achieving error detection is to add some redundancy bits to the original message to be used by the receivers to check consistency of the delivered message and to recover the correct data. Error-detection schemes can be either systematic or nonsystematic: In a systematic scheme the transmitter sends the original data and attaches a fixed number of check bits. That is derived from the data bits by some deterministic algorithm. If only error detection is required a receiver can simply apply the same algorithm to the received data bits and compare its output with the received check bits if the values do not match an error has occurred at some point during the transmission. In a system that uses a 24 non-systematic code the original message is transformed into an encoded message that has at least as many bits as the original message. Error correction & detection Hamming code may perform using Even parity or Odd parity (7,8) .

Suppose,
we want to transmit 64 information data bit is "0101010101010101010101010101010101010101010101010101010101010101"which equal in hexadecimal"5555555555555555". For this 64 bit information data we need 7 redundancy bits using even parity method. After generating redundancy bits, add these bits to 64 bit information data for making 71 bit data string for transmission at source end. How we can generate 7 redundancy bits for 64 bit information data for making 71 bit data string for transmission at source end by using even parity method will be discussed in details at communication with even parity method. At destination receiver receives 71 bit data string from channel and check it, is it corrupted or not? If it is corrupted then the receiver find the error location according to parity check method correct it.

Error Detection and Correction
For a given practical requirement, detection of errors is simpler than the correction of errors. The decision for applying detection or correction in a given code design depends on the characteristics of the application. When the communication system is able to provide a full duplex transmission (that is, a transmission for which the source and the destination can communicate at the same time, and in a two way mode, as it is in the case of telephone connection, for instance), codes can be designed for detecting errors, because the correction is performed by requiring a repetition of the transmission (3,8) .
These schemes are known as automatic repeat request (ARQ) schemes. In any ARQ system there is the possibility of requiring a retransmission of a given message. There are on the other hand communication systems for which the full-duplex mode is not allowed. An example of one of them is the communication system called paging, a sending of alphanumerical characters as text messages for a mobile user. In this type of communication system, there is no possibility of requiring retransmission in the case of a detected error, and so the receiver has to implement some error-correction algorithm to properly decode the message. This transmission mode is known as forward error correction (FEC) (3,8) .

HAMMING CODE
Hamming code is a linear error-correcting code named after its inventor, Richard Hamming. Hamming codes can detect up to two simultaneous bit errors, and correct singlebit error. By contrast, the simple parity code cannot correct errors, and can only detect an odd bits by adding three parity bits. Hamming (7,4) can detect and correct singlebit errors.
With the addition of overall parity bit, it can also detect (but not correct) double bit errors.
Hamming code is an improvement on parity check method. It can correct 1 error bit only (9) .
Hamming code used two methods (even parity and odd parity) for generating redundancy bit. The number of redundancy bits depends on the size of information data bits as shown below (8,9,10,11) : Where r = number of redundancy bit. m = number of information data bits.

Hamming Encoder
In communication system need two main part one of them is the source for sending data and another is the destination to receive the transmitted data. Even parity check method count the number of one`s if number of one`s are even it adds zero (0) otherwise it adds one (1) (8).
At the transmitter the 64 bit information data needs 7 redundancy bit according to equation (1). Suppose, these redundancy bits are R(1),R(2),R(4),r(8),R(16) R(32),R(64),and to calculate these redundancy bits easily done by XORing operation of the original data bit positions as shown below: The value of redundancy bits can be calculated using an even parity check method.
The value of redundancy bit can be calculated by XORing of different locations of information data bits, as shown in Figure ( Table (1).

Hamming Decoder
At the receiver side 71 bit information data is received, 64 bit encrypted information data and redundancy 7 bits. At the destination, the receiver receives 71 bit encrypted data and check for any error that may occurred. If any error is occurred, receiver find the error location and corrects it. Hamming decoder detect the error by EXORing data and corrected it by a NOT gate (8). According to Hamming detection method take even parity check to get the address of error location is = 0000011 (the third bit at the input data). After getting the location of error bit, the receiver correct, that error bit by replacing zero by one and one by zero. To produce the actual transmitted data.
We write VHDL code to find the error bit location, correction it and decrypt this  Table (2).

CONCLUSION
As a conclusion, Hamming code error detection and correction with even parity check method can be design using 64 bits data string in VHDL and can be implemented in FPGA. it

DESIGN OF HAMMING CODE FOR 64 BIT SINGLE ERROR DETECTION AND CORRECTION USING VHDL
speed up the communication as we can encode the total data bits as a whole and send as soon, so there are no need for data splitting, therefore more combination (more information in a single frame) of data can be transmitted easily. The complexity of circuit also reduced for regenerating actual information data from encrypted corrupt received data at destination end by using of the same method at the source end, so the original data can be correctly recovered.