Methods of error detection

Computer Science · Data transmission. The idea in plain words, the rules to remember, the mistake to avoid and a worked example, written and checked by Mega Lecture.

Test this topic freeAll Computer Science topics

The idea

Data can be changed while it travels, for example by electrical interference. Bits can be flipped, lost or added. The receiver therefore needs a way to check that what arrived is what was sent.

Most methods work the same way. The sender calculates something extra from the data and sends it too. The receiver does the same calculation and compares. If the two do not match, there is an error and the data is sent again.

A parity check, a checksum and an echo check are for transmission. A check digit is for data entry, such as typing or scanning a bar code or ISBN.

In simpler words

Data can get changed while it travels, for example by interference. So the receiver checks it. The sender works out an extra value and sends it too. The receiver works it out again and compares. If they do not match, the data is sent again. Parity checks count the 1s. A check digit catches typing mistakes in codes like bar codes.

An everyday comparison

A checksum is like counting the coins in a bag before posting it and writing the total on the label. The receiver counts again; if the totals differ, something went wrong. The comparison stops working because a parity check only knows whether the count of 1s is even or odd, so two flipped bits can cancel out and go unnoticed.

Rules to remember

Common mistake

Students count only the seven data bits when checking a received byte. Count all eight bits, including the parity bit.

In the exam

Name the method, then describe it step by step: what the sender calculates, what is sent, what the receiver does, and what happens on a mismatch. For parity, count all eight bits, state even or odd, and say whether there is an error. For a parity block, find the failing row and column to locate the bit. For ARQ, mention acknowledgement and timeout.

Worked example

A system uses odd parity. Two bytes arrive: 1101 0110 and 0110 0110. Which one contains an error?

  1. Count the 1s in 1101 0110: 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 = 5. Five is odd, so this byte passes.
  2. Count the 1s in 0110 0110: 0 + 1 + 1 + 0 + 0 + 1 + 1 + 0 = 4. Four is even.
  3. With odd parity an even count means a bit has been changed.

Answer: The byte 0110 0110 contains an error.

Ask about this

Type what you are stuck on. The helper finds the explanation, worked examples and the notes to read, free and instant.

Keep going

← Types and methods of data transmissionEncryption →Take a Computer Science test