Error Detection Codes



Whenever a message is transmitted, it may get scrambled by noise or data may get corrupted. To avoid this, we use error-detecting codes which are additional data added to a given digital message to help us detect if an error occurred during transmission of the message. A simple example of error-detecting code is parity code.






Parity Code:

Parity code is nothing but a single bit code that is added to the original bit stream (original data) in order to make the total count of 1’s either ODD or EVEN. Due to this mechanism, entire parity code system is categorized into the following two types:

The following table shows both the EVEN Parity and ODD Parity bits for a 3-bit data-word:



Following diagram shows how parity mechanism works for detecting one bit error in a three bit data. The count of 1 in original data was even, we appended an additional 1 to make the count of ones ODD. On the receiver's end, count of 1 was found even. This shows there is error in the received data.



Parity Generator and Checker Circuits:

Parity Generator Circuit uses a combination of nested XOR and XNOR gates to compute the ODD Parity bit while Parity Checker Circuit uses the same combination on the receiver’s end to check for that ODD Parity.