Error Checking Method
Error Checking Method
of
Error Checking Methods
checksum
echo check.
Parity checks Method
Parity checking is one method used to check whether data has been changed or
corrupted following data transmission.
The parity can be either called EVEN (that is, an even number of 1-bits in the byte) or
ODD (that is, an odd number of 1-bits in the byte).
One of the bits in the byte (usually the most significant bit or left-most bit) is reserved
for a parity bit.
In this example, if the byte is using even parity, then the parity bit needs to be set to 0,
since there is already an even number of 1-bits in the byte (four 1-bits).
In this example, if the byte is using odd parity, then the parity bit needs to be set to 1,
since we need to have an odd number of 1-bits in the byte.
Error Detection with Parity checks
If a byte has been transmitted from ‘A’ to ‘B’, and if even parity is used, an error would be flagged if
the byte now had an odd number of 1-bits at the receiver’s end.
In this case, the byte received has three 1-bits, which means it now has odd parity; while the sender’s byte was using even
parity (four 1-bits).
This means an error has occurred during the transmission of the byte. The error is detected by the recipient’s computer re-
calculating the parity of the byte sent.
If even parity had been agreed between sender and receiver, then a change in parity in the received byte indicates that a
transmission error has occurred.
Drawbacks of parity checks
If two bits are transposed (change places) then the computer could be fooled into thinking
the data is correct and not corrupted
If two random bits change state then the system could also be fooled
Checksum Methods
A checksum is a method used to check if data has been changed or corrupted following data transmission.
Data is sent in blocks, and an additional value, called the checksum, is sent at the end of the block of data.
1) when a block of data is about to be transmitted, the checksum is calculated from the block of data
2) the calculation is done using an agreed algorithm (this algorithm has been agreed by sender and
receiver)
3) the checksum is then transmitted with the block of data at the receiving end, the checksum is
recalculated by the computer using the block of data (the agreed algorithm is used to find the
checksum)
4) the re-calculated checksum is then compared to the checksum sent with the data block
5) if the two checksums are the same, then no transmission errors have occurred; otherwise a request is
made to re-send the block of data.
Echo Check Method
Echo check, when data is sent to another device, this data is sent back again to the sender.
The sender’s computer compares the two sets of data to check if any errors occurred during the
transmission process
2) the returned data is compared with the original data by the sender’s computer
3) if there are no differences, then the data was sent without error
4) if the two sets of data are different, then an error occurred at some stage during the data
transmission
Drawback of echo checks
If the two sets of data are different you will have no way of knowing
whether the error occurred when originally sent, or when it was sent back
ISBN 13
Modulo-11
Benefits
Good for spotting human errors such as:
transposition errors where two numbers have changed order, for example 5037
instead of 5307
omitted or extra digits, for example 537 instead of 5307 or 53107 instead of 5307
Calculation 1 – Generation of the check digit from the other 12 digits in a number
The following algorithm generates the check digit from the 12 other digits:
2) add all the even numbered digits together and multiply the result by 3
4) take the remainder, if it is zero then use this value, otherwise subtract the remainder
from 10 to find the check digit.
Using the ISBN 9 7 8 0 3 4 0 9 8 3 8 2
1) 9 + 8 + 3 + 0 + 8 + 8 = 36
2) 3 × (7 + 0 + 4 + 9 + 3 + 2) = 75
3) (36 + 75)/10 = 111/10 = 11 remainder 1
4) 10 – 1 = 9 the check digit
Calculation 2 – Re-calculation of the check digit from the thirteen-digit number (which now
includes the check digit)
To check that an ISBN 13-digit code is correct, including its check digit, a similar process is
followed:
1) add all the odd numbered digits together, including the check digit
2) add all the even number of digits together and multiply the result by 3
1) 9 + 8 + 3 + 0 + 8 + 8 + 9 = 45
2) 3 × (7 + 0 + 4 + 9 + 3 + 2) = 75
The modulo-11 method can have varying lengths of number which makes it suitable
for many applications, such as product codes or VINs.
The second calculation is a verification of the check digit (that is, a recalculation).
Calculation 1 – Generation of the check digit from the other digits in a number
The following algorithm generates the check digit from the other 7 digits:
1) each digit in the number is given a weighting of 8, 7, 6, 5, 4, 3 or 2 starting from the left (weightings start from 8
since the number will become eight-digit when the check digit is added)
2) the digit is multiplied by its weighting and then each value is added to make a total
4) the remainder is then subtracted from 11 to find the check digit (note if the remainder is 10 then the check digit ‘X’ is
used).
The example to be used has the following seven-digit number:
1) 7-digit number: 4 1 5 6 7 1 0
weighting values: 8 7 6 5 4 3 2
2) sum: (8 × 4) + (7 × 1) + (6 × 5) + (5 × 6) + (4 × 7) + (3 × 1) + (2 × 0)
= 32 + 7 + 30 + 30 + 28 + 3 + 0
total = 130
1) each digit in the number is given a weighting of 8, 7, 6, 5, 4, 3, 2 or 1 starting from the left
2) the digit is multiplied by its weighting and then each value is added to make a total
5) weighting values: 8 7 6 5 4 3 2 1
6) sum = (8 × 4) + (7 × 1) + (6 × 5) + (5 × 6) + (4 × 7) + (3 × 1) + (2 × 0) + (1 × 2)
= 32 + 7 + 30 + 30 + 28 + 3 + 0 + 2
total = 132
Automatic Repeat Request (ARQ) is a third way used to check data following data transmission
ARQ uses positive and negative acknowledgements (messages sent to the receiver indicating that data has/has
not been received correctly) and timeout (this is the time interval allowed to elapse before an acknowledgement
is received)
the receiving device receives an error detection code as part of the data transmission (this is typically a Cyclic
Redundancy Check – refer to Section 2.1.1); this is used to detect whether the received data contains any
transmission errors
if no error is detected, a positive acknowledgement is sent back to the sending device
however, if an error is detected, the receiving device now sends a negative acknowledgement to the sending
device and requests re-transmission of the data a time-out is used by the sending device by waiting a pre-
determined amount
of time and if no acknowledgement of any type has been received by the sending device within this time limit, it
automatically re-sends the data until a positive acknowledgement is received or until a pre-determined number
of re-transmissions has taken place
ARQ is often used by mobile phone networks to guarantee data integrity.
Each of these error-checking techniques has its advantages and limitations.