Data Transmission

Data Transmission

Error detection: parity, checksum, echo check, ARQ, check digit

Methods of Error Detection Paper 1 16 min read

On this page
  1. In this note
  2. What you should already know
  3. Why errors happen and why we check
  4. Parity check
  5. Checksum
  6. Echo check
  7. Automatic repeat query (ARQ)
  8. Check digit
  9. Summary
  10. Ways they test it
  11. What the examiner looks for
  12. Past-paper questions, solved
  13. Common mistakes
  14. Practice
  15. Can I do this?
  16. Quiz

In this note

Syllabus 2.2 Methods of error detection
  • 2.2.1Understand the need to check for errors after transmission and how errors can occur.
  • 2.2.2Describe parity check (odd / even, parity byte, parity block), checksum and echo check.
  • 2.2.3Describe how a check digit detects errors in data entry.
  • 2.2.4Describe how an automatic repeat query (ARQ) checks that data is received without error.

Before this: Serial, parallel and duplex. Next: Encryption.

Part 1Learn the topic

The notes: every idea from the start, with our own examples.

What you should already know

Odd and even

Count the 1s in a byte: 3 ones is odd, 4 ones is even.

Quick check: is 1011 0010 odd or even?

Four 1s: even.

Packets

Data is sent in packets, each with a header, payload and trailer.

Quick check: which section holds error checking data?

The trailer.

Why errors happen and why we check

Data can be correct when it leaves the sender but wrong when it arrives. During transmission, data can be lost, gained (extra bits added) or changed (a 1 becomes a 0). Causes:

CauseWhat happens
Interferenceelectrical noise from other devices disturbs the signal and flips bits
Crosstalksignals in wires next to each other interfere (worse in parallel cables)
Skewingbits sent together in parallel arrive at different times and are read in the wrong order
Data collisions / lost packetstwo signals meet, or a packet is dropped or times out on its way

A file with even one wrong bit can be useless (a program that crashes, a wrong bank amount). So the receiver checks the data, and asks for it again if it is wrong.

Parity check

Sender and receiver agree on odd parity or even parity. Each byte has 7 data bits and one parity bit (usually the leftmost bit). The parity bit is set so the number of 1s in the byte is odd (odd parity) or even (even parity).

General methodParity byte check

  1. Before sending, count the 1s in the 7 data bits.
  2. Set the parity bit to 0 or 1 so the byte's total number of 1s matches the agreed parity (odd or even).
  3. Send the byte.
  4. After transmission, the receiver counts the 1s in each byte again.
  5. If the count does not match the agreed parity, an error is detected and the data is sent again.

Example Add the parity bit to the data 110 1001 for even parity, then for odd parity.

Count the 1s in the 7 data bits.

  1. 1101001 has four 1s: already even.
  2. Even parity: parity bit 0 → 0110 1001 (four 1s).
  3. Odd parity: parity bit 1 → 1110 1001 (five 1s).

Answer even: 0, odd: 1

A parity check cannot find every error. If two bits change (or two bits swap places, a transposition), the number of 1s is still odd / even, so the error is not detected. A parity byte check also cannot say which bit is wrong.

Parity block check

A parity block check sends several bytes together, each with a parity bit, plus an extra parity byte at the end. Each bit of the parity byte makes its column match the parity. The receiver checks every row and every column: the wrong bit is where the bad row and bad column cross, so it can be located and corrected.

Four bytes sent with even parity:

Parity bitbit 1bit 2bit 3bit 4bit 5bit 6bit 71s
Byte 1010110014
Byte 2001101014
Byte 3011000114
Byte 4100011104
Parity byte100000012

After transmission one bit has changed:

Parity bitbit 1bit 2bit 3bit 4bit 5bit 6bit 71s
Byte 1010110014
Byte 2001101014
Byte 3011001115
Byte 4100011104
Parity byte100000012

Byte 3 now has 5 ones (odd), and column bit 5 has an odd number of 1s. The error is the bit where byte 3 meets bit 5, so the receiver can flip it back.

Try it yourself

1
Give the even parity bit for the data 011 0001.
Show answer

