Error Detection · Cambridge syllabus 2.2 · Lesson 1 of 5
Parity Checks
A parity bit makes the total number of 1 bits even or odd. The receiver checks the expected parity. Any odd number of flipped bits changes parity, but an even number of flips can escape detection.
By the end, you can
- Understand the purpose of a parity bit.
- Use even parity.
- Use odd parity.
- Identify errors using parity.
- Explain how interference during transmission can cause data loss, data gain and data change.
- Use a parity byte and a parity block check to locate an error.
Parity bits
Data can be changed during transmission. Interference, from electrical equipment or a weak signal, can cause data loss, where bits go missing; data gain, where extra bits appear; and data change, where a 0 becomes a 1 or a 1 becomes a 0. So data must be checked for errors after it has been sent, and an error-detection method lets the receiver tell that something has gone wrong, so it can ask for the data again.
A parity check uses one bit of each byte — usually the leftmost — as a parity bit, leaving seven bits for the data. Before sending, the sender sets the parity bit so that the number of 1s in the whole byte follows an agreed rule.
Under even parity the total number of 1s must be even. The seven data bits 0110100 contain three 1s, so the parity bit is set to 1, making four, and 10110100 is sent. Under odd parity the total must be odd, so the same data would take a parity bit of 0.
The receiver counts the 1s in each byte it receives. If the count breaks the agreed rule, at least one bit has changed and the byte is rejected and requested again.
Parity is cheap but weak. If two bits flip in the same byte the count is correct again and the error passes unnoticed, and even when an error is detected, a single parity bit cannot say which bit was wrong.
A parity block check does better. The bytes of a block are stacked in rows, each with its own parity bit, and an extra parity byte is added at the bottom, holding a parity bit for each column. If one bit flips, one row and one column both fail their parity check, and the wrong bit is the one where that row and that column cross, so it can even be corrected.
Worth remembering
- One bit per byte is set so the count of 1s is even (even parity) or odd (odd parity).
- The receiver recounts; a broken rule means the byte is corrupted.
- Two flipped bits in one byte cancel out, so parity misses them.
- Parity block: the failing row and the failing column meet at the wrong bit.
Worked example
Data 1011001 contains four 1s. Even parity adds 0; odd parity adds 1.
Practice
Warm-up · not marked
Check your understanding
Answer in your own words, then compare with the worked answer. Nothing here is saved or scored.
Worked answer
No. Two flips can leave the total number of 1s with the same parity.
Check your method, units and explanation against it.
Marked practice
Set 1 of 5 · easiest first · Checked as you go, with the worked answer. Sign in or create a free account to save your progress.