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

Check it, or ask again.

A check digit catches mistakes when a person types a number or a scanner misreads a barcode. ARQ makes sure transmitted data arrives correctly by asking for it again until it does. Both are about detecting errors, but at different moments.

The key idea

A check digit is an extra digit calculated from the other digits of a number and added to the end. When the number is entered, the check digit is recalculated and compared; if it does not match, a data entry error has been made. Check digits are used in ISBNs and barcodes. Automatic repeat query (ARQ) checks transmitted data: the receiver sends a positive acknowledgement if the data is correct or a negative acknowledgement if not, and the sender resends if it gets a negative acknowledgement or if a timeout passes with no acknowledgement.

ISBN-13 check digit for 978-1-86197-271-? 978186 197271 ? ×1×3×1×3×1×3 ×1×3×1×3×1×3 92183818 1277673 add the products: total = 118 118 MOD 10 = 8, and 10 − 8 = 2 check digit = 2 → 978-1-86197-271-2 (if the remainder is 0, the check digit is 0)
Fig. 1: calculating an ISBN-13 check digit with weights 1 and 3
Section 01

What a check digit catches.

Check digits protect data entry: a person typing a code, or a scanner reading one. They are not used to check data during transmission.

Examiner trap

A check digit detects errors in data entry. Parity, checksums and echo checks detect errors in transmission. Mixing these up loses marks.

Section 02

The ISBN-13 method.

Use the lab to calculate an ISBN-13 check digit, then change one digit or swap two and see the check fail.

Barcodes on products (EAN-13) use the same weights of 1 and 3.

Worked example Calculate
Calculate the check digit for the ISBN that begins 978095748422.
  1. Digits 9 7 8 0 9 5 7 4 8 4 2 2, weights 1 3 1 3 1 3 1 3 1 3 1 3.
  2. Products: 9, 21, 8, 0, 9, 15, 7, 12, 8, 12, 2, 6.
  3. Total = 109. 109 MOD 10 = 9.
  4. Check digit = 10 − 9 = 1.
Answer: 1, giving 9780957484221
Worked example Spot the error
The ISBN 9781861972712 is typed as 9781869172712. Show how the error is detected.
  1. Recalculate from the first 12 digits typed: 9, 21, 8, 3, 8, 18, 9, 3, 7, 6, 7, 3.
  2. Total = 102. 102 MOD 10 = 2, so the check digit should be 10 − 2 = 8.
  3. The check digit entered is 2, which does not match 8.
Answer: Error detected: the two swapped digits are caught
Your turn
Calculate the check digit for an ISBN beginning 978123456789.
Examiner trap

Do not stop at the remainder. The remainder 3 is not the check digit: subtract it from 10 (unless the remainder is 0).

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

How is a check digit produced?

Quick check+10 XP

What is the ISBN-13 check digit for a number beginning 978000000000?

Quick check+10 XP

In ARQ, what does the receiver send when the data has no errors?

Quick check+10 XP

In the lab, what made the sender resend a lost packet?

Section 03

Automatic repeat query.

Send packets in the lab's ARQ mode. Corrupt one to see a negative acknowledgement, then lose one to see the timeout.

Your turn
A packet is lost completely on the way. The receiver never sees it, so it sends nothing. How does ARQ recover?
Examiner trap

The timeout is on the sender. Write "the sender waits a set time for an acknowledgement; if none arrives, it resends the data".

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

Which is an example of where a check digit is used?

Exam style+20 XP

What is the ISBN-13 check digit for a number beginning 978190456321?

Exam style+20 XP

Which error is a check digit designed to detect?

Exam style+20 XP

In ARQ, what happens if the sender receives a negative acknowledgement?

Skill unlocked

Check digits and ARQ, 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
Check digits for data entry (ISBN-13 and barcodes) and automatic repeat query with acknowledgements and timeouts.