Answer 1 (three 1s, so add a 1 to make four)

2
Give the odd parity bit for the data 011 0001.
Show answer

Answer 0 (three 1s is already odd)

3
Two bits in a byte are flipped. Will a parity byte check detect it? Why?
Show answer

Answer No: the number of 1s is still odd / even, so it still matches the parity

Checksum

General methodChecksum

  1. Before sending, a checksum value is calculated from the data using an algorithm (e.g. adding up the byte values).
  2. The checksum is sent with the data (in the packet trailer).
  3. The receiver recalculates the checksum from the data it received, using the same algorithm.
  4. The two checksums are compared: if they are different, an error is detected and the data is requested again; if they match, no error.

Example Bytes with the values 200, 150, 90 and 37 are sent. The checksum algorithm adds the values and keeps the remainder after dividing by 256. Find the checksum.

Add, then find the remainder after 256.

  1. 200 + 150 + 90 + 37 = 477
  2. 477 − 256 = 221

Answer checksum = 221

Echo check

General methodEcho check

  1. The data is sent to the receiver.
  2. The receiver sends a copy of the data it received back to the sender.
  3. The sender compares the original data with the copy.
  4. If they do not match, an error has occurred and the data is sent again.
Drawback: if the copy does not match, it is not known whether the error happened on the way there or on the way back. It also doubles the amount of data sent.

Automatic repeat query (ARQ)

An ARQ (automatic repeat query / request) uses acknowledgements and a timeout so that each packet is received without error. The receiver checks each packet with an error detection method (e.g. a checksum).

General methodARQ with a positive acknowledgement

  1. The sender sends a packet and starts a timer.
  2. The receiver checks the packet for errors.
  3. If it is error free, the receiver sends a positive acknowledgement back; the sender then sends the next packet.
  4. If the sender does not receive an acknowledgement before the timer ends, a timeout occurs …
  5. … and the packet is resent, until an acknowledgement arrives (or a set number of attempts is reached).

With a negative acknowledgement the receiver instead sends a message back when a packet has an error, asking for it to be resent.

Check digit

A check digit finds errors in data entry (typing or scanning a number), not in transmission. It is an extra digit added to the end of a code such as a barcode or an ISBN (book number).

General methodCheck digit

  1. The check digit is calculated from the other digits using an algorithm and added to the end of the code.
  2. When the code is entered or scanned, the check digit is recalculated using the same algorithm.
  3. If the calculated digit does not match the check digit in the code, an error has occurred (e.g. a digit typed wrongly, or two digits swapped).

Example Find the check digit for the ISBN 978030640615. Multiply the digits by 1, 3, 1, 3 …, add them, then the check digit is the number that makes the total up to the next multiple of 10.

Weights 1 and 3 alternate.

  1. 9×1 + 7×3 + 8×1 + 0×3 + 3×1 + 0×3 + 6×1 + 4×3 + 0×1 + 6×3 + 1×1 + 5×3
  2. = 9 + 21 + 8 + 0 + 3 + 0 + 6 + 12 + 0 + 18 + 1 + 15 = 93
  3. next multiple of 10 is 100: 100 − 93 = 7

Answer check digit 7: ISBN 9780306406157

Try it yourself

1
Which error detection method is used for data entry rather than transmission?
Show answer

Answer Check digit

2
Which method sends a copy of the data back to the sender?
Show answer

Answer Echo check

3
In ARQ, what happens if no acknowledgement arrives before the timer ends?
Show answer

Answer A timeout occurs and the packet is resent

Summary

  • Errors: data lost, gained or changed, by interference, crosstalk, skewing, collisions.
  • Parity: parity bit makes the number of 1s odd / even; receiver recounts. Misses even numbers of flips and transpositions.
  • Parity block: parity bit per byte + parity byte per column; the bad row and column locate (and correct) the bit.
  • Checksum: value calculated by an algorithm, sent with the data, recalculated and compared.
  • Echo check: receiver sends a copy back; sender compares.
  • ARQ: acknowledgement + timer; no acknowledgement → timeout → resend.
  • Check digit: data ENTRY; calculated from the digits, recalculated on entry, compared.

