What a single parity check cannot detect

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

What a single parity check cannot detect

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A byte is sent with even parity and two of its bits flip in transit. What does the parity check report?
A An error, because two bits changed
B No error, because the count of 1s still has the right parity
2. Which error will a single parity check miss?
A Four bits in the byte flip
B One bit in the byte flips
3. A 0 flips to a 1 and a 1 flips to a 0 in the same byte. Is the parity check likely to notice?
A No, the number of 1s stays the same
B Yes, because the bits are different now
4. A parity check reports an error in a received byte. What can the receiver tell from the parity bit alone?
A That at least one bit is wrong, but not which one
B Exactly which bit is wrong, so it can fix it
5. Which statement about a single parity check is true?
A It points to the position of the flipped bit
B It cannot locate the bit that has changed

Match the Pairs

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

Left columnRight column
1Sent 10110001 (even parity), received 10010101 Aif bytes_received != bytes_expected: error
2Sent 11001100, received 11001010 Bif parity_error: request_resend(byte)
3A parity error only tells you that a byte is wrong, not which bit, so the whole byte must be sent again CParity cannot show which bit is wrong, so you cannot know bit 3 is the faulty one
4A single parity check cannot spot a missing byte unless the number of bytes is also counted DTwo flipped bits cancel out, so the number of 1s keeps the same parity and the error is not found
5Two bits flip, parity changes, error is always found ETwo bits flipped, so the number of 1s is still even and the parity check passes even though the data is wrong
6Parity error found, so flip bit 3 to fix it FTwo bits swapped places, so the count of 1s is the same and the parity check cannot see the error

Definitions

even number of bits change

Fill in the Blanks

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

1.
IF bitsChanged ___ 2 = 0 THEN OUTPUT "Parity check misses it" ENDIF
2.
sent ← "10110010" received ← "10110001" same ← ones(sent) _ ones(received)
3.
IF parity <> expected THEN ______ "Error but position unknown" ENDIF
4.
IF bytesReceived __ bytesSent THEN OUTPUT "A byte was lost or gained" ENDIF
5.
IF onesCount MOD 2 = _ THEN OUTPUT "Even parity, no error found" ENDIF

Spot the Error

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

Question 1
A sent <- 10110110
B received <- 10101010
C flipped <- 2
D OUTPUT 'Parity check passes'
Question 2
A sent <- 11010001
B received <- 10110000
C ones_before <- 3
D ones_after <- 3
E OUTPUT 'Swap not detected'
Question 3
A received <- 10110011
B ones <- 5
C IF ones MOD 2 = 1 THEN
D OUTPUT 'Error in bit 3'
Question 4
A sent <- 5
B got <- 5
C IF sent <> got THEN
D OUTPUT 'Byte lost'
Question 5
A sent <- 10000001
B received <- 00000000
C ones <- 0
D IF ones MOD 2 = 1 THEN
E OUTPUT 'Passes, but wrong'

Answer Key

What a single parity check cannot detect
Section A: Quick Questions
Q1
B — No error, because the count of 1s still has the right parity
Q2
A — Four bits in the byte flip
Q3
A — No, the number of 1s stays the same
Q4
A — That at least one bit is wrong, but not which one
Q5
B — It cannot locate the bit that has changed
Section B: Match the Pairs
Q1
Sent 10110001 (even parity), received 10010101 → Two bits flipped, so the number of 1s is still even and the parity check passes even though the data is wrong
Q2
Sent 11001100, received 11001010 → Two bits swapped places, so the count of 1s is the same and the parity check cannot see the error
Q3
A parity error only tells you that a byte is wrong, not which bit, so the whole byte must be sent again → if parity_error: request_resend(byte)
Q4
A single parity check cannot spot a missing byte unless the number of bytes is also counted → if bytes_received != bytes_expected: error
Q5
Two bits flip, parity changes, error is always found → Two flipped bits cancel out, so the number of 1s keeps the same parity and the error is not found
Q6
Parity error found, so flip bit 3 to fix it → Parity cannot show which bit is wrong, so you cannot know bit 3 is the faulty one
Section C: Definitions
Q1
even number of bits change — A single parity check misses an error when an even number of bits change, because the count of 1s keeps the same parity. It also cannot show which bit is wrong.
Section D: Fill in the Blanks
Q1
IF bitsChanged MOD 2 = 0 THEN OUTPUT "Parity check misses it" ENDIF
Q2
sent ← "10110010" received ← "10110001" same ← ones(sent) = ones(received)
Q3
IF parity <> expected THEN OUTPUT "Error but position unknown" ENDIF
Q4
IF bytesReceived <> bytesSent THEN OUTPUT "A byte was lost or gained" ENDIF
Q5
IF onesCount MOD 2 = 0 THEN OUTPUT "Even parity, no error found" ENDIF
Section E: Spot the Error
Q1
A — The sent byte should be 10110010. It differs from the received byte in exactly two bits, which matches flipped <- 2. The broken byte differs in three bits, so it does not fit the rest of the program.
Q2
A — The sent byte should be 11010000, which has three 1s. Swapping two bits gives 10110000, which also has three 1s. The broken byte has four 1s, so the counts would not match.
Q3
D — A parity check only shows that an error exists. It cannot show which bit is wrong, so the output should say the bit is unknown.
Q4
B — Parity cannot spot a lost byte, so the program compares a count of bytes. For the 'Byte lost' message to make sense, got must be 4. With got <- 5 the counts match and nothing is lost.
Q5
D — With even parity, a byte passes when its count of 1s is even. Zero is even, so the test must be MOD 2 = 0. Two bits changed, so the error is missed.