Unable to open this exercise
2D Parity Blocks (Matrix Parity)
A 2D Parity Block (also called horizontal and vertical parity) can locate and correct an assumed single-bit error and detect many, but not all, multiple-bit errors.
How a Parity Block Works:
- Data is transmitted as a block of multiple bytes arranged in a table (grid).
- Horizontal Parity: Each individual byte (row) contains its own parity bit.
- Vertical Parity: An entire extra byte (the Parity Byte) is calculated and appended at the bottom, containing a parity bit for each column.
Worked Example: Even Parity Block
Suppose 4 bytes of data are transmitted using Even Parity:
Col 7 Col 6 Col 5 Col 4 Col 3 Col 2 Col 1 [Parity Bit] Row Parity Status
Byte 1: 1 0 1 1 0 0 1 0 -> 4 ones (Valid Even)
Byte 2: 0 1 1 0 1 1 0 0 -> 4 ones (Valid Even)
Byte 3: 1 1 0 1 0 0 0 1 -> 4 ones (Valid Even)
Byte 4: 0 0 1 1 1 0 1 0 -> 4 ones (Valid Even)
-------------------------------------------------------------------------
Parity Byte: 0 0 1 1 0 1 0 1 -> Column Parity
Detecting and Correcting a Flipped Bit
Suppose during transmission, electrical noise flips Row 2, Column 5 from 1 to 0:
Col 7 Col 6 Col 5 Col 4 Col 3 Col 2 Col 1 [Parity Bit]
Byte 1: 1 0 1 1 0 0 1 0 -> OK
Byte 2: 0 1 [0] 0 1 1 0 0 -> ERROR! (3 ones)
Byte 3: 1 1 0 1 0 0 0 1 -> OK
Byte 4: 0 0 1 1 1 0 1 0 -> OK
-------------------------------------------------------------------------
Parity Byte: 0 0 1 1 0 1 0 1
OK OK ERROR! OK OK OK OK OK
- Row Check: Row 2 now has three 1s instead of an even number $\implies$ Row 2 has an error.
- Column Check: Column 5 now has three 1s instead of four, including its parity bit $\implies$ Column 5 has an error.
- Intersection: The intersection of Row 2 and Column 5 identifies the exact erroneous bit.
- Correction: The receiver inverts the bit from
0back to1. The data is restored to pristine accuracy without requesting a slow network retransmission!
Limits and independent practice
Always count the parity bit when checking a row or column. An odd result where even parity is required indicates a mismatch. With an assumed single-bit error, the failed row and column identify its location. If four corners of a rectangle flip, each affected row and column changes twice and the errors can remain undetected. Do not claim arbitrary multi-bit correction.
AI Socratic Tutor
Need guidance? Ask a question or use the hint below.
AI Socratic Tutor is an All-Access Benefit
Unlock step-by-step Socratic hints, algorithm trace table walkthroughs, and error diagnostics for every Cambridge exercise.
You're chatting with an AI tutor, not a person. AI can make mistakes, so double-check its answers.
Independent Practice: Check an entire block
Independent Practice: Check an entire block
- Rows including even parity are 1010, 1101, 0110; the final parity row is 0000. Number of 1s in row 2: [Space 1]
- Number of 1s in column 4 including its parity bit: [Space 2]
- Assuming one error, correct row 2 as four binary digits: [Space 3]
Interactive exercises for Module 2 and beyond require an active plan.