If you see …

  • "an odd or even process"parity check
  • "a value calculated … before and after transmission"checksum
  • "a copy is sent back"echo check
  • "acknowledgement and timeout"ARQ
  • "a value appended … checked on data entry"check digit
Part 2How it is examined

Question types, what the examiner gives marks for, and real past-paper questions solved.

Ways they test it

Type 1 How errors occur

"Describe how an error can occur in the data during transmission" [2-3]

Spot it "how errors occur".

  1. A cause (interference / crosstalk / skewing) AND its effect (data lost, gained or changed).

Type 2 Name the method

a table of statements to name [5]; "tick the method that does not use a calculated value" [1]

Spot it "identify".

  1. Use the trigger phrases in the summary. The echo check is the one with no calculated value.

Type 3 Describe a method

"Explain how the odd parity check detects errors" [4]; "describe the checksum process" [5]; "explain how ARQ operates using positive acknowledgement" [5]

Spot it "explain how … detects".

  1. Write the method steps in order: before sending, during, after, compare, what happens if wrong.

Type 4 Parity bits

"Give the parity bit for each byte" [3]; "identify the byte with an error"

Spot it a byte table.

  1. Count the 1s in the data bits; for odd parity add a bit so the total is odd.

Type 5 Limits of parity

"Explain why the error may not be detected" [2]

Spot it "not detected".

  1. Two bits flipped / swapped (transposition) → the number of 1s is still odd / even → it still meets the parity.

What the examiner looks for

"Explain how the odd parity check detects errors" [4]

Marking points (one mark each, up to the marks shown)

  • The number of 1s / 0s is counted
  • A parity bit is added to each byte / 7 bits before transmission …
  • … to make the number of 1s in each byte odd
  • After transmission, if the number is odd no error is detected
  • After transmission, if the number is even an error is detected

Keywords parity bit count the 1s odd after transmission

"Describe the process of the checksum error detection method" [5]

Marking points (one mark each, up to the marks shown)

  • The checksum is calculated from the data …
  • … using an algorithm
  • The checksum value is transmitted with the data
  • The checksum is recalculated after transmission / by the receiver
  • If the values do not match an error is detected // if they match no error
  • … the data is requested to be resent if there is an error

Keywords algorithm transmitted with the data recalculated compared

Check digit vs transmission

0478/12/M/J/26 Q4Paper 1 · Computer systems2 marks
An odd parity byte check is used. There is an error that is not detected. Identify two other error detection methods that could be used.
Credited
  • Parity block check
  • Checksum
  • Echo check
  • ARQ
Not credited
  • check digit
Why

A check digit is for data ENTRY. This question is about transmission, so it is not accepted.

From: 0478/12/M/J/26 Q4(b)(ii) mark scheme

Past-paper questions, solved

0478/12/M/J/24 Q6Paper 1 · Computer systems5 marksFull size
Name the error detection method for each statement

How to start Match each statement to its trigger phrase: odd or even, value calculated before and after, copy sent back, acknowledgement and timeout, value appended and checked on data entry.

Show a full-mark answer and the mark scheme

parity check · checksum · echo check · automatic repeat query (ARQ) · check digit

PartAnswer / workingMarksGuidance
6parity (check / bit / byte / block) · checksum · echo check · ARQ · check digit, one mark eachB5
Total: 5 marks
0478/11/O/N/23 Q4Paper 1 · Computer systems5 marksFull size
How an odd parity check detects errors; name the echo check

How to start (b) is the five steps of the parity method; four of them earn the marks. (c) "a copy … sent back" = echo check.

Show a full-mark answer and the mark scheme

(b) Before transmission the number of 1s in each 7 bits is counted, and a parity bit is added to each byte to make the number of 1s odd. After transmission the receiver counts the 1s in each byte. If the number is odd, no error is detected; if it is even, an error is detected.

(c) Echo check.

PartAnswer / workingMarksGuidance
4(b)Any four: number of 1s counted · parity bit added to each byte before transmission · … to make the number of 1s odd · after transmission odd = no error · even = error detectedB4
4(c)Echo (check)B1
Total: 5 marks
0478/13/O/N/23 Q5Paper 1 · Computer systems7 marksFull size
Why errors occur; the method with no calculated value; ARQ with positive acknowledgement

