PyGCSE Python Lab

Error Detection Simulator

Explore four error detection methods interactively: parity bits, majority voting, checksums, and check digits. Matches AQA A Level CS (7517) specification §4.5.5.3.

📖 Learn Step-by-Step

Click data bits to toggle them. The parity bit is calculated automatically. Use “Introduce Error” to flip a bit during transmission.

Data bits (click to toggle)

D0
D1
D2
D3
D4
D5
D6
D7
P

Introduce a single-bit error

Working

  1. Data bits: 01101001
  2. Count of 1s in data: 4
  3. Even parity: total 1s (including parity bit) must be even → parity bit = 0
  4. Transmitted: 011010010

Error Detection Practice Questions

Q1 · 1 mark
Question 1

Even parity bit

0/1 mark
A byte of data 10110010 is to be transmitted with an even parity bit appended. State the value of the parity bit.

Data bits:

10110010

Parity type: even

What is the parity bit?

Q2 · 2 marks
Question 2

Majority voting

0/2 marks
A system uses majority voting with each bit transmitted 3 times. The received data is shown below. Apply majority voting to decode each group.

Apply majority voting to each group:

110
010
101
Q3 · 2 marks
Question 3

Checksum calculation

0/2 marks
Three data bytes have values 100, 55, and 200. Calculate the checksum byte using modulo 256 arithmetic.

Data bytes:

10055200

Calculate the checksum byte (mod 256):

Q4 · 3 marks
Question 4

ISBN-13 check digit

0/3 marks
An ISBN-13 begins with the digits 978014028850. Calculate the check digit (the 13th digit). The weighting pattern alternates ×1, ×3, ×1, ×3, …

Given digits:

978014028850?

Calculate the check digit:

Q5 · 1 mark
Question 5

Odd parity bit

0/1 mark
A byte 11010110 is transmitted with odd parity. What is the value of the parity bit?

Data bits:

11010110

Parity type: odd

What is the parity bit?

Quick reference — error detection methods

Parity bits

An extra bit is appended so the total number of 1s is even (even parity) or odd (odd parity). Detects single-bit errors but not two-bit errors.

Majority voting

Each bit is transmitted an odd number of times (e.g. 3). The receiver takes the majority value. Can correct errors as long as fewer than half the copies are corrupted.

Checksums

All data bytes are summed and a checksum byte is appended so the total (mod 256) equals 0. The receiver re-sums; a non-zero result indicates an error.

Check digits

A digit calculated from the others using a weighted formula — e.g. ISBN-13 alternates weights of 1 and 3. Catches single-digit errors and most transpositions.