Why errors happen at all
Data travelling along a wire or through the air can be corrupted by electrical interference, by attenuation — the signal weakening over distance until a 1 is misread as a 0 — or by skew in parallel transmission.
None of these can be prevented entirely, so systems are built to detect corruption instead. Every method works the same way: send extra information alongside the data, and check on arrival that it still agrees.
| Method | Extra data sent | Detects | Can correct? |
|---|---|---|---|
| Parity check | 1 bit per byte | an odd number of flipped bits | no |
| Parity block | a parity byte as well | a single flipped bit | yes — locates it |
| Checksum | a calculated total | most corruption | no |
| Echo check | the whole data back again | any difference | no — resend |
| Check digit | one digit on the end | entry errors in a code | no |
| ARQ | acknowledgements and timeouts | lost or corrupted packets | yes — by resending |
Parity checking
One bit of each byte is reserved as the parity bit, set so that the total number of 1s in the byte is even (even parity) or odd (odd parity). Both sender and receiver must agree which system is in use beforehand.
On arrival the receiver counts the 1s. If the count no longer matches the agreed parity, at least one bit has been corrupted.
Its weakness is fundamental: if two bits in the same byte flip, the parity is restored and the error passes undetected. And even when an error is found, the check cannot say which bit is wrong.
Switch to One bit flipped. The row containing the error fails its check and so does the column — and the single cell where the two failures cross is the corrupted bit, which can then simply be flipped back.
A parity block can correct as well as detect
Send a block of bytes each with its parity bit, and add one extra parity byte at the end whose bits give the parity of each column. A single corrupted bit now fails exactly one row check and one column check, and their intersection identifies the faulty bit precisely — so the receiver can flip it back with no resend at all.
Checksums, echo checks and check digits
A checksum is a value calculated from all the data by an agreed arithmetic rule and sent with it. The receiver recalculates from what arrived and compares. Agreement means the data is almost certainly intact; disagreement means it is not, and the block is requested again.
An echo check is cruder: the receiver sends the entire data back and the sender compares it with what it sent. It is simple, but doubles the traffic and cannot tell whether the corruption happened on the way out or on the way back.
A check digit guards data entered by a human rather than transmitted. An extra digit is calculated from the others and appended, so ISBNs, barcodes and account numbers can be checked the moment they are typed. It catches the two commonest typing mistakes: a single wrong digit, and two adjacent digits transposed.
A system uses even parity. The byte 01101011 arrives, where the leftmost bit is the parity bit. Has an error occurred?
- Count the 1s in the whole byte:
0,1,1,0,1,0,1,1gives five.The parity bit is included in the count — it was set to make the total even. - Five is odd, but the system uses even parity.
- So the byte is corrupted — at least one bit has flipped in transmission.
- But the check cannot say which bit, and if two bits had flipped it would have found nothing at all.Stating the limitation is usually worth a mark.
Yes — five 1s under even parity means an error, though not which bit.
Automatic Repeat reQuest
ARQ is the system that ties the others together into something reliable. The receiver checks each packet, using a checksum or parity, and sends back a positive acknowledgement if it is intact or a negative one if it is not.
The sender also starts a timer when it transmits. If no acknowledgement arrives before the timer expires, the packet is assumed lost and resent. That covers the case the checks cannot: a packet that never arrived at all, so the receiver had nothing to check.
A limit is placed on the number of retries, so a permanently broken link produces an error rather than an endless loop of resends.
Before you leave this chapter
- Errors come from interference, attenuation and skew, and cannot be prevented — only detected.
- A parity bit makes the number of 1s even or odd; two flipped bits in one byte defeat it.
- A parity block adds a parity byte, and the row and column that both fail locate the bad bit.
- Checksum recalculates and compares; echo check returns the data; check digit guards typed input.
- ARQ uses acknowledgements and a timeout, so a packet that never arrives is also resent.
Choosing a method, and what each costs
Every error-detection method sends extra data alongside the real data. That overhead is the price of the checking, and choosing a method means deciding how much of it is worth paying.
A single parity bit costs one bit in eight — about 12% — and catches only some errors. A parity block costs an extra byte per block and can correct a single-bit error outright. An echo check costs 100% overhead, since everything is sent twice. A checksum costs very little and catches most corruption but cannot correct anything.
| Method | Overhead | Strength | Weakness |
|---|---|---|---|
| Parity bit | about 12% | very cheap and simple | misses two flipped bits |
| Parity block | a byte per block | locates and corrects one bad bit | still defeated by multiple errors |
| Checksum | very small | catches most corruption | cannot correct, only detect |
| Echo check | 100% | simple to implement | doubles traffic; direction unknown |
| ARQ | acknowledgements | guarantees eventual delivery | adds delay, needs a return path |
Detection and correction are different things
Only the parity block in this list can repair the data. Everything else tells you something is wrong and leaves you to ask for it again — which is why detection is nearly always paired with ARQ in a real system. A question asking how a system "ensures the data is correct" wants both halves: a check, and a mechanism for resending what fails it.