Cambridge IGCSE · Topic 2.2
IGCSE Computer Science 0478 / Topic 2 / IGCSE

Did it arrive intact?

Electrical interference can flip a bit, lose one or add one while data travels. The receiver cannot see the original, so the sender adds extra checking data. Learn three ways of spotting that something has gone wrong.

The key idea

Interference during transmission can cause data loss, data gain or data change, so data must be checked when it arrives. A parity check adds a parity bit so that each byte has an even (even parity) or odd (odd parity) number of 1s; a parity block adds a parity byte too, so the exact bit in error can be found. A checksum is a value calculated from the data and sent with it, then recalculated by the receiver. In an echo check the receiver sends the data back and the sender compares it with the original.

even parity: the total number of 1s must be even 1110 1000 parity bit 7 data bits 1101000 contain three 1s 3 is odd, so the parity bit is set to 1 → four 1s in total if the receiver counts an odd number of 1s, an error has occurred
Fig. 1: setting the parity bit for even parity
Section 01

Parity bits.

Sender and receiver first agree on even or odd parity. In the lab, type a 7-bit value, choose a parity, and then flip a bit to see the receiver spot it.

Worked example Even parity
Add an even parity bit (as the leftmost bit) to the 7-bit data 1011001.
  1. Count the 1s: 1, 0, 1, 1, 0, 0, 1 gives four 1s.
  2. Four is already even, so the parity bit is 0.
Answer: 01011001
Worked example Checking a byte
A system uses even parity. The byte 11010011 is received. Has an error occurred?
  1. Count the 1s: 1 + 1 + 0 + 1 + 0 + 0 + 1 + 1 = 5.
  2. 5 is odd, but even parity was agreed.
Answer: Yes, an error has occurred
Your turn
Using odd parity, what is the parity bit for the 7-bit data 1110000?
Examiner trap

A parity check cannot detect an error where two bits change (for example 01011001 becoming 01011111): the number of 1s stays even, so the error is missed.

Section 02

The parity block.

Send several bytes, each with its own parity bit, then add a parity byte that checks each column. A bad row and a bad column cross at the bit in error.

Bit1 (parity)2345678
Byte 101011001
Byte 211110000
Byte 300100011
Byte 401001101
Parity byte11001111
Worked example Find the error
The block above was sent using even parity. One bit was changed during transmission. Find it.
  1. Count the 1s in each byte: 4, 4, 3, 4. Byte 3 has an odd number, so the error is in byte 3.
  2. Count the 1s in each column: 2, 4, 2, 2, 3, 2, 2, 4. Column 5 has an odd number.
  3. The error is where byte 3 and column 5 meet. That bit is 0, so it should be 1.
Answer: Byte 3, bit 5: corrected byte is 00101011
Examiner trap

A single parity bit only shows that a byte is wrong. Only a parity block (parity bits plus a parity byte) shows exactly which bit is wrong, so it can be corrected.

Stage 1 · Learn

Check what the sim just showed you

Four quick checks. Each correct answer earns XP and records this skill on your profile.

Quick check+10 XP

Which is NOT a way that interference can affect transmitted data?

Quick check+10 XP

Using even parity, what is the parity bit for the 7-bit data 0110110?

Quick check+10 XP

In the lab's parity block, how is the exact bit in error found?

Quick check+10 XP

In an echo check, who compares the data?

Section 03

Checksums and echoes.

Try the checksum and echo check modes in the lab. Corrupt one byte and see each method catch it.

Worked example A simple checksum
An algorithm adds the bytes and keeps the remainder after dividing by 256. Calculate the checksum for 120, 45, 200, 90.
  1. Add the bytes: 120 + 45 + 200 + 90 = 455.
  2. 455 is bigger than 255, so subtract 256: 455 − 256 = 199.
Answer: Checksum = 199
Examiner trap

An echo check cannot tell where the error happened: the data may have been correct on arrival and changed on the way back. Either way, it has to be sent again.

Stage 2 · Exam

Exam-style questions

Unlocks once the four checks above are done. Worth more XP, written to IGCSE Paper 1 standard.

Finish the four checks above to unlock the exam questions
Exam style+20 XP

A system uses odd parity. Which received byte contains an error?

Exam style+20 XP

Why can a parity check fail to detect an error?

Exam style+20 XP

What does the receiver do with a checksum?

Exam style+20 XP

A checksum is the sum of the bytes, with 256 subtracted while the total is over 255. What is the checksum of 64, 130, 255, 17?

Skill unlocked

Parity, checksums and echo checks, mastered.

This skill is now recorded on your profile. Keep the chain going.

-Rank -Level -Score -Topics
Go deeper · practice
Six original Cambridge-style questions
Why errors happen in transmission, odd and even parity, parity blocks, checksums and echo checks.