Objectives
• Understand the need to check for errors after
data transmission
• Describe each of the following error detection
methods:
• Parity check (odd and even) • Checksum
• Echo check
• Describe how check digits are used in data entry
including:
• ISBN • Bar codes
• Describe how an automatic repeat query (ARQ) is
used to establish data is correctly received
Error detection
Unit 2 Data transmission and encryption
Starter
• Work in a pair
• One partner reads out the
binary numbers in the
speech bubble
• The other partner must
write down the number
heard without looking
at this slide
• How can you do this
in the fastest way,
whilst making sure
that you are
100% accurate?
Error detection
Unit 2 Data transmission and encryption
Starter
• Some possible ways that you can make sure the
number was entered correctly:
• Repeat back numbers
• Give the numbers in sets of digits, such as four digits at a
time, then repeat back
• Have the listener confirm they heard correctly after each block
of numbers
Error detection
Unit 2 Data transmission and encryption
Transmission errors
• When data is transmitted, errors may
be introduced due to:
• Electrical interference
• Power surges
• Synchronisation issues
• Wear and tear on the cable or connectors
• These errors may cause:
• Data to be lost
• Data to be gained
• Data to be changed
Error detection
Unit 2 Data transmission and encryption
Error checking
• Computers need methods to check for data
transmission errors caused by interference
• These methods include the use of:
• Parity bits
• Check digits
• Check sums
• Echo checks and
• Automatic Repeat reQuests (ARQ)
Error detection
Unit 2 Data transmission and encryption
Parity bits
• When sending a byte of data, one bit is used as a
parity bit
• This is used to check if there is an error in the transmission
• For an even parity bit, the parity bit is set to 1 or 0 so that the
total number of 1s transmitted are an even number
• For example, if the binary number 1010001 is to be
transmitted, the parity bit is set to 1 so that the number has an
even number of 1 bits – four in this case
1 0 1 0 0 0 1 1
Parity bit
Error detection
Unit 2 Data transmission and encryption
Odd or even parity
• For even parity, all the 1s, including the parity bit,
must add up to an even number
• For odd parity, all the 1s must add to an odd number
• What are the parity bits that would be required for the
following numbers?
Even parity
0 0 1 1 0 0 1 ?
Parity bit
Odd parity
1 1 1 0 1 0 1 ?
Parity bit
Error detection
Unit 2 Data transmission and encryption
Odd or even parity
• What are the parity bits that would be required for the
following numbers?
Even parity
0 0 1 1 0 0 1 1
Parity bit
Odd parity
1 1 1 0 1 0 1 0
Parity bit
Error detection
Unit 2 Data transmission and encryption
Using parity for error detection
• When data is transmitted, the parity bit is set at the
transmitting end and parity is checked at the
receiving end
• If the wrong number of bits are found, an error has occurred
• It isn’t possible with parity checks to know which bit was
incorrectly transmitted
• If a transmission error is found, the receiving device
notifies the transmitting end and the data is resent
• Will a parity check find all errors that are possible when
transmitting data?
Error detection
Unit 2 Data transmission and encryption
Parity in error detection
• Will a parity check find all errors that are possible
when transmitting data?
• No - not all possible errors will be detected. For example, if
two bits are changed in transmission, these won’t be detected
Transmitted byte
0 0 1 1 0 0 1 1
Parity bit
Received byte
1 1 1 1 0 0 1 1
Parity bit
• The received byte has two mistakes, but the
parity bit is correct
Error detection
Unit 2 Data transmission and encryption
Parity block check
• In a parity block check, each byte has a parity bit,
whilst an additional parity byte is sent at the end of
the block
• Check the first three bytes to see if there are any problems
with the parity bits
Parity
bit
Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 Even parity
Byte 1 0 0 1 1 1 0 1 0
has been
Byte 2 0 1 0 1 1 0 0 1
used
Byte 3 1 1 1 0 0 1 1 0
Byte 4 1 0 0 1 1 0 0 1
Byte 5 0 1 1 1 1 1 1 0
Byte 6 1 0 1 0 1 0 1 0
Byte 7 0 1 0 1 0 1 0 1
Byte 8 0 1 1 1 0 0 0 1
Parity Byte 1 1 1 0 1 0 0 0
Error detection
Unit 2 Data transmission and encryption
Parity block check
• Check the first three bytes to see if there are any problems
with the parity bits
• We know that Byte 3 has an error in it
• Now check the Parity Byte for each bit to see which bit
contains the error
Parity
bit
Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 Even parity
Byte 1 0 0 1 1 1 0 1 0
has been
Byte 2 0 1 0 1 1 0 0 1
used
Byte 3 1 1 1 0 0 1 1 0
Byte 4 1 0 0 1 1 0 0 1
Byte 5 0 1 1 1 1 1 1 0
Byte 6 1 0 1 0 1 0 1 0
Byte 7 0 1 0 1 0 1 0 1
Byte 8 0 1 1 1 0 0 0 1
Parity Byte 1 1 1 0 1 0 0 0
Error detection
Unit 2 Data transmission and encryption
Parity block check
• Check the first three bytes to see if there are any problems
with the parity bits
• We know that Byte 3 has an error in it
• Now check the Parity Byte for each bit to see which bit
contains the error
Parity
bit
Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 Even parity
Byte 1 0 0 1 1 1 0 1 0
has been
Byte 2 0 1 0 1 1 0 0 1
used
Byte 3 1 1 1 0 0 1 1 0
Byte 4 1 0 0 1 1 0 0 1
Byte 5 0 1 1 1 1 1 1 0
Byte 6 1 0 1 0 1 0 1 0
Byte 7 0 1 0 1 0 1 0 1
Byte 8 0 1 1 1 0 0 0 1
Parity Byte 1 1 1 0 1 0 0 0
Error detection
Unit 2 Data transmission and encryption
Parity block check
• We now know which row and column the error is in, so we
can identify it
• The bit can now be corrected
Parity
bit
Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 Even parity
Byte 1 0 0 1 1 1 0 1 0
has been
Byte 2 0 1 0 1 1 0 0 1
used
Byte 3 1 1 1 0 0 1 1 0
Byte 4 1 0 0 1 1 0 0 1
Byte 5 0 1 1 1 1 1 1 0
Byte 6 1 0 1 0 1 0 1 0
Byte 7 0 1 0 1 0 1 0 1
Byte 8 0 1 1 1 0 0 0 1
Parity Byte 1 1 1 0 1 0 0 0
Error detection
Unit 2 Data transmission and encryption
Worksheet 3
• Complete Task 1 on Worksheet 3
Error detection
Unit 2 Data transmission and encryption
Checking data entry
• Barcodes and other numbers have check digits
which are used to make sure a number has been
entered correctly
• A barcode scanner may misread
the number and request
it to be scanned again
• A checkout assistant or
customer may mistype
the number if they have
to enter it manually
Error detection
Unit 2 Data transmission and encryption
Check digits
• A check digit is an additional digit at the end of a set
of other numbers designed to check for mistakes in
input or transmission
• Printed books have a unique barcode with an ISBN
(International Standard Book Number)
• Other products contain bar codes using formats such as UPC
(Universal Product Code)
• Both codes make use of check digits to make sure
they have been scanned or entered correctly
Error detection
Unit 2 Data transmission and encryption
Calculating the check digit
• Check digits are calculated by
multiplying each number by a weight
of 1 or 3 as shown below
• The rest of the algorithm is then completed
ISBN 5 0 1 4 0 1 6 1 5 0 8 2 1
Weight 1 3 1 3 1 3 1 3 1 3 1 3
Multiplication 5 0 1 12 0 3 6 3 5 0 8 6
Addition Add all the numbers 49
Remainder Find the remainder when divided by 10 9
Subtraction Subtract the result from 10 1
Error detection
Unit 2 Data transmission and encryption
Worksheet 3
• Complete Task 2 and Task 3 on Worksheet 3
Error detection
Unit 2 Data transmission and encryption
Checksums
• When transmitting data, in particular files, it is
important to be able to check that the file received
has no errors introduced when it was transmitted
• The file is run through an algorithm that produces a checksum
which it also sends
• When the file arrives, the receiving computer generates the
checksum and compares it with the checksum that was sent
• If the checksums don’t match, the file may have been
corrupted or altered in transmission
Error detection
Unit 2 Data transmission and encryption
Checksums
• Data or a file goes through a checksum algorithm
• A checksum is created and sent with the file
• When received the checksum is again generated
• If it doesn’t match the sent checksum an error has occurred
Transmit Checksum
algorithm
AF83572E AF83572E ≠ 748AFD92
Checksum
algorithm
AF83572EF9DA
Error detection
Unit 2 Data transmission and encryption
Echo check
• An echo check acts in the same way as an echo
from a wall
• The data is transmitted to the receiver
• The same data is then echoed back to the transmitter
• The transmitter compares the data with the original. If it isn’t
the same, the data is transmitted again
1. Data sent
Source Destination
2. All data echoed back
3. Original data and
echo compared
Error detection
Unit 2 Data transmission and encryption
Automatic Repeat reQuests
Sender Receiver
• Automatic repeat requests
(ARQs) work as follows:
DATA BLOCK 1
• The sender first sends a block of data
Acknowledgement
• The receiving computer then sends
back an acknowledgement
DATA BLOCK 2
• When the sender receives the
acknowledgement it sends the next Timeout
block of data DATA BLOCK 2
• If the acknowledgement is not Acknowledgement
received after a period of time, a
timeout occurs and the data is resent DATA BLOCK 3
• This process continues until the Acknowledgement
acknowledgement is received
Error detection
Unit 2 Data transmission and encryption
ARQ flowchart
START
Set timer Resend data
Has timer Yes
timed out?
No
No
Acknowledgement
received?
Yes
Transmission
complete
END
Error detection
Unit 2 Data transmission and encryption
Negative acknowledgements
Sender Receiver
• When a data block is correctly
received an DATA BLOCK 1
acknowledgement (ACK) is sent
ACK
• When the receiver detects an error
in a data block that has been sent, DATA BLOCK 2
a negative acknowledgement (NACK)
is sent NACK
• By sending a NACK, the sender DATA BLOCK 2
doesn’t need to wait so long in a
timeout – it can immediately send Acknowledgement
the data block again
DATA BLOCK 3
Acknowledgement
Error detection
Unit 2 Data transmission and encryption
Worksheet 3
• Complete Task 4 on Worksheet 3
Error detection
Unit 2 Data transmission and encryption
Plenary
• Work in a pair
• When giving a telephone number
or post code over the phone what
methods could be used to make
sure the numbers given are correct?
• What similarities do these have
to the methods of error
detection covered in this topic?
Error detection
Unit 2 Data transmission and encryption
Plenary
• Method 1
• When people give numbers on the phone, they will often give
them in groups of three or four then wait for them to be
repeated back – this is essentially an echo check
• Method 2
• After each group of numbers or letters are given, the person
listening will say ‘yes’ to confirm that they heard the letters
correctly – this is similar to an automatic repeat request
Error detection
Unit 2 Data transmission and encryption
Copyright
© 2021 PG Online Limited
The contents of this unit are protected by copyright.
This unit and all the worksheets, PowerPoint presentations, teaching guides and other associated files distributed
with it are supplied to you by PG Online Limited under licence and may be used and copied by you only in
accordance with the terms of the licence. Except as expressly permitted by the licence, no part of the materials
distributed with this unit may be used, reproduced, stored in a retrieval system, or transmitted, in any form or by
any means, electronic or otherwise, without the prior written permission of PG Online Limited.
Licence agreement
This is a legal agreement between you, the end user, and PG Online Limited. This unit and all the worksheets,
PowerPoint presentations, teaching guides and other associated files distributed with it is licensed, not sold, to
you by PG Online Limited for use under the terms of the licence.
The materials distributed with this unit may be freely copied and used by members of a single institution on a
single site only. You are not permitted to share in any way any of the materials or part of the materials with any
third party, including users on another site or individuals who are members of a separate institution. You
acknowledge that the materials must remain with you, the licencing institution, and no part of the materials may
be transferred to another institution. You also agree not to procure, authorise, encourage, facilitate or enable any
third party to reproduce these materials in whole or in part without the prior permission of PG Online Limited.