EEasy IGCSELabTracker

On a phone the notes, quizzes and tracker work fine. The 3D models and the practice lab are made for a laptop.

Specification points 2.2.1–2.2.4 ·

why transmission errors happen; parity check (including parity byte and parity block), checksum and echo check; check digits; automatic repeat query (ARQ).

1Why errors must be checked for (2.2.1)

Data can be corrupted during transmission, mainly by interference (for example electrical interference on a cable). Corrupted data is useless or, worse, gives wrong results, so the receiver must check it and get it re-sent if it is wrong.

Interference can cause (byte sent: 10110011):

  • data loss — bits go missing: 1011001
  • data gain — extra bits appear: 101100111
  • data change — bits are flipped: 10100011

2Parity check (2.2.2)

Definition

Parity bit — an extra bit (usually the left-most bit of the byte) set so that the byte has the agreed parity: an even or an odd number of 1s.

Process. Sender and receiver agree on even or odd parity. The sender counts the 1s in the data and sets the parity bit to make the total even (or odd). The receiver counts the 1s in each byte it receives; if the parity is wrong, an error has occurred.

Worked example

Data 1101000 has three 1s.

  • Even parity → parity bit 1 → sent as 11101000 (four 1s).
  • Odd parity → parity bit 0 → sent as 01101000 (three 1s).

Even parity: 11001000 arrives with three 1s — odd, so an error is detected.

A single-byte check has two weaknesses: it cannot show which bit is wrong, and if two bits change, the parity stays correct and the error is not detected.

Parity byte and parity block check

Several bytes are sent as a block, each with its own parity bit. A parity byte is added at the end: each of its bits is the parity bit for its column. The receiver checks the parity of every row and every column. The faulty bit is where the wrong row and wrong column cross, so it can be found and corrected.

column 1 2 3 4 5 6 7 8 parity bit 1s in row Byte 1 0 1 0 1 1 0 0 1 4 ✓ Byte 2 1 0 1 1 0 1 0 0 4 ✓ Byte 3 0 1 1 0 1 0 1 1 5 ✗ odd Byte 4 1 0 0 0 1 0 1 1 4 ✓ Byte 5 1 1 1 1 0 1 1 0 6 ✓ Parity byte 1 1 1 1 0 0 1 1 6 ✓ 1s in column 4 ✓ 4 ✓ 4 ✓ 4 ✓ 3 ✗ 2 ✓ 4 ✓ 4 ✓ Even parity agreed. Row 3 and column 5 both have odd parity, so the error is bit 5 of byte 3: it should be 0, not 1.
Figure 1. A parity block check (even parity).

Find the flipped bit

Loading the interactive…

3Checksum (2.2.2)

SENDER RECEIVER Calculates a checksum from the block using an agreed algorithm Sends the block with the checksum Recalculates the checksum from the received block (same algorithm) Compares the two checksums Same: no error detected Different: error — the block is re-sent
Figure 2. The checksum process.

4Echo check (2.2.2)

Sender Receiver 1 data is sent to the receiver 2 the receiver sends a copy of the data back 3 the sender compares the returned copy with the original: any difference means an error, so the data is re-sent
Figure 3. The echo check process.

A difference shows an error, but not whether it happened on the way there or on the way back.

5Check digit (2.2.3)

Definition

Check digit — an extra digit at the end of a number (a code), calculated from all the other digits. It detects errors in data entry (typing or scanning), not in transmission.

WHEN THE CODE IS CREATED The digits of the code An algorithm calculates the check digit from these digits The check digit is added as the final digit WHEN THE CODE IS TYPED IN OR SCANNED The computer recalculates the check digit from the other digits entered It compares the result with the check digit entered Match: code accepted No match: error — re-enter / re-scan
Figure 4. How a check digit is used.

Check an ISBN or a barcode

Loading the interactive…

It detects: a wrong digit (e.g. 5327 for 5307), two digits swapped (transposition, e.g. 5037 for 5307), and a digit missed out or added (e.g. 537 or 53107 for 5307).

Examples: the ISBN of a book, and the bar code on a product (the last digit of the number under the bars). The scanner or computer recalculates it on every scan.

Worked example — ISBN-13 (the algorithm is given in the question)

ISBN without its check digit: 9 7 8 0 3 4 0 9 8 3 8 2

  1. Add the digits in odd positions (1st, 3rd, …): 9 + 8 + 3 + 0 + 8 + 8 = 36
  2. Add the digits in even positions and multiply by 3: 3 × (7 + 0 + 4 + 9 + 3 + 2) = 3 × 25 = 75
  3. Add the results and divide by 10: 36 + 75 = 111 → 111 ÷ 10 = 11 remainder 1
  4. If the remainder is 0, the check digit is 0; otherwise subtract it from 10: 10 − 1 = 9

