dds assignment 1

Upload: syedsalmanali91

Post on 07-Oct-2015

219 views

Category:

Documents


0 download

DESCRIPTION

Hamming Code

TRANSCRIPT

A set of error correction codes that can be used to detect and correct bit errors that can occur when compute data is moved or stored. Used for error free communication in communication system. In communication system, information data transferred from source to destination by channel. In between source and destination data may be corrupted due to any type of noise. To find original information we use Hamming code error detection and correction technique. Extra bits that are generated and transferred along with data transfer to ensure no bits were lost during data transfer. We add these redundancy bits to the information data at the source end and remove at destination end. Presence of redundancy bit allows the receiver to detect or correct corrupted bit To get error free data at destination, we 1. Encrypt information data according to even and odd parity method before transmission of information at source end.2. Decryption and Correction(in case of any errors) at the receivers end. Formula for generating redundancy bit ----2^ r >= D + r + 1 ------------------------------------------- (1) Here r = number of redundancy bit;D = number of information data bit Calculate the number of number of redundancy bit for 25 bit of input data string by above formula we get 5 redundancy bit required. The redundancy bits are placed at the position that corresponds to the power of 2, i.e., 1, 2, 4, 8 and so on.TRANSMITTER The First block with data input represents the input, which we will give to the encoder. Next, the Encoder part will add the redundancy bits to the data and give out the data to PiSo. The PiSo is responsible for converting the given parallel input to serial output. Every bit is transferred separately.RECEIVER We use serial to parallel conversion to get the location of the bits. Decoder part receives the parallel data from SiPo, responsible for detecting error, and correcting the error. The decoder will give out the location of the erroneous bit, with the actual data without any error and without any redundancy bits. In hamming code with even and odd parity check method by using Verilog HDL, we transmit 25 bit information data with 5 redundancy bits from source and receive this data at destination. To find the value of these redundancy bits we have two methods1. Even parity method2. Odd parity method Destination receives 30 bit data, which was transmitted by source end. This received data may be corrupted due to noise. To remove this noise we find the address of error bit then correct them. For finding the location of error bit and correct them we use again even parity check method and/or odd parity check method . In addition, we have added two Converters 1. PISO (Parallel In Serial Out ) and 2. SIPO (Serial In Parallel Out) Used to transmit the data. We have also written code for decrypting this 30 bit encrypted data into 25 bit information data. No need to use another circuit for decryption of encrypted data. Up to today, at destination we were using one circuit for correcting error bit and another circuit for finding the information data from encrypted data. Now we can use only one circuit for correction error bit and finding the actual information data. We transmit 8 bits of information using 4 redundancy bits. Suppose the actual data we want to transfer is0 1 0 0 1 1 0 1Procedure: Redundancy bits are placed at positions 1, 2, 4, 8? ? 0 ? 1 0 0 ? 1 1 0 1P1= ? 0 1 0 1 0 = 0P2= ? 0 0 0 1 0 = 1P3= ? 1 0 0 1 = 0P4= ? 1 1 0 1 = 0 Redundancy bits are placed at positions 1, 2, 4, 8? ? 0 ? 1 0 0 ? 1 1 0 1P1= ? 0 1 0 1 0 = 0P2= ? 0 0 0 1 0 = 1P3= ? 1 0 0 1 = 0P4= ? 1 1 0 1 = 1 New Encoded data to be transmitted is, 0 1 0 0 1 0 0 1 1 1 0 1 Data to be received at the receiver.0 1 0 0 1 0 0 1 1 1 0 1 Actual data received( due to noise or error)0 1 0 0 1 0 0 1 1 1 1 1 Calculate parity bits againP1= 0 0 1 0 1 1 (Parity not correct)P2= 1 0 0 0 1 1 (Parity not correct)P4= 0 1 0 0 1 (correct)P8= 1 1 1 1 1 (Parity not correct) Parity bits 1 , 2 and 8 are not correct. So to find erroneous bit position we add 1+2+8 = 11.This implies 11th bit is the erroneous bit. So we change it to 0. The decrypted and corrected data is therefore, 0 1 0 0 1 0 0 1 1 1 0 1 We have used Xilinx ISE 10.1 Simulator for simulating and synthesized Verilog HDL Code. Xilinx ISE 10.1 Simulator is a simulator which is used for simulating HDL language and schematic circuit diagram.