You are on page 1of 24

CAMBRIDG

2.2 Methods of error detection E IGCSE


(0478/0984)

Error detection methods


2.2 Methods of error detection | Error detection methods CAMBRIDGE IGCSE (0478/0984)

Error detection methods


Parity
checks

Automatic
Parity block
Repeat
checks
Query (ARQ)

Error detection
methods

Check digits Checksums

Echo checks
2.2 Methods of error detection | Error detection methods CAMBRIDGE IGCSE (0478/0984)

Parity checks (odd and even)


Computers submit data in bytes. As we know, a byte is 8 bits.
In this method, the Most Significant Bit (MSB) is reserved and used as a parity bit.
We can use either odd or even parity.

0 1 0 0 1 0 0

Parity bit Data


2.2 Methods of error detection | Error detection methods CAMBRIDGE IGCSE (0478/0984)

Parity checks (odd and even)


Computers submit data in bytes. As we know, a byte is 8 bits.
In this method, the Most Significant Bit (MSB) is reserved and used as a parity bit.
We can use either odd or even parity.
The parity bit is set to either 0 or 1 so that the total number of 1s in the byte is either odd or even.

0 1 0 0 1 0 0

Parity bit Data

Odd parity 1 0 1 0 0 1 0 0

Even parity 0 0 1 0 0 1 0 0
2.2 Methods of error detection | Error detection methods CAMBRIDGE IGCSE (0478/0984)

Parity checks (odd and even)


Standard ASCII characters store letters in 7 bits and do not make use of the Most Significant Bit (MSB), so it can potentially
be turned into a parity bit.

G sent using
even parity
0 1 0 0 0 1 1 1

Parity bit Character code for G

G sent using
odd parity
1 1 0 0 0 1 1 1

Parity bit Character code for G


2.2 Methods of error detection | Error detection methods CAMBRIDGE IGCSE (0478/0984)

Parity checks (odd and even)


A byte of data being sent using odd parity without an error.

1 0 1 0 0 1 0 0

Parity bit Data


2.2 Methods of error detection | Error detection methods CAMBRIDGE IGCSE (0478/0984)

Parity checks (odd and even)


A byte of data being sent using odd parity without an error.

1 0 1 0 0 1 0 0

Parity bit Data


A byte of data being sent using odd parity with a single error.

1 0 1 0 1 1 0 0

Parity bit Data


2.2 Methods of error detection | Error detection methods CAMBRIDGE IGCSE (0478/0984)

Parity checks (odd and even)


A byte of data being sent using odd parity without an error.

1 0 1 0 0 1 0 0

Parity bit Data


A byte of data being sent using odd parity with a single error.

1 0 1 0 1 1 0 0

Parity bit Data


A byte of data being sent using odd parity with two errors.

1 0 0 0 1 1 0 0

Parity bit Data


2.2 Methods of error detection | Error detection methods CAMBRIDGE IGCSE (0478/0984)

Parity block checks


We have seen how parity can be used to detect an error in a single byte of data.
However, the position of the error cannot be worked out.

A byte of data being sent using odd parity with a single error

1 0 1 0 1 1 0 0

Parity bit Data

Our only option is to ask for the data to be sent again.


However, if we send multiple bytes as a transmission block, not only can we spot that an error has occurred, but it can
also be identified – and corrected by performing both horizontal and vertical parity checks on the whole block of data.
2.2 Methods of error detection | Error detection methods CAMBRIDGE IGCSE (0478/0984)

Parity block checks


Denary Binary Binary Binary
ASCII Value (no parity) (even parity) (odd parity)

A 65 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 1 0 0 0 0 0 1

32 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0

V 86 0 1 0 1 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 1 0 1 1 0

E 69 0 1 0 0 0 1 0 1 1 1 0 0 0 1 0 1 0 1 0 0 0 1 0 1

R 82 0 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 0 1 0 1 0 0 1 0

Y 89 0 1 0 1 1 0 0 1 0 1 0 1 1 0 0 1 1 1 0 1 1 0 0 1

32 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0

T 84 0 1 0 1 0 1 0 0 1 1 0 1 0 1 0 0 0 1 0 1 0 1 0 0

H 72 0 1 0 0 1 0 0 0 0 1 0 0 1 0 0 0 1 1 0 0 1 0 0 0

