Teachers' Portal  /  IGCSE Computer Science 0478  /  Data transmission  /  Check digits and automatic repeat query (ARQ)
Lesson pack · IGCSE Computer Science 0478 · 2.2 · IGCSE

Check digits and automatic repeat query (ARQ)

Check it, or ask again. A check digit catches mistakes when a person types a number or a scanner misreads a barcode.

Student lesson Lab, full screen
At a glance

The shape of the lesson

Topic
Data transmission
Syllabus reference
Cambridge IGCSE Computer Science 0478, 2.2
Level
IGCSE
Duration
45 minutes, lab-led; stretches to a 60 minute block (see the contingency notes)
Position in topic
Lesson 5 of 6 in Data transmission; follows Parity checks, checksums and echo checks; leads into Symmetric and asymmetric encryption
Central model
Fig. 1: calculating an ISBN-13 check digit with weights 1 and 3
Cooperative structure
Assessment
Stage 1 check and the exam-style plenary from the student lesson, plus the worksheet as the exit task
Learning objectives

By the end of the lesson, learners can

Section by section
  • What a check digit catches: Check digits protect data entry: a person typing a code, or a scanner reading one.
  • 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.
  • Automatic repeat query: Send packets in the lab's ARQ mode.
Key points to leave on the board
  • Check digit: calculated from the other digits; recalculated on entry; mismatch = entry error.
  • ISBN-13: weights 1, 3, 1, 3 ...; add; MOD 10; 10 minus the remainder (0 stays 0).
  • ARQ: positive acknowledgement if correct, negative acknowledgement if not.
  • Timeout: no acknowledgement within the set time, so the sender resends.
The core visual model

One picture every idea returns to

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
Lesson sequence

Forty-five minutes, phase by phase

TimePhaseWhat happens in the roomGrouping
0 to 5 minHook: predictOpen with the question in the title, Check it, or ask again.. A check digit catches mistakes when a person types a number or a scanner misreads a barcode. Put the figure on the board: it is the one picture every idea in the lesson returns to.Whole class, then pairs
5 to 13 minTeach and check: What a check digit catchesCheck digits protect data entry: a person typing a code, or a scanner reading one.Whole class, then pairs
13 to 21 minTeach and check: The ISBN-13 methodUse the lab to calculate an ISBN-13 check digit, then change one digit or swap two and see the check fail. Project tab 4 of the lab (ISBN-13 check digit) and let a student drive it while the class predicts. Model the worked example Calculate on the board, one line at a time. Your turn: Calculate the check digit for an ISBN beginning 978123456789.Pairs
21 to 30 minTeach and check: Automatic repeat querySend packets in the lab's ARQ mode. Project tab 5 of the lab (Automatic repeat query (ARQ)) and let a student drive it while the class predicts. Your turn: A packet is lost completely on the way. The receiver never sees it, so it sends nothing. How does ARQ recover?Anticipation / Reaction Guide
30 to 36 minCheckThe four Stage 1 questions from the student lesson, answered on mini whiteboards or by show of fingers. Re-teach the one most get wrong.Individual, then whole class
36 to 43 minPlenaryThe exam-style questions from Stage 2, one at a time: thirty seconds alone, then a random call. The feedback lines in the key give the examiner's wording.Individual, random call
43 to 45 minExit and homeworkSet the worksheet below (6 questions, 17 marks). Learners self-assess against the objectives before they leave.Individual
Timing and contingency

Protect the parts that carry the learning

The sequence carries about fifty minutes of material, so the lab is driven by one student while the class predicts rather than explored freely. Times are a guide.

Protected: the check at 30 minutes. It is the only individual read on whether the key idea landed, and it is not cut.

Cut first if the build overruns: the last check in Automatic repeat query, never the check or the plenary.

In a 60 minute block: run worksheet questions 1 to 3 in class as a Rally Coach set and model both the hardest worked example and its check live.

Running the cooperative task

Anticipation / Reaction Guide

