Error detection
Checking for errors
- While data travels, interference can change it — bits lost, gained or flipped.
- So the receiver checks the data arrived correctly.
- Several methods do this, plus a check digit for typed-in numbers.
Parity check
- A parity check adds one parity bit to each byte.
- Even parity: the total number of 1s must be even; odd parity: it must be odd.
- The receiver counts the 1s; if the parity is wrong, an error occurred.
- It can't catch every error — if two bits flip, the count may still look correct.
Practice
In an even-parity system, the parity bit is set so that:
Even parity makes the count of 1s even; the receiver re-counts to detect a single-bit error.
Practice
A parity check can fail to detect an error when:
Two flipped bits can keep the 1-count's parity the same, hiding the error.
Checksum, echo check and ARQ
- Checksum — a value calculated from the data before sending; the receiver recalculates it and compares. A mismatch → resend.
- Echo check — the receiver sends the data back; the sender compares it with the original (slow — data sent twice).
- ARQ (Automatic Repeat reQuest) — the receiver sends a positive/negative acknowledgement; if no positive one arrives before a timeout, the sender resends.
Practice
A checksum detects errors by:
The receiver recomputes the checksum; if it differs from the sent one, the data is resent.
Practice
In ARQ, the sender resends a packet when:
ARQ uses acknowledgements and a timeout timer; no positive ack in time → resend.
Check digit
- A check digit is an extra digit at the end of a number, worked out from the others — used for numbers that are typed in (barcodes, ISBNs).
- When entered, it is recalculated and compared.
- It catches an incorrect digit, a transposition (two digits swapped, 21→12), a missing/extra digit, and phonetic errors.
Practice
A check digit is mainly used to catch errors when a number is:
A check digit (recalculated on entry) catches mistyped or transposed digits in barcodes and ISBNs.
You've got it
Key idea
- parity check = even/odd count of 1s via a parity bit; misses some 2-bit errors
- checksum = recalculate and compare; echo check = send the data back
- ARQ = acknowledgements + timeout resend
- a check digit catches typing mistakes (incorrect digit, transposition) in barcodes/ISBNs