AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Safe, correct and checked

Week 24 · 3.2 Data transmission and security · 3 lessons
1

Did it arrive intact?

Computing 8: Topic 3.2, pp. 244–254
GoalExplain how errors can appear in transmitted data and describe the steps of an echo check.
New words
error · a change in data, such as a 0 that arrives as a 1interference · a disturbance that can change signals while they travelecho check · a way to detect errors: the receiver sends back a copy and the sender compares it with the originalsender, receiver · the device that sends the data, and the device that gets it
Explanation

When data travels from one device to another, it can change on the way. Interference, or signals from nearby wires crossing, can turn a 0 into a 1. So the data that arrives may not be the same as the data that was sent. An echo check is a way to detect this. First, the sender sends the data to the receiver. Second, the receiver sends a copy of what it received back to the sender. Third, the sender compares the copy with the original. If they match, no error was found. If they do not match, there was an error, so the sender sends the data again.

Worked examples
StepWhat happensData
1sender sends10110010
2receiver sends a copy back10110010
3sender comparessame
4resultno error found
A sensor sends the code 10110010 to a computer. The computer sends back a copy: 10110010. The sender compares them and they match. The echo check finds no error.
StepWhat happensData
1sender sends10110010
2receiver gets and copies back10100010
3sender comparesdifferent at bit 4
4resulterror found: send again
The same sensor sends 10110010 again, but interference changes the fourth bit on the way. The receiver gets 10100010 and sends that back. The sender compares: the fourth bit is different, so there was an error, and the sender sends the data again.
Python
1sent = input("Sent? ")
2copy = input("Copy? ")
3if sent == copy:
4    print("No error found")
5else:
6    print("Error: send again")
Output
Error: send again
The check in Python. The two typed values stand for the original and the copy. They are compared with ==, and the program prints a result. Here 10110010 is typed as the original and 10100010 as the copy.
Class activity

Echo-check game (no computer). With a partner, play sender and receiver, sitting back to back. The sender writes an 8-bit code on a card and reads it out quietly. The receiver writes what they heard. A third person, standing between, may secretly change one digit when the code is read aloud (this is “interference”). The receiver then reads their copy back. The sender compares it with the card. Say “match” or “error: send again”. Swap roles three times. Count how often an error was found. An echo check can say that the data is different, but not which side was wrong. Explain why.

Practice
1
A sender sends 01101101 and gets back 01101101. What does the echo check tell the sender?
OriginalCopy received backResult
0110110101101101?
2
A sender sends 11010011 and gets back 11010111. Which bit is different, counting from the left, and what happens next?
Position12345678
original11010011
copy11010111
3
Put the echo check steps in order: (a) the sender compares; (b) the receiver sends back a copy; (c) the sender sends the data; (d) if they differ, send again.
4
A pupil says, “If the copy matches, the receiver definitely got the right data.” Is this always true? Think about when the copy travels back.