Parity Check
Overview/Summary:
A parity check is a simple error detection technique used in data transmission. It adds an extra bit, called a parity bit, to a data unit (e.g., a byte) to ensure that the total number of 1s (or 0s, depending on the parity scheme) in the transmitted data, including the parity bit, is either even (for even parity) or odd (for odd parity). At the receiving end, the parity is checked. If it doesn’t match the agreed-upon parity (even or odd), an error is detected.
Detailed Explanation:
Parity check is a basic form of error detection that works by adding a redundant bit, the parity bit, to a block of data. The value of the parity bit is chosen so that the total number of 1s in the transmitted data (including the parity bit) satisfies the chosen parity scheme.
There are two main types of parity:
-
Even Parity: The parity bit is set to 1 if the number of 1s in the data bits is odd, making the total number of 1s (data bits + parity bit) even. If the number of 1s in the data bits is already even, the parity bit is set to 0.
-
Odd Parity: The parity bit is set to 1 if the number of 1s in the data bits is even, making the total number of 1s (data bits + parity bit) odd. If the number of 1s in the data bits is already odd, the parity bit is set to 0.
Example:
Let’s say we want to transmit the data byte 1011001.
-
Even Parity: The data byte has four 1s (an even number). Therefore, the parity bit would be 0, making the transmitted data 10110010.
-
Odd Parity: The data byte has four 1s (an even number). Therefore, the parity bit would be 1, making the transmitted data 10110011.
Detection of Errors:
At the receiving end, the parity of the received data (including the parity bit) is checked. If the received parity doesn’t match the agreed-upon parity, an error is detected.
Limitations:
Parity check can detect single-bit errors. However, it cannot detect even numbers of errors because they would cancel each other out. For example, if two bits are flipped during transmission, the parity would still be correct, and the error would go undetected. It also cannot correct errors; it can only detect them. More sophisticated error detection and correction techniques are needed for reliable communication in noisy environments.