Before the lesson, students mark five statements true or false. After the teaching they mark them again and justify any change of mind in one sentence each. The statements come from the examiner traps below.

The full structure, with its variations and the other twelve, is on the cooperative-learning page.

Examiner traps to pre-empt

What to head off, and how

Trap learners fall intoTeaching move that pre-empts it
A check digit detects errors in data entry.Parity, checksums and echo checks detect errors in transmission. Mixing these up loses marks.
Do not stop at the remainder.The remainder 3 is not the check digit: subtract it from 10 (unless the remainder is 0).
The timeout is on the sender.Write "the sender waits a set time for an acknowledgement; if none arrives, it resends the data".
Worksheet

Check digits and automatic repeat query (ARQ): worksheet

6 questions, 17 marks. Written in the style of the papers; no past paper question is reproduced.

NameClassDate
Q1 · explain[3 marks]

Describe how a check digit is used to detect errors when a product barcode is scanned.

Q2 · calculate[2 marks]

The ISBN-13 check digit is calculated using the method in this lesson. Calculate the check digit for the ISBN that begins 979824681357. Show your working.

Q3 · analysis[3 marks]

A librarian enters the ISBN 9780141306144. The correct ISBN is 9780141036144. Show how the check digit detects the error and name the type of error.

Q4 · recall[2 marks]

Give two types of data entry error that a check digit can detect.

Q5 · explain[5 marks]

Describe how automatic repeat query (ARQ) is used to make sure data is received without error.

Q6 · analysis[2 marks]

A student says: "A check digit is the best way to check that a file has been transmitted correctly over the internet." Explain why the student is wrong.

Answer key and marking notes
Q1 · 3 marks
  • The check digit is calculated from the other digits and stored as the last digit of the barcode.
  • When the barcode is scanned, the check digit is recalculated from the other digits using the same algorithm.
  • If the recalculated digit does not match the scanned check digit, an error has occurred and the barcode is rescanned (or typed in).
Q2 · 2 marks
  • Products: 9, 21, 9, 24, 2, 12, 6, 24, 1, 9, 5, 21; total = 143.
  • 143 MOD 10 = 3; check digit = 10 − 3 = 7.
Q3 · 3 marks
  • Recalculate from the first 12 digits entered (978014130614): total = 92.
  • 92 MOD 10 = 2, so the check digit should be 8, but 4 was entered: the error is detected.
  • It is a transposition error (two digits, 0 and 3, swapped).
Q4 · 2 marks
  • An incorrect digit (one digit entered wrongly).
  • Transposed digits / an omitted digit / an extra digit (any one).
Q5 · 5 marks
  • The receiver checks the received data for errors (using an error detection method).
  • If there is no error, the receiver sends a positive acknowledgement to the sender.
  • If there is an error, the receiver sends a negative acknowledgement and the sender resends the data.
  • The sender starts a timer (timeout) when the data is sent.
  • If no acknowledgement is received before the timeout, the data is resent automatically; this continues until a positive acknowledgement is received.
Q6 · 2 marks
  • A check digit detects errors in data entry (typing or scanning a number), not errors in transmission.
  • A transmission error check such as a parity check, checksum or ARQ should be used instead.
Quiz

6 multiple-choice questions on this lesson

From the topic question bank. Assign them in the app for a marked score in your gradebook, or run the topic as a class game.

Q11 mark

What type of error is a check digit designed to detect?

  • AErrors made when a number is typed or scanned
  • BErrors caused by interference while data is being transmitted
  • CErrors where packets arrive at the receiver out of order
  • DErrors where a hacker has changed the data on purpose
Q21 mark

An ISBN-13 check digit is found by multiplying the first 12 digits alternately by 1 and 3, adding the results, finding the total MOD 10 and subtracting this from 10 (a remainder of 0 gives a check digit of 0). What is the check digit for an ISBN that begins 978014143951?

  • A8
  • B2
  • C0
  • D4
Q31 mark

