Lesson 1 of 6
CIE 0478 only Lesson 1

Error Detection

When data is sent over a network or read from a disk, it can be corrupted. CIE 0478 examines four detection techniques in detail. This topic is unique to CIE; OCR, AQA and Edexcel do not require this depth.

This lesson covers Cambridge IGCSE 0478 Computer Science syllabus point 2.1.4. Students sitting OCR J277, AQA 8525 or Edexcel 1CP2 do not need this material.

In 1990 a single flipped bit in a satellite signal sent the wrong launch coordinates to a weather rocket. Tiny corruption, huge consequences. Networks today carry trillions of bits per second; without error detection we would never trust a download, a bank transfer or even a text message.

Think about it: If a single bit flips while sending the byte 01001011, how would the receiver know?
Parity bit
An extra bit added to a byte so the total number of 1s is either always even (even parity) or always odd (odd parity).
Checksum
A value calculated from the data being sent. The receiver recalculates and compares.
Check digit
A single extra digit added to the end of a number, derived from the other digits. Used in barcodes and ISBNs.
Automatic Repeat Request (ARQ)
A protocol where the receiver acknowledges packets; if no acknowledgement arrives in time the sender retransmits.
Echo check
The receiver sends the data straight back to the sender, who compares it with the original.

Parity bits

A parity bit is one extra bit added to each byte. With even parity, the total number of 1s in the byte (including the parity bit) must be even.

Data byte: 1010100      # four 1s
Parity bit: 0           # total still four (even)
Transmitted: 10101000

Data byte: 1010101      # four 1s
Parity bit: 1           # total five, but with parity = 1, total six (even)
Transmitted: 10101011
Limitation

Parity catches a single flipped bit. If two bits flip, the parity is unchanged and the error slips through undetected.

Checksums and check digits

Checksum: the sender adds up the bytes (often modulo 256) and sends the total alongside. The receiver recalculates and compares. If the totals differ, the data is corrupted.

Check digit: a single digit on the end of a number that is derived from the other digits. Used on ISBNs, barcodes and bank account numbers. Catches typing mistakes including transposed digits.

ISBN: 978-0-13-468599-?
Apply weighted sum (alternating x1, x3) to the 12 digits.
Take result mod 10. The check digit is the value that makes
the total a multiple of 10.

Automatic Repeat Request (ARQ)

ARQ uses acknowledgements and timeouts to guarantee delivery.

  1. Sender transmits a packet and starts a timer.
  2. Receiver checks the packet (using a checksum or parity).
  3. If the packet is intact, the receiver sends back a positive acknowledgement (ACK).
  4. If the timer runs out before the sender gets an ACK, it resends the packet.

ARQ is what stops a single dropped packet from corrupting a whole file download.

Beyond the basics

A delivery driver scans a 13-digit barcode but the warehouse system rejects it as invalid. The driver insists the parcel is real. Explain how the check digit could be involved, and describe two reasons the rejection might still be correct.
Role of the check digit: the system recalculates the check digit from the first 12 digits using the standard weighted-sum algorithm. If the calculated digit does not match the 13th digit of the scanned code, the system flags the barcode as invalid.

Two valid reasons for rejection:
1. The barcode was misread by the scanner (a digit picked up wrongly), so the recalculated check digit no longer matches.
2. The barcode is genuinely incorrect: a counterfeit label, a printing error, or a typo when the parcel was registered. The check digit is doing its job by catching this before the wrong item leaves the warehouse.

The check digit cannot tell the system which of these two cases applies, only that something is wrong. The driver should rescan and, if it still fails, the parcel should be inspected by a human.

All four error-detection methods at a glance

MethodWhere usedDetectsLimitation
Parity bitMemory, simple data transmissionAny single-bit flip in a byteMisses double-bit errors (two flips cancel out)
ChecksumNetwork packets, file downloadsMost accidental corruption of a block of dataSlower to compute; deliberate tampering can fake the same checksum
Check digitBarcodes, ISBNs, bank account numbersSingle-digit typos and most pair-swapsOnly protects the very end of a number, not the data itself
ARQWi-Fi, TCP, satellite linksLost or corrupted packets (when paired with a checksum)Adds delay; needs an acknowledgement channel back
"A parity bit corrects errors"

Parity only detects that something has gone wrong. It does not say which bit flipped, so it cannot put the data back. Correction needs much more redundancy (e.g. Hamming codes), which is beyond the GCSE specification. In an exam, never write "parity corrects errors" - you will lose the mark.

A six-mark exam question with mark scheme

Question (CIE-style, 6 marks): Describe how a parity bit and Automatic Repeat Request (ARQ) work together to ensure data is transmitted accurately between two computers.

Mark scheme - one mark per valid point, up to 6
  • Before sending, the sender counts the 1s in each byte.
  • A parity bit is added to make the total number of 1s match the agreed parity (odd or even).
  • The receiver counts the 1s on arrival and compares against the agreed parity.
  • If the count is wrong, the byte has been corrupted in transit.
  • Under ARQ, the receiver sends a positive acknowledgement when data arrives intact.
  • If the sender does not receive an acknowledgement within a timeout, it re-transmits the data.
  • This process repeats until the data is received correctly or a maximum number of attempts is reached.

Beyond the basics

A school's Wi-Fi network already uses checksums in TCP and ARQ on top. A teacher asks why the network card also uses a parity bit at the hardware level. Explain why three layers of error detection are not redundant.
Each layer protects a different stage of the journey. Parity catches a flipped bit in the network card's own memory before transmission even begins. The checksum catches corruption that happened along the cable or in a router. ARQ catches the entire packet being lost (which neither parity nor a checksum can detect because the data never arrives). Removing any layer would leave a class of errors no other layer can catch. This is called defence in depth.
Q1. Using even parity, what parity bit is added to the data 1100110?
1100110 already has four 1s (even), so adding 0 keeps the total even.
Q2. Which technique guarantees the data eventually arrives, even if the network drops packets?
ARQ uses acknowledgements and timeouts to retransmit lost packets.
Q3. Why is a single parity bit a weak form of error detection?
Two simultaneous flips cancel out as far as parity is concerned.
CIE 0478 - Lesson 1
Error Detection
Starter activity
Write the byte 01001011 on the board. Tell students you sent it across a noisy network. Flip one bit secretly and pass the new byte to the class. Ask: "How could the receiver tell which bit changed - or even that anything changed at all?" Use the puzzlement to motivate parity, checksums and check digits.
Lesson objectives
1
Explain why error detection is needed when transmitting or storing data.
2
Calculate even and odd parity bits for a given byte.
3
Describe how checksums and check digits detect errors and where each is used.
4
Describe Automatic Repeat Request and explain how acknowledgements and timeouts guarantee delivery.
5
Discuss the limitations of each technique, especially the two-bit-flip weakness of parity.
Key vocabulary
parity biteven parityodd paritychecksumcheck digitARQacknowledgementtimeoutecho checkcorruptionISBN
Discussion questions
If parity catches one flipped bit but not two, why is it still used at all?
When would echo check be a poor choice for detecting errors compared to a checksum?
How does ARQ change the network traffic compared with sending data once and hoping for the best?
Exit tickets
Calculate the even parity bit for the byte 11010110. [1 mark]
Describe one situation where a checksum is more appropriate than a single parity bit. [2 marks]
Explain how Automatic Repeat Request makes sure that lost packets eventually arrive. [3 marks]
Homework suggestion
Look up the ISBN-13 check-digit algorithm. Pick three real books, copy down their 13-digit ISBNs and verify each one by recalculating the check digit by hand. Hand in the working for each book and identify any mistakes you made along the way.
Classroom tools