Full ISBN: 9780340983829.

6Automatic repeat query (ARQ) (2.2.4)

Definition

ARQ — a method that uses acknowledgements and a timeout to make sure data is received without error.

Positive acknowledgement — a message from the receiver telling the sender the data arrived without error.

Negative acknowledgement — a message from the receiver telling the sender the data arrived with an error, requesting it is re-sent.

Timeout — the set time the sender waits for an acknowledgement before re-sending the data.

Sender Receiver data block 1 checked: no error positive acknowledgement (ACK) data block 2 checked: error detected negative acknowledgement (NAK) data block 2 re-sent data block 3 lost timeout: no acknowledgement within the set time data block 3 re-sent automatically
Figure 5. ARQ. The receiver checks each block with an error-detection method (e.g. a checksum). Re-sending continues until a positive acknowledgement arrives (or a set number of attempts is reached).

Run an ARQ exchange

Loading the interactive…

Quick check

11 multiple-choice questions. Pick an answer to see whether it is right and why.

  1. The byte 10110011 is sent and 1011001 is received. Which effect of interference is this?

  2. Even parity is used and the parity bit is the left-most bit. Which byte is sent for the data 1011010?

  3. Odd parity is used. Which received byte contains an error?

  4. Why can a parity check on a single byte fail to detect an error?

  5. In a parity block check, byte 4 and column 2 have the wrong parity. What does this show?

  6. In a checksum, what does the receiver do with the block it receives?

  7. In an echo check, who compares the two copies of the data?

  8. What does a check digit detect?

  9. An ISBN-13 check digit is found by adding the digits in odd positions, adding 3 × the sum of the digits in even positions, dividing the total by 10, and taking the remainder from 10 (or using 0 if the remainder is 0). What is the check digit for 978052153740?

  10. In ARQ, what does the sender do if no acknowledgement arrives before the timeout?

  11. What does a negative acknowledgement tell the sender?

Exam-style questions

Write your answer, then show the answer and compare. Nothing here is marked for you: you decide how close you were. What you write is saved in this browser.

Questions

1

Explain why data should be checked for errors after transmission. Include the types of error that can occur.

3 marks
2

Add a parity bit (as the left-most bit) to each 7-bit value:
(a) 1010110, even parity · (b) 1110011, even parity · (c) 0110001, odd parity.

3 marks
3

Even parity is used. Which of these received bytes contain an error? 10110110 · 01110010

1 mark
4

Explain why a parity check may not detect an error.

2 marks
5

This block was received. Even parity is used; column 1 holds the parity bits and the last row is the parity byte. One bit is wrong. Identify it and give the corrected byte.

1 2 3 4 5 6 7 8
Byte 1 0 1 1 0 0 1 0 1
Byte 2 1 0 0 1 1 0 0 0
Byte 3 1 1 0 1 0 1 1 1
Byte 4 1 0 1 0 1 1 0 0
Parity byte 1 0 0 0 0 1 0 0
3 marks
6

Describe how a checksum is used to detect errors in transmitted data.

4 marks
7

Describe how an echo check works and give one drawback.

4 marks
8

The ISBN-13 check digit is found like this: add the digits in odd positions; add the digits in even positions and multiply by 3; add the two results and divide by 10; if the remainder is 0 the check digit is 0, otherwise it is 10 − remainder.
(a) Calculate the check digit for 978186197876. [2]
(b) A librarian types 9781861978796. Show how the computer detects the error. [2]

4 marks
9

State two types of data-entry error a check digit can detect.

2 marks
10

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

5 marks

How well do you know this?

Rate each specification point. It is saved to your tracker as a new revision round.

All points:
  • 2.2.1Understand the need to check for errors after data transmission and how these errors can occur
  • 2.2.2Describe the processes involved in each of the following error detection methods for detecting errors in data after transmission: parity check (odd and even), checksum and echo check
  • 2.2.3Describe how a check digit is used to detect errors in data entry and identify examples of when a check digit is used, including international standard book numbers (ISBN) and bar codes
  • 2.2.4Describe how an automatic repeat query (ARQ) can be used to establish that data is received without error

Settings

Your subjects

Untick the subjects you don't take. They leave the menu, the home page and the tracker. Your ratings are kept, so you can bring a subject back at any time.

Page style

Colours