I 73 0 1 0 0 1 0 0 1 1 1 0 0 1 0 0 1 0 1 0 0 1 0 0 1

C 67 0 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 0 1 0 0 0 0 1 1

K 75 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 1 1 0 0 1 0 1 1

32 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0

F 70 0 1 0 0 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 0 0 1 1 0

O 79 0 1 0 0 1 1 1 1 1 1 0 0 1 1 1 1 0 1 0 0 1 1 1 1

G 71 0 1 0 0 0 1 1 1 0 1 0 0 0 1 1 1 1 1 0 0 0 1 1 1

0 0 0 0 0 0 0 1 1 0 1 0 1 0 0 0 1 0 1 0 1
2.2 Methods of error detection | Error detection methods CAMBRIDGE IGCSE (0478/0984)

Actual message received


Parity block checks
0 1 0 0 0 0 0 1 A
1. Using even parity, a message is sent as 1 0 1 0 0 0 0 0
a block of 8-bit bytes.
0 1 0 1 0 1 1 0 V

1 1 0 0 0 1 0 1 E

1 1 0 1 0 0 1 0 R

0 1 0 1 1 0 0 1 Y

1 0 1 0 0 0 0 0

1 1 0 1 0 1 0 0 T

0 1 0 0 1 0 0 0 H

1 1 0 0 1 0 0 1 I

1 1 0 0 0 0 1 1 C

0 1 0 0 1 0 1 1 K

1 0 1 0 0 0 0 0

1 1 0 0 0 1 0 0 D

1 1 0 0 1 1 1 1 O

0 1 0 0 0 1 1 1 G

1 1 0 1 0 1 0
2.2 Methods of error detection | Error detection methods CAMBRIDGE IGCSE (0478/0984)

Actual message received


Parity block checks
0 1 0 0 0 0 0 1 A
1. Using even parity, a message is sent as 1 0 1 0 0 0 0 0
a block of 8-bit bytes.
0 1 0 1 0 1 1 0 V
2. A horizontal parity check is performed
1 1 0 0 0 1 0 1 E
on each byte, which identifies an error
in one of the bytes. 1 1 0 1 0 0 1 0 R

0 1 0 1 1 0 0 1 Y

1 0 1 0 0 0 0 0

1 1 0 1 0 1 0 0 T

0 1 0 0 1 0 0 0 H

1 1 0 0 1 0 0 1 I

1 1 0 0 0 0 1 1 C

0 1 0 0 1 0 1 1 K

1 0 1 0 0 0 0 0

1 1 0 0 0 1 0 0 D

1 1 0 0 1 1 1 1 O

0 1 0 0 0 1 1 1 G

1 1 0 1 0 1 0
2.2 Methods of error detection | Error detection methods CAMBRIDGE IGCSE (0478/0984)

Actual message received


Parity block checks
0 1 0 0 0 0 0 1 A
1. Using even parity, a message is sent as 1 0 1 0 0 0 0 0
a block of 8-bit bytes.
0 1 0 1 0 1 1 0 V
2. A horizontal parity check is performed
1 1 0 0 0 1 0 1 E
on each byte, which identifies an error
in one of the bytes. 1 1 0 1 0 0 1 0 R

3. Additional vertical parity checks are 0 1 0 1 1 0 0 1 Y

performed on the whole block. 1 0 1 0 0 0 0 0

1 1 0 1 0 1 0 0 T

0 1 0 0 1 0 0 0 H

1 1 0 0 1 0 0 1 I

1 1 0 0 0 0 1 1 C

0 1 0 0 1 0 1 1 K

1 0 1 0 0 0 0 0

1 1 0 0 0 1 0 0 D

1 1 0 0 1 1 1 1 O

0 1 0 0 0 1 1 1 G

1 1 0 1 0 1 0
2.2 Methods of error detection | Error detection methods CAMBRIDGE IGCSE (0478/0984)

Actual message received


Parity block checks
0 1 0 0 0 0 0 1 A
1. Using even parity, a message is sent as 1 0 1 0 0 0 0 0
a block of 8-bit bytes.
0 1 0 1 0 1 1 0 V
2. A horizontal parity check is performed
1 1 0 0 0 1 0 1
on each byte, which identifies an error E

in one of the bytes. 1 1 0 1 0 0 1 0 R

3. Additional vertical parity checks are 0 1 0 1 1 0 0 1 Y

