Library Computer Science 0478 Methods of Error Detection
O Level · Computer Science 0478

Methods of Error Detection

Revise Methods of Error Detection for Computer Science 0478 (O Level) — revision notes and instant AI marking. Free to start.

📖 Revision notes · preview
Cambridge (CIE) IGCSE · Computer Science

Methods of Error Detection

Big idea: Whenever data travels — down a wire, through the air, or even just gets typed in — something can go wrong along the way, so computers use clever mathematical "trip-wires" (parity bits, checksums, check digits, echoes, and ARQ) to catch mistakes before they cause real damage.

Summary — What This Chapter Covers

  • Why errors happen: interference (wired or wireless) causes data loss, data gain, or data change.
  • Why we check: computers need data in an expected format — unexpected data is hard or impossible to interpret correctly.
  • Parity check: adds one extra bit per byte so the total number of 1s matches an agreed rule (odd/even). Detects an error but not .
  • Parity block & parity byte: parity calculated both horizontally (per byte) and vertically (per bit-column) — this combination can actually the faulty bit.
  • Checksum: a calculated value sent alongside data; recalculated by the receiver and compared. Mismatch = error, but no location given.
  • Echo check: receiver sends the data straight back to the sender to compare — simple, but not fully reliable (error could occur on the way back too).
  • Check digits: one extra digit at the end of a numeric code (ISBN, barcodes) calculated by an algorithm to catch mistyped, missing, extra, or swapped digits.
  • Automatic Repeat reQuest (ARQ): a protocol using acknowledgements and timeouts to automatically request re-transmission of corrupted or missing data.

1  Why Errors Occur

Interference is the root cause

Think of data transmission like sending a message by shouting across a windy field versus passing a note by hand. Along the way, things can interfere with the message and change it — that's exactly what happens electronically too.

Wireless technology (radio signals, Wi-Fi, Bluetooth) can be disrupted by:

  • Physical barriers — buildings, walls, cars, even your own body standing in the way
  • Bad weather — rain, clouds, storms
  • Other wireless signals or electromagnetic radiation "talking over" your signal

Wired technology is actually prone to error overall, because physical cables can:

  • Get damaged or degrade over time
  • Pick up interference from nearby electrical sources
  • Suffer from interrupted or intermittent connections, causing data loss

The three ways interference shows up

EffectWhat it means
Data lossSome data never arrives
Data gainExtra, unwanted data is received
Data changeBits get flipped (a 1 becomes a 0, or vice versa)

Why checking even matters

