← IGCSE Computer Science Paper 1

Odd parity

A rule where the parity bit is set so the total number of 1s in the byte, including the parity bit, is odd. Even number of 1s in the data gives bit 1; odd number gives bit 0.

Understanding Odd parity in IGCSE Computer Science Paper 1

What it does: 0110 0000 has two 1s (even). Odd parity adds a parity bit of 1, so the total is three 1s, which is odd. Odd parity means the whole byte, parity bit included, ends up with an odd number of 1s. An even count needs one extra 1 to become odd, so the parity bit is 1. The two rules always give opposite parity bits for the same data.

Common mistakes: len(data) counts every bit, not just the 1s. Odd parity depends on the number of 1s, so it should be data.count("1"). With odd parity, an even number of 1s needs parity bit 1. The test must be ones % 2 == 0. Testing for == 1 swaps the two cases, which is the wrong way round.

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
With odd parity, the total number of 1s in the byte (including the parity bit) must be...
EvenOdd
Matches
Odd parity: 1110 0000 -> parity bit 1 (total four 1s)
↓
The data 1110 0000 already has three 1s, which is odd, so the parity bit should be 0. Adding 1 makes the total four, which is even.
Applying
Meanings
Term
odd parity
Meaning
A rule where the parity bit is set so the total number of 1s in the byte, including the parity bit, is odd. Even number of 1s in the data gives bit 1; odd number gives bit 0.
Practice
ones ← COUNT_ONES(data)
Testing
Gaps
IF ones MOD 2 = 0 THEN parity ←
Check Answer
Spots
1data = "1011001"
2ones = len(data)

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

The 'Firefly' badge — Night Coder, 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. With odd parity, the total number of 1s in the byte (including the parity bit) must be...
A. Odd ✓
B. Even
Odd parity means the whole byte, parity bit included, ends up with an odd number of 1s.
2. Data bits 1100 0011 (four 1s) use odd parity. What should the parity bit be?
A. 1 ✓
B. 0
The data has four 1s, which is even. A parity bit of 1 makes the total five, which is odd.
3. Data bits 1011 0001 (four 1s) use odd parity. What should the parity bit be?
A. 0
B. 1 ✓
Count the 1s: there are four, which is even. The parity bit must be 1 so the total becomes five (odd).
4. Data bits 1110 0000 (three 1s) use odd parity. What should the parity bit be?
A. 1
B. 0 ✓
Three 1s is already odd, so the parity bit is 0. Adding a 1 would make the total even.
5. Which statement about odd parity is correct?
A. If the data has an even number of 1s, the parity bit is 1 ✓
B. If the data has an even number of 1s, the parity bit is 0
An even count needs one extra 1 to become odd, so the parity bit is 1.

Match the Pairs

1011001 -> parity bit 1 → Odd parity: the data has four 1s (even), so the parity bit is 1 to make five 1s in total
1101100 -> parity bit 0 → Odd parity: the data already has three 1s (odd), so the parity bit stays 0
With odd parity, data with an even number of 1s needs the parity bit set to 1 → 0110 0000 -> 1 0110 0000
Switching from even parity to odd parity flips the parity bit for the same data → Data 0100 0001: even parity bit 0, odd parity bit 1
Odd parity: 1110 0000 -> parity bit 1 (total four 1s) → The data 1110 0000 already has three 1s, which is odd, so the parity bit should be 0. Adding 1 makes the total four, which is even.
Odd parity: 1001 0000 -> parity bit 0 (total two 1s) → The data 1001 0000 has two 1s, which is even, so the parity bit should be 1. A bit of 0 leaves an even total, which breaks the odd parity rule.

Key Term

odd parity
A rule where the parity bit is set so the total number of 1s in the byte, including the parity bit, is odd. Even number of 1s in the data gives bit 1; odd number gives bit 0.

Fill in the Blanks

1. IF ones MOD 2 = 0 THEN parity ← 1
Hint: Type the parity bit value needed when the data has an even number of 1s, so the total becomes odd.
2. IF ones MOD 2 = 1 THEN parity ← 0 ENDIF
Hint: Type the parity bit value used when the data already has an odd number of 1s.
3. IF ones MOD 2 = 0 THEN parity ← 1
Hint: Type the operator that gives the remainder after dividing the count of 1s by 2.
4. Data: 11000000 (two 1s) Even parity bit: 0 Odd parity bit: 1
Hint: The even rule gives 0 here. Type the bit that the odd rule needs, so the total number of 1s is odd.
5. Data: 1110000 has three 1s (odd) Odd parity bit: 0 Sent byte: 01110000
Hint: Type the parity bit that goes at the front of the byte, matching the odd parity bit above.

Spot the Error

Question 1
A data = "1011001"
B ones = len(data)
C parity = 1 - ones % 2
D print(str(parity) + data)
Line B — len(data) counts every bit, not just the 1s. Odd parity depends on the number of 1s, so it should be data.count("1").
Question 2
A ones = 4
B if ones % 2 == 1:
C parity = 1
D else:
E parity = 0
Line B — With odd parity, an even number of 1s needs parity bit 1. The test must be ones % 2 == 0. Testing for == 1 swaps the two cases, which is the wrong way round.
Question 3
A data = "1100000"
B ones = data.count("1")
C parity = 1 - ones % 2
D total = ones - parity
E print(total % 2 == 1)
Line D — The total number of 1s includes the parity bit, so the parity bit must be added: total = ones + parity. Subtracting it gives the wrong total.
Question 4
A byte = "10110010"
B ones = byte.count("1")
C if ones % 2 == 0:
D print("Odd parity OK")
E else:
F print("Parity error")
Line C — A byte passes an odd parity check when its total number of 1s is odd, so the test should be ones % 2 == 1. Testing for == 0 is the even parity rule.
Question 5
A data = "0010110"
B ones = data.count("1")
C parity = 1 if ones % 2 else 0
D print(data + str(parity))
Line C — The data has three 1s, which is already odd, so the parity bit must be 0. This line gives 1 when the count is odd, which is the even parity rule. It should be 0 if ones % 2 else 1.

Student with a class code? Join your class →