Error Detection and Correction
Error Detection and Correction
Background Information
01000110 01000010
Burst errors does not necessarily mean that the errors occur
in consecutive bits, the length of the burst is measured from
the first corrupted bit to the last corrupted bit. Some bits in
between may not have been corrupted.
Burst error
• Burst error is most likely to happen in serial transmission
since the duration of the error cause is normally longer
than the duration of a bit.
• The number of bits affected depends on the data rate and
duration of error cause.
Error detection
• Error detection is the decision on whether the received
data is correct or not without having a copy of the original
message.
• Error detection uses the concept of redundancy, which
means adding extra bits for detecting errors at the
destination.
Redundancy
Data bits
1001101010000001
Accept
Extra bits Error
Generator checking
Reject
1001
Redundancy check
Sender Receiver
1001 1001101010000001
Data + redundancy bits=codeword
Three types of redundancy checks are used
in data communications
Parity or Vertical Redundancy Check
(VRC)
• Parity check is the process of adding one extra bit to a
character bits for error checking and correction.
• The extra bit (called the parity bit), is selected to make the total
number of 1s in the codeword is even or odd.
• Even parity (ensures that a codeword has an even number of
1’s) and odd parity (ensures that there are an odd number of
1’s in the codeword)
Example: even parity Example: odd parity
1000000 → 11000000 1000000 → 01000000
1111101 → 01111101 1111101 → 11111101
1001001 → 11001001 1001001 → 01001001
Vertical Redundancy Check
VRC
01010110 01010100
(Even) (Odd) (Mismatch → error)
01010110 01010101
(Even) (Even) (match → no error) ??
0 1 1 1 1
1 0 0 0 1
0 0 0 1 1
Direction of unit transfer
1 1 1 1 0
0 0 1 1 0
1 1 1 0 1 VRC
0 0 0 1 1
1 1 0 1 1
Cyclic Redundancy Check (CRC)
CRC is the addition of a number of extra bits to data bits
for error detection and correction.
The transmitter generates the extra bits known as a
frame check sequence (FCS), so that the resulting
frame, consisting of message bits, is exactly divisible by
some predetermined number.
The receiver then divides the incoming frame by the
same number and, if there is no remainder, assumes
that there was no error.
Mostly used in data communication
Tells us whether an error has occurred, but does not
correct the error.
This is a type of “systematic error detection”
The error-checking bits are appended to the information byte
Calculating and Using CRCs
1. Consider the data bits e.g 1001011
2. The sender and receiver agree on an
arbitrary bits e.g 1011.
3. Value one (1) is subtracted from the number
arbitrary bits and result equated to 0s binary
values. i.e 4-1=3(000). The 0s are put at the
end of data bits resulting to bit stream
1001011000.
4. Divide step 3 (dividend) by step 2(divisor)
using “modulo 2 division”.
CRC Division Rules
1. A number is divisible by binary 1 if the
number of binary numbers in the dividend
are equal to the number of binary numbers
of the divisor, otherwise it is divisible by 0 if
the number of bits in the dividend are less
2. 1-1=0, 1-0=1, 0-0=0, and 0-1=1
Division
1
1011 1001011000
Division starts by 1 for the
-1011
first four significant dividend
10 bits as in the divisor. Multiply
quotient and divisor and
subtract.
Division
10
1011 1001011000
-1011 Drop next binary 0 then divide
by 0 because the number of
100 dividend bits are less than the
-000 divisor bits
100
Division
101
1011 1001011000
-1011 Drop next binary 1 then divide
by 1 because the number of
100 dividend bits are equal to the
-000 divisor bits, multiply the binary 1
by divisor, then subtract
1001
-1011
10
Division
1010
1011 1001011000
-1011 Drop next binary 1 then divide
by 0 because the number of
100 dividend bits are less than the
-000 divisor bits. There is no need to
multiply by 0 (remainder remains
1001 the same) then subtract.
-1011
101
Division
10101
1011 1001011000
-1011 Drop next binary 0 then divide
by 1 because the number of
100 dividend bits are equal the
-000 divisor bits then multiply the 1
obtained by the divisor then
1001 subtract
-1011
1010
-1011
1
Division
1010100
1011 1001011000
-1011 Drop next binary 0 then divide
by 0 because the number of
100 dividend bits are less than the
-000 divisor bits, then drop 0 and
divide by 0. This brings the
1001 division to an end
-1011
1010
-1011
100
Division
After the division, the following parts of the operation
results
Divisor
1010100 Quotient