How to start (c) is the ARQ method: timer, check, acknowledgement, next packet, timeout, resend.

Show a full-mark answer and the mark scheme

(a) Interference.

(b) C (echo check).

(c) When the sender transmits a packet it starts a timer. The receiver checks the packet for errors. If it is error free, the receiver sends an acknowledgement back to the sender, and the next packet is sent. If the sender does not receive an acknowledgement before the timer ends, a timeout occurs and the packet is resent, until an acknowledgement is received.

PartAnswer / workingMarksGuidance
5(a)interference // crosstalkB1
5(b)CB1
5(c)Any five: timer started on sending · receiver checks for errors · acknowledgement sent if error free · next packet sent · no acknowledgement before timer ends … · timeout · packet resent · until acknowledged / max attemptsB5
Total: 7 marks
0478/12/O/N/24 Q5Paper 1 · Computer systems4 marksFull size
How a barcode scanning system uses a check digit

How to start Follow the method: calculated, added, recalculated on scanning with the same algorithm, compared.

Show a full-mark answer and the mark scheme

A check digit is calculated from the barcode digits using an algorithm (e.g. modulo 11) and added to the end of the barcode. When the barcode is scanned, the check digit is recalculated using the same algorithm. If the recalculated digit does not match the check digit, an error has occurred in scanning; if they match, there is no error.

PartAnswer / workingMarksGuidance
5(a)Any four: calculated from the barcode data · using an algorithm (e.g. modulo 11) · added to the barcode · recalculated when scanned · same algorithm · do not match = error / match = no errorB4
Total: 4 marks

Common mistakes

  • ✗ "The parity bit makes the byte odd"✓ "… makes the NUMBER OF 1s in the byte odd"
  • ✗ "A checksum is the number of 1s"✓ "A value calculated from the data using an algorithm"Counting 1s is parity.
  • ✗ Check digit for a transmission question✓ Parity, checksum, echo check or ARQCheck digit = data entry only.
  • ✗ "ARQ checks the data" and nothing else✓ Timer · acknowledgement · timeout · resendThe marks are for the process.

Practice

Practice: easy, medium, hard

Easy

1
Give the even parity bit for 101 1000.
Show answer

Answer 1 (three 1s, add one to make four)

2
Name the error detection method that uses acknowledgement and timeout.
Show answer

Answer ARQ (automatic repeat query)

3
Give two ways data can be affected by an error in transmission.
Show answer

Answer Two of: lost, gained, changed

Medium

1
Describe how an echo check works. [3]
Show answer

Answer Receiver sends a copy of the data back; sender compares it with the original; if they don't match an error is detected

2
Find the checksum for byte values 120, 64 and 100 (add, remainder after 256).
Show working
  1. 120 + 64 + 100 = 284
  2. 284 − 256 = 28

Answer 28

3
Give one limitation of a parity byte check.
Show answer

Answer It cannot detect two bits changing / a transposition; it cannot locate which bit is wrong

Hard

1
Explain how a parity block check finds AND corrects a single-bit error. [4]
Show answer

Answer Each byte has a parity bit; a parity byte is added for each column; the receiver checks every row and column; the bad row and bad column cross at the wrong bit, which is flipped

PartAnswer / workingMarksGuidance
parity bit per byteB1
parity byte / column parityB1
row and column checkedB1
bit where they cross is the error → correctedB1
Total: 4 marks
2
A barcode 978030640615 is typed as 978030460615 (two digits swapped). Explain how the check digit 7 shows the error.
Show answer

Answer The check digit is recalculated from the typed digits with the same algorithm; it no longer equals 7, so an error is detected

Can I do this?

Anything unticked: revise that section first. All ticked: take the quiz.

Quiz

The multiple-choice and guided questions need JavaScript. The concept checks and exam practice below work without it.

Your progress on this note is saved when JavaScript is on.

⬇️ Download this chapter as a PDF: Full notes