← IGCSE Computer Science Paper 1

Finding the error in a parity block

In a parity block, the row and the column that both fail their parity check cross at the bit that changed. Flip that bit to correct a single-bit error.

Understanding Finding the error in a parity block in IGCSE Computer Science Paper 1

What it does: The failed row and failed column identify the position of the error where they intersect. A single parity bit only shows an error exists, but a block pinpoints the bit so it can be flipped. One failed row and one failed column cross at exactly one bit. That bit is the one that changed. The bit at the intersection has been flipped, so the received 1 must be changed back to 0. Once the crossing bit is located, flipping it back to its other value restores the original data.

Common mistakes: The bit at the crossing of the failed row and column has changed, so you must flip it with 1 - bit. Writing bit back leaves the error in place. This loop checks rows, so a failed row number must be stored in badRow, not badCol. It should be badRow ← r.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 155–164) and word search (Modules 142–164).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
How do you find the bit that changed in a parity block?
Find the row that fails and flip any bit in that row.Find the row and the column that both fail their parity check. The error is where they cross.
Matches
Only row 2 fails, so the error is the whole of row 2
↓
A failed row alone does not locate the bit. You also need the failed column, and the changed bit is where they cross.
Applying
Meanings
Term
failed row and column
Meaning
In a parity block, the row and the column that both fail their parity check cross at the bit that changed. Flip that bit to correct a single-bit error.
Practice
failedRow ← 2
Testing
Gaps
IF rowSum 2 = 1 THEN
Check Answer
Spots
3bit ← block[row][col]
4block[row][col] ← bit

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Hedgehog' badge — First Steps, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. How do you find the bit that changed in a parity block?
A. Find the row and the column that both fail their parity check. The error is where they cross. ✓
B. Find the row that fails and flip any bit in that row.
One failed row and one failed column cross at exactly one bit. That bit is the one that changed.
2. Row 3 and column 5 both fail their parity check. Where is the single-bit error?
A. At the one bit where row 3 meets column 5 ✓
B. In every bit of row 3 and every bit of column 5
Only the intersection of the failed row and the failed column is the changed bit. The other bits in that row and column are fine.
3. You have found the changed bit at the intersection. How do you correct it?
A. Flip it: change a 0 to a 1, or a 1 to a 0 ✓
B. Delete the bit and shorten the block
A single-bit error means one bit was flipped in transmission. Flipping it back restores the original data.
4. Which statement is true?
A. A single parity bit can locate a single-bit error, but a parity block cannot.
B. A parity block can locate a single-bit error, but a single parity bit can only show that an error happened. ✓
The block gives a row check and a column check. Together they pinpoint the bit, so the block does more than a single parity bit.
5. Only row 2 fails its parity check. What does that tell you on its own?
A. You know exactly which bit changed
B. The error is somewhere in row 2, but you do not know which column ✓
A failed row only narrows the error down to that row. The failed column is needed to find the exact bit.

Match the Pairs

Row 3 fails, column 5 fails → The changed bit is at the crossing point of row 3 and column 5
Flip bit at row 3, column 5: 1 -> 0 → Corrects a single-bit error once the changed bit has been found
The row and the column that both fail their parity check cross at the bit that has changed → Row 2 odd + column 4 odd -> error at row 2, column 4
A parity block can correct a single-bit error, which a single parity bit cannot → Error at row 2, column 4 is 0 -> flip it to 1
Only row 2 fails, so the error is the whole of row 2 → A failed row alone does not locate the bit. You also need the failed column, and the changed bit is where they cross.
Row 2 and column 4 fail, so the error is at row 4, column 2 → The row and column numbers are swapped. The error is at row 2, column 4, where the failed row and failed column cross.

Key Term

failed row and column
In a parity block, the row and the column that both fail their parity check cross at the bit that changed. Flip that bit to correct a single-bit error.

Fill in the Blanks

1. IF rowSum MOD 2 = 1 THEN rowFailed ← TRUE ENDIF
Hint: Type the operator that gives the remainder after dividing by 2, used to test whether the row parity is wrong.
2. badBit ← block[failedRow][failedCol]
Hint: Type the variable holding the failed column, so the row and column cross at the changed bit.
3. block[r][c] ← 1 - block[r][c]
Hint: Type the arithmetic operator that flips a bit: 0 becomes 1 and 1 becomes 0.
4. IF rowFailed AND colFailed THEN flip(row, col) ENDIF
Hint: Type the logic keyword that needs both the row check and the column check to fail.
5. FOR col ← 0 TO 7 IF colFailed[col] THEN errorCol ← col NEXT col
Hint: Type the variable that stores the column that failed its parity check.

Spot the Error

Question 1
A row ← 2
B col ← 3
C bit ← block[row][col]
D block[row][col] ← bit
Line D — The bit at the crossing of the failed row and column has changed, so you must flip it with 1 - bit. Writing bit back leaves the error in place.
Question 2
A FOR r ← 1 TO 4
B IF rowSum[r] MOD 2 = 1 THEN
C badCol ← r
D ENDIF
E NEXT r
Line C — This loop checks rows, so a failed row number must be stored in badRow, not badCol. It should be badRow ← r.
Question 3
A OUTPUT "Row", badRow
B OUTPUT "Col", badCol
C OUTPUT "Bit", badRow, badRow
Line C — The changed bit is at the crossing of the failed row and the failed column. The output must use badRow and badCol, not badRow twice.
Question 4
A IF row > 0 OR col > 0 THEN
B bit ← block[row][col]
C block[row][col] ← 1 - bit
D ENDIF
Line A — A single-bit error makes both a row and a column fail. The test needs AND so the bit is only corrected when a failed row and a failed column cross.
Question 5
A FOR c ← 1 TO 5
B IF colSum[c] MOD 2 = 0 THEN
C col ← c
D ENDIF
E NEXT c
Line B — With even parity, a column fails when it has an odd number of 1s. The test should be MOD 2 = 1, not 0, which would mark the columns that passed.

Student with a class code? Join your class →