Check digits and automatic repeat query Cambridge IGCSE Computer Science revision

Not started

Learn it

In plain words

Errors do not only happen in cables. People make them too, typing a long number or scanning a worn barcode. A check digit catches those. And once any error has been found, something has to get the data sent again: that is the job of automatic repeat query.

6 things to know

  1. A check digit is an extra digit worked out from the other digits of a code and added to the end.
  2. When the code is typed or scanned, the computer works the check digit out again. If it does not match the one entered, there is an error.
  3. A check digit can catch a wrong digit, two digits swapped round, and a digit missed out or added.
  4. Check digits are used in the ISBN on a book and in barcodes.
  5. Automatic repeat query (ARQ) uses acknowledgements and a timeout. The receiver checks the data. If it is correct, it sends a positive acknowledgement. If not, it sends a negative acknowledgement and the data is sent again.
  6. If the sender gets no acknowledgement within a set time (the timeout), it sends the data again automatically.

Worked example

A product code is 2714, and its check digit is the last digit of the sum of its digits. Work out the check digit, and show that swapping two digits is not always caught by a simple sum.

  1. Sum of the digits: 2 + 7 + 1 + 4 = 14. The check digit is 4, giving 27144.
  2. If the code is typed as 7214 by mistake, the sum is still 14 and the check digit still 4.
  3. So real check digit systems multiply each digit by a different weight first. Then swapping two digits changes the total.

Tips and tricks

  • A check digit finds errors in data entry. Parity, checksums and echo checks find errors in transmission. Keep the two jobs apart.
  • For ARQ, use the three key words: acknowledgement, timeout and resend.
5 questions, about 2 minutes.

It lands in your notebook with its questions as flashcards.

Check digits and automatic repeat query: 5 questions and answers

These are the quiz’s questions. Do the quiz first, then come back here for the ones that got you.

  1. What is a check digit?
    • a password added to a file
    • an extra digit calculated from the other digits in a code (the answer)
    • the first digit of a barcode
    • a digit that is always zero

    It is added to the end and recalculated whenever the code is entered.

  2. Which kind of error is a check digit designed to detect?
    • interference in a cable
    • a mistake made when a code is typed or scanned (the answer)
    • a virus in a file
    • a full hard disk

    It checks data entry.

  3. Where is a check digit used?
    • in a packet header
    • in an ISBN (the answer)
    • in a parity byte
    • in a pixel

    Books' ISBNs and product barcodes both end in one.

  4. In ARQ, what does the receiver send when data arrives without error?
    • a negative acknowledgement
    • a positive acknowledgement (the answer)
    • a timeout
    • a checksum

    The sender then knows it can move on.

  5. In ARQ, what happens if the sender receives no acknowledgement before the timeout?
    • It stops sending.
    • It sends the data again. (the answer)
    • It sends a different file.
    • It deletes the data.

    Silence is treated as failure.

Still stuck on this one?Ask in the Papermunch Discord, or help someone else who is. Discord is for ages 13 and up.Join the server

Things you can type

Or go straight to

Or browse a shelf