What parity bytes and blocks cannot detect

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

This What parity bytes and blocks cannot detect worksheet is part of the IGCSE Computer Science 0478 — 2.2 Methods of Error Detection journey. Print it as a booklet?

What parity bytes and blocks cannot detect

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Four bits at the corners of a rectangle in a parity block are flipped. What does the parity block check show?
A Four rows and columns show a parity error
B Every row and column parity is still correct, so the error is missed
2. Why does flipping two bits in the same row leave that row's parity unchanged?
A The number of 1s changes by two, so it stays odd or even as before
B The parity bit is automatically recalculated by the receiver
3. Which error can a parity block locate reliably?
A A single changed bit
B Four changed bits at the corners of a rectangle
4. Two bits in the same row are changed. What happens in a parity block check?
A The row check fails and points to exactly which two bits are wrong
B The row check passes, but two column checks fail, so the error cannot be located reliably
5. A parity block check guarantees that every transmission error will be found.
A False
B True

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1Flip (r1,c2) (r1,c6) (r4,c2) (r4,c6) AFour changed bits at the corners of a rectangle. Every row and column parity still looks correct, so the parity block check misses the error.
2Row 3 wrong, column 5 wrong BRow 2: 10110101 -> 11110001
3Two bit changes in the same row cancel out in that row's parity, so the row check passes CWrong rows: 2 and 4. Wrong columns: 3 and 6
4With errors in two rows and two columns, the block cannot tell which bits changed DOne wrong row and one wrong column mean a single error at their crossing point, not two errors.
54 flips in a rectangle -> parity block always catches it EFour flipped bits at the corners of a rectangle keep every row and column parity correct, so the block check misses them.
6Row 2 wrong + column 5 wrong = two errors found FPoints to one changed bit where row 3 and column 5 cross, so a single error can be located and corrected.

Definitions

four-corner error

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
IF rowFails = 0 ___ colFails = 0 THEN OUTPUT "No error found" ENDIF
2.
corners ← _ OUTPUT "Parity looks correct"
3.
errorsInRow ← 2 IF errorsInRow MOD _ = 0 THEN rowCheck ← "passes"
4.
IF rowFails = _ AND colFails = 1 THEN OUTPUT "Error located at intersection" ENDIF
5.
rowsChanged ← 2 colsChanged ← 2 bitsFlipped ← rowsChanged * ___________

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A OUTPUT "Four bits flipped"
B corners ← TRUE
C IF corners THEN missed ← FALSE
Question 2
A sent: 1 0 1 1 | 1
B received: 0 0 1 1 | 1
C // row parity still even
D // two bits changed in one row
Question 3
A rBad ← 1
B cBad ← 1
C IF rBad = 1 AND cBad = 1 THEN
D OUTPUT "cannot locate it"
Question 4
A 0 0 0 0
B 0 1 0 0
C 0 1 1 0
D 0 0 0 0
E // all parities still even
Question 5
A bitsChanged ← 1
B IF bitsChanged >= 1 THEN
C OUTPUT "located"
D ELSE OUTPUT "cannot locate"

Answer Key

What parity bytes and blocks cannot detect
Section A: Quick Questions
Q1
B — Every row and column parity is still correct, so the error is missed
Q2
A — The number of 1s changes by two, so it stays odd or even as before
Q3
A — A single changed bit
Q4
B — The row check passes, but two column checks fail, so the error cannot be located reliably
Q5
A — False
Section B: Match the Pairs
Q1
Flip (r1,c2) (r1,c6) (r4,c2) (r4,c6) → Four changed bits at the corners of a rectangle. Every row and column parity still looks correct, so the parity block check misses the error.
Q2
Row 3 wrong, column 5 wrong → Points to one changed bit where row 3 and column 5 cross, so a single error can be located and corrected.
Q3
Two bit changes in the same row cancel out in that row's parity, so the row check passes → Row 2: 10110101 -> 11110001
Q4
With errors in two rows and two columns, the block cannot tell which bits changed → Wrong rows: 2 and 4. Wrong columns: 3 and 6
Q5
4 flips in a rectangle -> parity block always catches it → Four flipped bits at the corners of a rectangle keep every row and column parity correct, so the block check misses them.
Q6
Row 2 wrong + column 5 wrong = two errors found → One wrong row and one wrong column mean a single error at their crossing point, not two errors.
Section C: Definitions
Q1
four-corner error — Four flipped bits at the corners of a rectangle keep every row and column parity correct, so a parity block check misses the error. Only one error can be located reliably.
Section D: Fill in the Blanks
Q1
IF rowFails = 0 AND colFails = 0 THEN OUTPUT "No error found" ENDIF
Q2
corners ← 4 OUTPUT "Parity looks correct"
Q3
errorsInRow ← 2 IF errorsInRow MOD 2 = 0 THEN rowCheck ← "passes"
Q4
IF rowFails = 1 AND colFails = 1 THEN OUTPUT "Error located at intersection" ENDIF
Q5
rowsChanged ← 2 colsChanged ← 2 bitsFlipped ← rowsChanged * colsChanged
Section E: Spot the Error
Q1
C — When the four flipped bits sit at the corners of a rectangle, every row and column parity stays correct. The check misses the error, so missed should be set to TRUE.
Q2
B — The line should show two bits changed in the row (1 0 1 1 becomes 0 0 1 0), so the row still has an even number of 1s and the row check passes. The broken line flips only one bit, which would make the row parity fail.
Q3
D — With exactly one bad row and one bad column, a single error can be located where they cross. The output should say the error is located, not that it cannot be located.
Q4
B — Every row and column must still have even parity after the four corner bits flip. The row 0 1 0 0 has an odd number of 1s, so it should be 0 1 1 0.
Q5
B — Only a single error can be located reliably. The test must be = 1, because with two or more changed bits the bad row and column cannot be pinned down.