# Explain the following with the help of a suitable diagram or an example: Error detection and correction process 5m Dec2005

By | November 2, 2014

Explain the following with the help of a suitable diagram or an example.

Error detection and correction process 5m Dec2005

## Error Detection and Correction Codes:

The code, which helps in recognition and correction of errors

Computer is an electronic media; therefore, there is a possibility of errors during data transmission. Such errors may result from disturbances in transmission media or external environment. But what is an error in binary bit? An error bit changes from 0 to 1 or 1 to 0. One of the simplest error detection codes is called parity bit.

Parity bit: A parity bit is an error detection bit added to binary data such that it makes the total number of 1’s in the data either odd or even.

But how does the parity bit detect an error in an error detection and correction system

Objective: Data should be transmitted between a source data pair reliably, indicating error, or even correcting it, if possible.

The Process:

•  An error detection function is applied on the data available at the source end an error detection code is generated.
•  The data and error detection or correction code are stored together at source.
•  On receiving the data transmission request, the stored data along with stored error detection or correction code are transmitted to the unit requesting data (Destination).
•  On receiving the data and error detection/correction code from source, the destination once again applies same error detection/correction function as has been applied at source on the data received (but not on error detection / correction code received from source) and generates destination error detection / correction code.
•  Source and destination error codes are compared to flag or correct an error as the case may be.

The parity bit is only an error detection code. The concept of error detection and correction code has been developed using more than one parity bits. One such code is Hamming error correcting code.

Hamming Error-Correcting Code: Richard Hamming at Bell Laboratories devised this code. We will introduce this code with help of an example for 4 bit data.

Let us assume a four bit number b4, b3, b2, b1. In order to build a simple error detection code that detects error in one bit only, we may just add an odd parity bit. However, if we want to find which bit is in error then we may have to use parity bits for various combinations of these 4 bits such that a bit error can be identified uniquely. For example, we may create four parity sets as

Source Parity  Destination Parity

b2, b3, b4                    P2                                D2

b3, b4, b1                     P3                                D3

b1, b2, b3, b4              P4                                D4

Now, a very interesting phenomenon can be noticed in the above parity pairs. Suppose data bit b1 is in error on transmission then, it will cause change in destination parity D1, D3, D4.

ERROR IN       Cause change in Destination Parity

(One bit only)

b1                                          D1, D3, D4

b2                                          D1, D2, D4

b3                                          D1, D2, D3, D4

b4                                          D2, D3, D4

The error detection parity code mismatch

Thus, by simply comparing parity bits of source and destination we can identify that which of the four bits is in error. This bit then can be complemented to remove error.

Normally, Single Error Correction (SEC) code is used in semiconductor memories for correction of single bit errors; however, it is supplemented with an added feature for detection of errors in two bits. This is called a SEC-DED (Single Error Correction- Double Error Detecting) code. This code requires an additional check bit in comparison to SEC code. We will only illustrate the working principle of SEC-DED code with the help of an example for a 4-bit data word. Basically, the SEC-DED code guards against the errors of two bits in SEC codes.