In automatic repeat query (ARQ), what does the receiver send if the data it receives is correct?

  • AA positive acknowledgement
  • BA negative acknowledgement
  • CA copy of the data
  • DA new check digit
Q41 mark

Using ARQ, a sender transmits a block of data and starts a timer. The timeout passes and no acknowledgement has arrived. What does the sender do?

  • AResends the block of data
  • BAssumes the data arrived and sends the next block
  • CSends a negative acknowledgement to the receiver
  • DWaits until an acknowledgement eventually arrives
Q51 mark

The ISBN 9780141439518 is typed as 9780141349518, with two digits swapped. The computer recalculates the check digit from the first 12 digits typed (weights 1, 3, 1, 3, ...; check digit = 10 − total MOD 10, or 0 if the remainder is 0). What happens?

  • AThe error is detected: the recalculated check digit is 0, not 8
  • BNo error is detected: the recalculated check digit is still 8
  • CThe error is detected: the recalculated check digit is 2, not 8
  • DNo error is detected: check digits cannot catch swapped digits
Q61 mark

Why does ARQ need a timeout as well as positive and negative acknowledgements?

  • AWithout it, a lost block or lost reply would never be resent
  • BThe timeout lets the receiver recalculate the check digit before replying
  • CThe timeout tells the receiver how many packets it should expect
  • DWithout a timeout, negative acknowledgements would be treated as positive ones
Quiz key
Q1: A

A check digit is recalculated when a number is typed in or scanned, so it detects data entry errors such as a wrong digit or two digits swapped. Transmission errors are detected with parity checks, checksums, echo checks or ARQ. Packets arriving out of order is normal and is fixed using packet numbers. Deliberate tampering is a security issue, not what a check digit is designed for.

Q2: A

Products: 9, 21, 8, 0, 1, 12, 1, 12, 3, 27, 5, 3. Total = 102. 102 MOD 10 = 2, so the check digit is 10 − 2 = 8. 2 is the remainder, not the check digit. 0 would only be correct if the remainder were 0. 4 comes from multiplying the wrong digits by 3 (starting the weights 3, 1, 3, ... instead of 1, 3, 1, ...).

Q3: A

If the received data passes its error check, the receiver sends a positive acknowledgement, so the sender knows it does not need to resend. A negative acknowledgement means an error was found. Sending a copy of the data back is an echo check, not ARQ. Check digits are for data entry, not part of ARQ.

Q4: A

In ARQ, if no acknowledgement arrives before the timeout, the sender assumes something went wrong and resends the data. Assuming success would risk losing data. Acknowledgements are sent by the receiver, not the sender. Waiting indefinitely is exactly what the timeout is there to prevent.

Q5: A

Typed digits 9 7 8 0 1 4 1 3 4 9 5 1 give products 9, 21, 8, 0, 1, 12, 1, 9, 4, 27, 5, 3, total 100. 100 MOD 10 = 0, so the check digit should be 0, but 8 was typed, so the error is detected. It does not stay 8 because the swapped digits now get different weights. 2 is the remainder from the original, correct ISBN. Swapping adjacent digits is one of the main errors check digits are designed to catch.

Q6: A

If a block or its acknowledgement is lost, the receiver sends nothing the sender can see, so without a timeout the sender would wait forever. The timeout makes the sender resend when no reply arrives. ARQ does not use check digits. The timeout is about waiting time, not how many packets to expect. Positive and negative acknowledgements are distinct messages, so they cannot be confused because of a missing timeout.

Lab and demo

What to project

The student lesson embeds these tabs. Open them full screen on the projector; every slider has a drag handle on the stage.

Slides

Slides for this lesson

A projectable deck for every pack is on the way. Until then, present the student lesson full screen: its sections, figure and lab tabs follow the same order as the plan above.

Also for this topic

Everything else you can use

Original work by the TheLucidSTEM team. The worksheet items are written in the style of the papers; no past paper question is reproduced.
Previous lessonParity checks, checksums and echo checks