← IGCSE Computer Science Paper 1

Checking a received byte for a parity error

The receiver counts the 1s in the whole received byte, parity bit included. If the count breaks the agreed even or odd rule, an error has occurred and is detected.

Understanding Checking a received byte for a parity error in IGCSE Computer Science Paper 1

What it does: 11100000 has three 1s. Three is odd, which breaks the even parity rule, so an error is detected. The first bit, the parity bit, flipped from 0 to 1. The count of 1s changed from four to five, so the even parity check fails. The parity bit is part of the received byte. The receiver counts the 1s in the whole byte, parity bit included. A pass means the count of 1s follows the rule. If two bits changed, the count could still look correct, so the error would be missed.

Common mistakes: The check IF ones MOD 2 = 0 passes when the count of 1s is even, so the agreed rule is even parity. Line 1 should be rule ← "even". With odd parity, an odd count of 1s means the byte passes the check. Line 4 should output "No error detected".

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 155–164) and word search (Modules 142–164).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Even parity is agreed. The receiver gets 10110010. What is the result of the parity check?
4 ones, which is even: no error detected4 ones, which is even: error detected
Matches
Odd parity: 10110100 has four 1s, so it passes
↓
Four is an even count. Odd parity needs an odd count of 1s, so this byte fails the check and an error is detected.
Applying
Meanings
Term
parity check
Meaning
The receiver counts the 1s in the whole received byte, parity bit included. If the count breaks the agreed even or odd rule, an error has occurred and is detected.
Practice
received ← "10110101"
Testing
Gaps
IF ones MOD 2 = THEN OUTPUT "No error"
Check Answer
Spots
1rule ← "odd"
2ones ← 4

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Scorpion' badge — Venom Debugger, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Even parity is agreed. The receiver gets 10110010. What is the result of the parity check?
A. 4 ones, which is even: no error detected ✓
B. 4 ones, which is even: error detected
Count the 1s in the whole byte: 1+1+1+1 = 4. Even parity needs an even count, so the check passes.
2. Odd parity is agreed. The receiver gets 01101100. What is the result of the parity check?
A. 4 ones, which is not odd: error detected ✓
B. 4 ones, which is fine: no error detected
There are four 1s. Odd parity needs an odd count, so the rule is broken and an error is detected.
3. Even parity is agreed. The receiver gets 11100000. Which statement is correct?
A. No error: 3 ones means the check passes
B. Error detected: 3 ones is an odd count ✓
Three 1s is an odd count. Even parity needs an even count, so the check fails.
4. Which bits does the receiver count when doing a parity check on a byte?
A. All 8 bits, including the parity bit ✓
B. Only the 7 data bits, leaving out the parity bit
The parity bit is part of the received byte. The receiver counts the 1s in the whole byte, parity bit included.
5. During transmission only the parity bit flips, from 0 to 1. The 7 data bits are unchanged. What does the receiver find?
A. No error is detected, because the data bits are unchanged
B. The count of 1s breaks the rule, so an error is detected ✓
The parity bit can be the bit that changed. The count of 1s in the whole byte is now wrong, so the check fails.

Match the Pairs

10110010 (even parity) → Four 1s is an even count, so the even parity check passes and no error is detected.
11010100 (odd parity) → Four 1s is an even count, which breaks the odd rule, so the check fails and an error is detected.
A byte arrives under even parity with an odd number of 1s, so the receiver reports an error → 11100000 (even parity)
The parity bit itself can be the bit that changed, and the check still fails → 01100110 -> 11100110 (even)
Odd parity: 10110100 has four 1s, so it passes → Four is an even count. Odd parity needs an odd count of 1s, so this byte fails the check and an error is detected.
Count the 1s in the 7 data bits only and ignore the parity bit → The receiver must count the 1s in the whole byte, parity bit included. Ignoring the parity bit gives the wrong result.

Key Term

parity check
The receiver counts the 1s in the whole received byte, parity bit included. If the count breaks the agreed even or odd rule, an error has occurred and is detected.

Fill in the Blanks

1. received ← 10110010 ones ← 4 IF ones MOD 2 = 0 THEN OUTPUT "No error"
Hint: Type the remainder an even count of 1s gives when divided by 2, which means an even parity check passes.
2. received ← 11010110 ones ← 5 IF ones MOD 2 = 1 THEN OUTPUT "No error"
Hint: Type the operator that gives the remainder after dividing the count of 1s by 2.
3. IF ones MOD 2 = 0 THEN OUTPUT "No error" ELSE OUTPUT "Error detected"
Hint: Type the keyword that starts the branch that runs when the even parity check fails.
4. received ← 10110011 ones ← 5 // parity bit included IF ones MOD 2 <> 0 THEN OUTPUT "Error"
Hint: Type the comparison operator meaning not equal to. An odd count breaks the even parity rule, even if only the parity bit changed.
5. received ← 11010100 ones ← 4 IF ones MOD 2 = 0 THEN OUTPUT "Error"
Hint: Type the keyword that displays a message. With odd parity, an even count of 1s means an error was detected.

Spot the Error

Question 1
A rule ← "odd"
B ones ← 4
C IF ones MOD 2 = 0 THEN
D OUTPUT "No error detected"
E ENDIF
Line A — The check IF ones MOD 2 = 0 passes when the count of 1s is even, so the agreed rule is even parity. Line 1 should be rule ← "even".
Question 2
A rule ← "odd"
B ones ← COUNT_ONES(byte)
C IF ones MOD 2 = 1 THEN
D OUTPUT "Error detected"
E ELSE
F OUTPUT "Error detected"
Line D — With odd parity, an odd count of 1s means the byte passes the check. Line 4 should output "No error detected".
Question 3
A byte ← "11010011"
B ones ← 4
C IF ones MOD 2 = 1 THEN
D OUTPUT "Error detected"
E ENDIF
Line B — The byte 11010011 contains five 1s, not four. Line 2 should be ones ← 5, so the count matches the byte.
Question 4
A sent ← "10101010"
B received ← "10101111"
C ones ← 5
D IF ones MOD 2 = 1 THEN
E OUTPUT "Error detected"
Line B — Only the last bit (the parity bit) changed, from 0 to 1. The received byte should be 10101011, which has five 1s. The broken line changes a data bit as well and gives six 1s.
Question 5
A rule ← "odd"
B ones ← COUNT_ZEROS(received)
C IF ones MOD 2 = 1 THEN
D OUTPUT "No error detected"
E ELSE
F OUTPUT "Error detected"
Line B — A parity check counts the 1s in the received byte, not the 0s. Line 2 should be ones ← COUNT_ONES(received).

Student with a class code? Join your class →