Computers only understand data that arrives in an expected format — an agreed way of arranging data so both sender and receiver interpret it the same way. Dates are a classic example: 13/04/14 could be DD/MM/YY, and 12/31/2020 is clearly MM/DD/YYYY (since there's no 31st month). But what about 04/03/17? Is that 4th March or 3rd April? Without an agreed format and error checking, ambiguous or corrupted data leads to misinterpretation — and in the real world, that can mean wrong dates, wrong amounts, wrong instructions.

Practice Question

Alex receives an important work document by email over a wireless connection. Identify what interference Alex could experience, the possible outcomes, and explain why Alex should check the document for errors.

2  Parity Check

The core idea

Imagine every byte of data has to arrive with an "ID badge" — one extra bit tacked on called the parity bit. Before anything is sent, the sender and receiver agree on a rule: either every byte must contain an odd number of 1s (odd parity), or every byte must contain an even number of 1s (even parity) — always counting the parity bit itself.

The parity bit's value (0 or 1) is chosen specifically to make that rule true. When the byte arrives, the receiver counts the 1s again. If the count no longer matches the agreed rule, something has changed in transit — an error has been detected.

Rule Odd parity → total number of 1s (including parity bit) must be ODD.
Even parity → total number of 1s (including parity bit) must be EVEN.

Worked example — Even parity

Parity bitByte
01011010

Counting the 1s in the byte (not the parity bit yet): 1,1,1,1 = four 1s. Four is already even, so for even parity to hold, the parity bit must be 0 (adding a 1 would push the total to five, an odd number, which breaks the rule).

Worked example — Odd parity

Parity bitByte
11011010

Again, four 1s in the main byte. Four is even — but we need an odd total, so the parity bit must be 1, bringing the total to five 1s (odd). ✓

How an error actually gets caught

Say a byte was sent using ODD parity, with parity bit = 1 and byte 1101011 (five 1s, total 6 including parity bit — wait, that's wrong for odd... let's check a real example from the transmission table below where interference has flipped a bit):

ExampleAgreed parityParity bitMain bit string (received)Total 1sResult
#1ODD111010116Error
#2EVEN100010002No error

In example #1, six 1s is an even number — but the agreed rule was odd parity, so a mismatch is flagged: an error occurred somewhere in that byte. Notice it doesn't say bit is wrong, only something is wrong.

⚠ Big Limitation A simple parity check is quick and easy — but it fails if an even number of bits flip at the same time (e.g. two bits swap or two bits both flip). The total count of 1s can stay the same even though the data itself is now wrong, so the error slips through undetected.
Practice Question

Four 8-bit binary values (7 data bits + 1 parity bit) were sent and received correctly: 01100100, 10010001, 00000011, 10110010. For each, identify whether odd or even parity was used.

Practice Question

An error may not be detected when using a parity check. Identify why.

3  Parity Byte & Block Check

Upgrading parity to actually locate the error

A single parity bit per byte tells you an error happened, but not . The clever fix: apply parity twice — once across each row (byte), and once down each column (bit position). The column parities are collected into an extra row at the bottom called the parity byte, which is calculated before transmission and sent along with the rest of the block.

Now, if a single bit flips, it breaks its row's parity its column's parity. By cross-referencing which row and which column are "wrong," you can pinpoint the exact cell that flipped — like coordinates on a grid.

How to Locate the Error Find the row whose parity doesn't match → find the column whose parity doesn't match → the cell where they intersect is the corrupted bit.

Mini worked example (using ODD parity)

Parity bitBit2Bit3Bit4Bit5Bit6Bit7Bit8
Byte 101101011
Byte 200001000
Byte 310101111
Parity byte01111111

In this snippet, Byte 3's row parity doesn't add up correctly for odd parity, and the Bit5 column parity byte also flags a mismatch. Cross-referencing points straight at the Byte 3 / Bit 5 cell (highlighted) — it should actually be a 0. Once the exact bit is identified, it can either be automatically corrected, or a retransmission can be requested.

Why This Matters This is the key upgrade from "we know something broke" to "we know exactly what broke and can fix it" — which is far more efficient than blindly resending the entire message.

4  Checksum

A checksum works a bit like weighing a parcel before and after it's shipped. Before sending, the sender runs the data through an algorithm to produce a single value — the checksum — and attaches it to the transmission. When the data arrives, the receiver runs the algorithm on the received data and compares its result to the checksum that was sent.

The Process 1. Calculate checksum before sending → 2. Send it with the data → 3. Receiver recalculates using received data → 4. Compare the two checksums → 5. Match = no error. Mismatch = error detected.

Just like a basic parity check, a checksum tells you the data differs from its original form — but not the difference is.

Practice Question

Describe the process a checksum algorithm uses to determine if an error has occurred. (5 marks)

5  Echo Check

This is the simplest method conceptually: the receiver just sends the data straight back to the sender, like an echo bouncing off a canyon wall. The sender then compares what it gets back to what it originally sent.

Important Weakness An echo check is not fully reliable. Why? Because the error could have happened on the way (sender → receiver) or on the way (receiver → sender). Either direction could introduce interference, so a mismatch doesn't tell you exactly when or where the corruption occurred — only that a discrepancy exists somewhere across the round trip.

If an error is detected, the sender simply retransmits the original data.

6  Check Digits

What they are

A check digit is the last digit tacked onto a numeric code, calculated by a standardised algorithm. It's specifically designed to catch mistakes made when someone (or something) types or scans in a numeric sequence — things like:

  • Incorrect digits entered (a "5" typed as an "8")
  • Omitted or extra digits (missed one, or added one too many)
  • Phonetic errors (numbers that sound alike being mixed up, e.g. "fifteen" vs "fifty")

ISBN book numbers

Every book has a unique ISBN. A standard ISBN might look like 965-448-765-9, where the final digit (9) is the check digit. This digit is deliberately chosen so that when the check digit algorithm is applied to the whole number, the result comes out as a whole number with no remainder. If, after entering the ISBN, the algorithm produces a result with a remainder, the ISBN is flagged as invalid — meaning a digit was probably mistyped somewhere.

Barcodes

Barcodes are made of black and white lines. A scanner shines a laser across them; the black lines absorb the light and the white lines reflect it back into the scanner. The scanner measures the distances between the lines and converts that into a sequence of digits that uniquely identifies the item. Just like ISBNs, the final digit is the check digit, used to validate and authenticate that the barcode was scanned/entered correctly.

Practice Question

State the names of two examples of a check digit algorithm.

7  Automatic Repeat reQuest (ARQ)

ARQ is less about detecting an individual bit error and more about the overall protocol (set of rules) that manages what happens once an error is spotted. Think of it as a conversation with confirmations built in — like texting someone and expecting a "seen" tick, and resending your message automatically if you never get one.

How it works, step by step 1. Receiver checks the incoming data for errors →
2a. Error found → sends a negative acknowledgement ("this data is corrupted") →
2b. No error found → sends a positive acknowledgement ("data is correct") →
3. If no acknowledgement arrives at all, the sender waits out a time-out period, then automatically resends the data →
4. This repeats until all data is received and acknowledged as correct.
Naming Note In this specification, ARQ officially stands for Automatic Repeat Query, but you'll also see past exam papers call it Automatic Repeat reQuest. Both terms are interchangeable — don't let it confuse you in an exam.
Practice Question

Explain how Automatic Repeat reQuests (ARQ) are used in data transmission and storage. (2 marks)

What to Memorise

Interference outcomes

Data loss, data gain, data change (bits flipped)

Parity rule

Odd parity = odd total 1s. Even parity = even total 1s (parity bit included).

Parity check limitation

Can't detect an even number of bit changes / bit swaps (transpositions)

Parity block & byte

Horizontal parity (per byte) + vertical parity (per bit column, sent as parity byte) → pinpoints the exact faulty bit

Checksum

Calculated value sent with data; receiver recalculates and compares — detects but doesn't locate the error

Echo check

Receiver sends data back to sender to compare — unreliable, since error could occur on the outbound OR return trip

Check digit

Last digit in a numeric code (ISBN, barcode), calculated by an algorithm, catches typing/scanning errors

ARQ acknowledgements

Positive ACK = correct data. Negative ACK = corrupted data. No ACK + time-out = automatic resend.

Concepts Checklist

Exam Tips & Common Mistakes

  • Detecting vs locating: Basic parity checks and checksums only tell you an error occurred, not . Only a parity block/parity byte combination can pinpoint the exact bit. Examiners love testing this distinction.
  • Don't forget the parity bit itself when counting: When checking whether parity is odd or even, always count the parity bit as part of the total — a very common slip is only counting the "data" bits.
  • Know the parity check's blind spot: If asked "why might an error not be detected using parity," the answer is about an even number of bits changing or bits being swapped/transposed — not just "sometimes it doesn't work."
  • Echo check ≠ 100% reliable: A common trap is assuming sending data back confirms it's correct. Remember: the error could occur on the return journey too.
  • ARQ terminology: Be ready for either "Automatic Repeat Query" or "Automatic Repeat reQuest" — both appear in past papers and refer to the same thing.
  • Check digits are about numeric codes specifically (ISBN, barcodes) — don't confuse them with parity bits, which work on binary data during transmission.
  • Use exact terminology in extended answers: "positive/negative acknowledgement," "time-out," "checksum," "parity bit" — mark schemes reward precise vocabulary, not just the right idea in vague words.
🔓 Read the full Methods of Error Detection note — free You're seeing the preview · free account, no card needed
Also in the full note
  • 1 Why Errors Occur
  • 2 Parity Check
  • 3 Parity Byte & Block Check
  • 4 Checksum
  • 5 Echo Check
  • 6 Check Digits
  • 7 Automatic Repeat reQuest (ARQ)
  • Exam Tips & Common Mistakes
What's inside
📖 Revision notes 🎯 Learn mode ✦ AI flashcards ✓ Instant AI marking 🧊 3D explorers 🧪 Experiments & simulations 📈 Progress tracking
📄 Practise Methods of Error Detection with Computer Science 0478 past papers Every paper with its mark scheme — answer online, marked instantly. Open →

Read the full Methods of Error Detection notes free

That's the preview — create a free account to read the rest, plus flashcards and practice questions with instant AI marking. No credit card.

Unlock the full notes free →

More Computer Science topics