Report

ERROR DETECTION AND CORRECTION CODES Error Detection Code (Parity bit) Error Correction Code ( Hamming Code) ERRORS While transferring information from one storage media to another, error may occur due to uneven magnetic surface or due to noise or failure. For Example: if transmitter sends 8-bit data 11100101. But receiver receives 8-bit as 11000101 due to some noise or some other failure. Error 11100101 Transmitter 11000101 Receiver HOW TO DETECT THIS TYPES OF ERRORS ? For detecting such type of errors, we use the method of Parity in which an extra bit known as parity bit or parity check bit is added with the information/word. Now, we can send information or word either using ODD parity or EVEN parity. For ODD parity, the parity bit is so choosen that the total number of 1’s in each information or word is always odd, including the parity bit. And for EVEN parity, the parity bit is so choosen that the total number of 1’s in each information or word is always even, including the parity bit. ODD/EVEN PARITY BITS Information/Word 11100011 10011100 11110111 10101011 10011100 11111110 Odd Parity (OP) 0 1 0 0 1 0 11100011 10011100 11110111 10101011 10011100 11111110 Even Parity (EP) 1 0 1 1 0 1 11100011 10011100 11110111 10101011 10011100 11111110 USE OF PARITY BIT In previous example receiver do not know about the error. Because there is no mechanism by which the receiver detect the error. So what is the solution? By using parity bit receiver can easily detect the error (one bit error). PREVIOUS EXAMPLE WITH PARITY BIT Suppose we are using ODD Parity System. Error 11100101 11000101 Transmitter Receiver In order to generate parity bit we have to count the number of 1’s present in the information at transmitting end. 11100101 No of 1’s We have 5 Ones (1’s) PREVIOUS EXAMPLE WITH PARITY BIT As we are using ODD Parity Bit System, and we have 5 ones (1’s) in the information so the Parity bit is? Answer: 0 The information word with Parity Bit. 0 + Parity Bit 11100101 011100101 Information/word Information/Word with Parity Bit SEND THIS WORD TO THE RECEIVER Suppose at receiving end the word is received as 011000101. Now the complete situation is like..... Error 011100101 Transmitter 011000101 Receiver INFORMATION AT RECEIVING END 011000101 Information at Receiving End How to detect the error at Receiving End? Again count the number of ones (1’s) at Receiving End. No of 1’s 011000101 We Have 4 Ones (1’s) Information at Receiving End As we are using ODD Parity Bit system so according to that we have odd number of 1’s. That means the data at receiving end is not correct. ERROR DETECTION Now we know that there is some error in the information/word at receiving end. But what is the error and on which bit? How we can detect? By using Hamming codes. ERROR CORRECTION CODE By the use of Parity Bit we can just detect that, the information/word at receiving end is not correct. Because it is Error Detection Code. So the error detection code simple detect either the information/word at receiving end is correct or not. But it can’t correct the information/word. For this we need Error Correction Code. Hamming Code is one of the wall-known error correction Code. HAMMING CODE Three Steps Before Transmission. 1. Determine the number of Parity Bits to be added to the given message bits. 2. Determine the position of parity bits. 3. Determine the position checked by the Parity bits.