Error detection versus error correction

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

Error detection versus error correction

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A receiver finds that a parity bit does not match the data. What has the parity check done?
A Repaired the data so it is correct
B Shown that an error has happened
2. After an error is detected in a received packet, what usually happens next?
A The receiver asks for the data to be sent again
B The check method fixes the bits automatically
3. Which statement about error detection is correct?
A It tells you something went wrong, not what the right data was
B It always gives back the original correct data
4. Where does a checksum travel when data is sent?
A On a separate trip after all the data has been checked
B With the data, usually in the packet trailer
5. A packet passes its parity check. Does this prove the data is error free?
A No, some errors can still be missed
B Yes, a passed check guarantees no errors

Match the Pairs

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

Left columnRight column
1parity bit = 1 -> received byte has an odd number of 1s Apacket = header + data + trailer(checksum)
2IF error found THEN request resend BIF parity OK THEN data may still contain errors
3The error check travels with the data, so the receiver can compare it with the data that arrived CA matching checksum does not guarantee there are no errors, because some errors can still be missed.
4A method can miss some errors, so a passed check does not prove the data is perfect DDetect then resend: the receiver asks the sender to send the data again
5parity error found -> the receiver fixes the byte automatically EDetection only shows that an error happened. It does not repair the byte, so the data must be resent.
6checksum matches -> the data is 100% error free FAn error is detected, but the receiver does not know which bit is wrong, so the data is not repaired

Definitions

error detection

Fill in the Blanks

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

1.
IF checkReceived __ checkCalculated THEN OUTPUT "Error detected" ENDIF
2.
IF errorFound = ____ THEN OUTPUT "Please send again" ENDIF
3.
checkValue ← CalculateCheck(data) packet ← data + __________ SEND packet
4.
bitsChanged ← 2 missed ← (bitsChanged ___ 2) = 0 OUTPUT missed
5.
REPEAT RECEIVE packet _____ errorFound = FALSE

Spot the Error

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

Question 1
A RECEIVE data, check
B IF check fails THEN
C ACCEPT data anyway
D ELSE
E ACCEPT data
Question 2
A ones ← COUNT(1s), even parity
B IF ones is odd THEN
C PRINT 'No error detected'
Question 3
A sent ← [3, 5], checksum ← 8
B got ← [5, 3], sum ← 8
C PRINT 'Error detected'
Question 4
A REPEAT
B SEND packet, check
C RECEIVER repairs the data
D RECEIVER sends ACK or NAK
E UNTIL reply = ACK
Question 5
A RECEIVE packet
B SPLIT into data, trailer
C calc ← CHECKSUM(data)
D IF calc = trailer THEN NAK
E ELSE ACK

Answer Key

Error detection versus error correction
Section A: Quick Questions
Q1
B — Shown that an error has happened
Q2
A — The receiver asks for the data to be sent again
Q3
A — It tells you something went wrong, not what the right data was
Q4
B — With the data, usually in the packet trailer
Q5
A — No, some errors can still be missed
Section B: Match the Pairs
Q1
parity bit = 1 -> received byte has an odd number of 1s → An error is detected, but the receiver does not know which bit is wrong, so the data is not repaired
Q2
IF error found THEN request resend → Detect then resend: the receiver asks the sender to send the data again
Q3
The error check travels with the data, so the receiver can compare it with the data that arrived → packet = header + data + trailer(checksum)
Q4
A method can miss some errors, so a passed check does not prove the data is perfect → IF parity OK THEN data may still contain errors
Q5
parity error found -> the receiver fixes the byte automatically → Detection only shows that an error happened. It does not repair the byte, so the data must be resent.
Q6
checksum matches -> the data is 100% error free → A matching checksum does not guarantee there are no errors, because some errors can still be missed.
Section C: Definitions
Q1
error detection — Checking received data to show that an error has happened. It does not repair the data, so the receiver usually asks for it to be sent again. Some errors can still be missed.
Section D: Fill in the Blanks
Q1
IF checkReceived <> checkCalculated THEN OUTPUT "Error detected" ENDIF
Q2
IF errorFound = TRUE THEN OUTPUT "Please send again" ENDIF
Q3
checkValue ← CalculateCheck(data) packet ← data + checkValue SEND packet
Q4
bitsChanged ← 2 missed ← (bitsChanged MOD 2) = 0 OUTPUT missed
Q5
REPEAT RECEIVE packet UNTIL errorFound = FALSE
Section E: Spot the Error
Q1
C — Error detection only shows that an error has happened. The receiver cannot repair the data, so when the check fails it should request a resend, not accept the data.
Q2
B — With even parity the number of 1s should be even. An even count means no error was detected. An odd count would signal an error, so the test should be 'is even'.
Q3
C — Swapping the two values still gives a sum of 8, so the checksum matches and this error is missed. The program should print that the checksum matches. A method can miss some errors.
Q4
C — The receiver only checks the data to detect errors. It does not repair it. A NAK makes the sender resend the packet, and the loop repeats until an ACK arrives.
Q5
D — A NAK should be sent when the calculated checksum is different from the trailer value (<>), because that shows an error was detected. A match means ACK.