performed on the whole block. 1 0 1 0 0 0 0 0


4. The error can now be identified and 1 1 0 1 0 1 0 0 T
corrected without having to ask for the 0 1 0 0 1 0 0 0 H
data to be re-sent.
1 1 0 0 1 0 0 1 I

1 1 0 0 0 0 1 1 C

0 1 0 0 1 0 1 1 K

1 0 1 0 0 0 0 0

1 1 0 0 0 1
1
0 0 D
F
1 1 0 0 1 1 1 1 O

0 1 0 0 0 1 1 1 G

1 1 0 1 0 1 0
2.2 Methods of error detection | Error detection methods CAMBRIDGE IGCSE (0478/0984)

Checksums
A checksum is an error checking method that can verify if data has become corrupt following a transmission.
With this method, data is sent in blocks with an additional value known as a checksum added at the end.

Data transmission

00101001 01101001 11101000 01010000 11110100


Source Destination

Checksum Original data


2.2 Methods of error detection | Error detection methods CAMBRIDGE IGCSE (0478/0984)

Checksums
1. Before the data is transmitted, a checksum must be calculated and added to the end of the block of data. The checksum
is calculated from the block of data based on a pre-agreed algorithm.

11110100

01010000

Source Destination
11101000

01101001
00101001
2.2 Methods of error detection | Error detection methods CAMBRIDGE IGCSE (0478/0984)

Checksums
2. The data, along with the checksum, can now be transmitted.

11110100
00101001

01010000
00101001

Source Destination
11101000
00101001

01101001
00101001

00101001
2.2 Methods of error detection | Error detection methods CAMBRIDGE IGCSE (0478/0984)

Checksums
3. The receiving device uses the same pre-agreed algorithm to recalculate the checksum.

00101001
11110100

00101001
01010000

Source Destination
00101001
11101000

00101001
01101001
00101001

00101001
2.2 Methods of error detection | Error detection methods CAMBRIDGE IGCSE (0478/0984)

Checksums
4. The re-calculated checksum is compared to the original checksum. If the two checksums are the same, it is assumed
there are no errors. Otherwise, a request to re-send the original data is sent.

11110100
00101001

01010000
00101001

Source Destination
11101000
00101001

01101001
00101001

00101001 00101001
2.2 Methods of error detection | Error detection methods CAMBRIDGE IGCSE (0478/0984)

Echo check
1. Data is transmitted to the destination device.

100101100110100110010

Source Destination
2.2 Methods of error detection | Error detection methods CAMBRIDGE IGCSE (0478/0984)

Echo check
2. The destination device returns a copy of what it received back to the sender.

100100000110110110010

Source Destination
2.2 Methods of error detection | Error detection methods CAMBRIDGE IGCSE (0478/0984)

Echo check
3. The returned data is compared with the original data. If they are different, that means an error has occurred
at some stage, and the data is re-sent.

100101100110100110010

Source Destination
2.2 Methods of error detection | Error detection methods CAMBRIDGE IGCSE (0478/0984)

Echo check
The problem with this approach is that if the two sets of data are different, there is no way to tell whether the
error occurred when sending the data or when it was returned for checking.

100101100110100110010

Source Destination
2.2 Methods of error detection | Error detection methods CAMBRIDGE IGCSE (0478/0984)

Error detection methods

Parity checks
• When sending a byte of data, we can use the Most Significant Bit as a parity bit.
• With even parity, we set the MSB to be 1 or 0 so that the total number of bits – including the parity bit – is even.
• With odd parity, we set the MSB to be 1 or 0 so that the total number of bits – including the parity bit – is odd.
• With this method, simple errors can be spotted, but there is no way to tell exactly where the error occurred.
Parity block checks
• When sending a block of data, parity checks can be performed both horizontally and vertically on the whole block.
• These checks can spot that an error has occurred and where, allowing the receiving device to fix the error.
Checksums
• A checksum is calculated by using an algorithm on the data to be transmitted.
• This checksum is added to the transmission and sent along with it.
• The receiving device re-calculates the checksum and compares the new one with the original.
• If the checksums do not match, it is assumed that an error has occurred
Echo check
• The receiving device returns an exact copy of the data it has just received.
• The data is compared to what was originally sent. If it is different, it is assumed that an error has occurred, and the
original data is re-sent.

You might also like