← IGCSE Computer Science Paper 1

What a checksum can and cannot detect

A sum of the data bytes sent with the data. It catches most changes, losses and gains, but misses swapped bytes or errors that cancel out, and cannot show which byte is wrong.

Understanding What a checksum can and cannot detect in IGCSE Computer Science Paper 1

What it does: A lost byte makes the received total differ from the sent checksum, so the error is detected. The receiver only compares two totals, so it knows an error exists but not where it is. Addition gives the same total in any order, so swapped bytes give the same checksum. This is a weakness of a checksum. A checksum uses the values of all the bytes, so it is stronger than one parity bit for a block. It still cannot say which byte is wrong. A checksum can miss some errors, so a match only means no error was found.

Common mistakes: Swapping bytes does not change the total, so both sums are 60. The checksum matches and the swap goes unnoticed. The line should say the swap is not detected. The checksum is 20, so the sent bytes must add up to 20. 5 + 9 + 7 is 21. The line should be sent ← [5, 9, 6].

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 168–178) and word search (Modules 168–188).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Two bytes swap places during transmission. The sum of all the bytes stays the same. Will the checksum spot the error?
No, the sum is unchanged so the error is missedYes, the checksum always notices a change of order
Matches
Checksums match, so the data must be perfect
↓
A matching checksum does not prove the data is correct, because swapped bytes or errors that cancel out give the same sum.
Applying
Meanings
Term
checksum
Meaning
A sum of the data bytes sent with the data. It catches most changes, losses and gains, but misses swapped bytes or errors that cancel out, and cannot show which byte is wrong.
Practice
// Swapped bytes give the same checksum
Testing
Gaps
IF sent received THEN OUTPUT "No error"
Check Answer
Spots
3IF SUM(sent) = SUM(got) THEN
4 OUTPUT "Swap detected"

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

The 'Space Turtle' badge — Speed in Zero-G, 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. Two bytes swap places during transmission. The sum of all the bytes stays the same. Will the checksum spot the error?
A. No, the sum is unchanged so the error is missed ✓
B. Yes, the checksum always notices a change of order
Addition gives the same total in any order, so swapped bytes give the same checksum. This is a weakness of a checksum.
2. One byte goes UP by 5 and another byte goes DOWN by 5. What happens to the checksum?
A. It changes, so the receiver always finds the errors
B. It stays the same, so the errors cancel out and are missed ✓
The +5 and -5 cancel in the total. The received sum matches the sent checksum, so the receiver thinks the data is fine.
3. A single byte in a block is changed during transmission. Which statement is true?
A. The sum changes, so the checksum will normally detect it ✓
B. The sum stays the same, so the checksum cannot detect it
One changed byte alters the total, so the receiver's sum will not match. A checksum catches most single changes, losses and gains.
4. Which is a strength of a checksum compared with a single parity bit for a whole block?
A. It checks every byte's value, so it catches more errors ✓
B. It can always find which byte is wrong and fix it
A checksum uses the values of all the bytes, so it is stronger than one parity bit for a block. It still cannot say which byte is wrong.
5. The receiver's checksum does not match the one sent. What can the receiver tell?
A. Exactly which byte is wrong, so it can correct it
B. There is an error somewhere, but not which byte is wrong ✓
A checksum only shows that the sums differ. It does not point to a particular byte, so the data usually has to be sent again.

Match the Pairs

Sent: 10, 20, 30 | Received: 30, 20, 10 → The bytes are swapped but the sum is still 60, so the checksum matches and the error is missed.
Sent: 10, 20, 30 | Received: 15, 20, 25 → One byte went up by 5 and another down by 5, so the sum is unchanged and the error is missed.
A checksum is stronger than a single parity bit for a block because it detects most changes, losses and gains in the whole block. → Sent: 10, 20, 30, sum 60 | Received: 10, 20, sum 60 -> 30 is not 60, error found
A checksum cannot show which byte is wrong: a mismatch only tells you that there is an error somewhere in the data. → Sent sum 60, received sum 65 -> error, but which byte?
Checksums match, so the data must be perfect → A matching checksum does not prove the data is correct, because swapped bytes or errors that cancel out give the same sum.
Checksum mismatch at byte 3, so resend byte 3 only → A checksum cannot show which byte is wrong, so the receiver cannot tell that byte 3 is the problem.

Key Term

checksum
A sum of the data bytes sent with the data. It catches most changes, losses and gains, but misses swapped bytes or errors that cancel out, and cannot show which byte is wrong.

Fill in the Blanks

1. sent ← 4 + 9 + 2 received ← 9 + 4 + 2 IF sent = received THEN OUTPUT "No error"
Hint: Type the comparison operator that is true when both sums are the same, so swapped bytes go unnoticed.
2. sent ← 10 + 20 + 30 received ← 11 + 19 + 30 IF sent = received THEN OUTPUT "Missed"
Hint: Type the byte value that cancels out the +1 change so the total stays the same as the sent sum.
3. sent ← 8 + 5 + 7 received ← 8 + 5 IF sent ≠ received THEN OUTPUT "Error"
Hint: Type the variable holding the sum of the bytes that arrived, which differs because a byte was lost.
4. IF sent ≠ received THEN errorDetected ← TRUE locationKnown ← FALSE
Hint: Type the Boolean value that records an error was found, even though the checksum cannot say which byte.
5. sum1 ← byteA + byteB sum2 ← byteB + byteA OUTPUT sum1 = sum2
Hint: Type the arithmetic operator used to add bytes; the order of the bytes does not change the result.

Spot the Error

Question 1
A sent ← [10, 20, 30]
B got ← [20, 10, 30]
C IF SUM(sent) = SUM(got) THEN
D OUTPUT "Swap detected"
Line D — Swapping bytes does not change the total, so both sums are 60. The checksum matches and the swap goes unnoticed. The line should say the swap is not detected.
Question 2
A sent ← [5, 9, 7]
B got ← [6, 8, 6]
C checksum ← 20
D OUTPUT SUM(got) = checksum
Line A — The checksum is 20, so the sent bytes must add up to 20. 5 + 9 + 7 is 21. The line should be sent ← [5, 9, 6].
Question 3
A sum ← SUM(received)
B IF sum <> checksum THEN
C OUTPUT "Byte 3 is wrong"
D REQUEST RESEND
Line C — A checksum only shows that the sum is wrong. It cannot show which byte is wrong. The message should say there is an error somewhere in the data.
Question 4
A checksum ← MAX(data) MOD 256
B SEND data, checksum
C received ← RECEIVE()
D calc ← SUM(rx.data) MOD 256
E IF calc <> rx.check THEN
Line A — A checksum is made by adding the data bytes, not by finding the largest one. The line should use SUM(data).
Question 5
A sent ← [8, 3, 4, 5]
B got ← [8, 3, 4, 5]
C IF SUM(got) <> 20 THEN
D OUTPUT "Error found"
Line B — The example shows a lost byte, so got should be missing the 5, and its sum is then 15, not 20. With all four bytes the sum would be 20 and no error would be found. The line should be got ← [8, 3, 4].

Student with a class code? Join your class →