Chapter 10
Error Detection
and
Correction
10.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Note
Data can be corrupted
during transmission.
Some applications require that
errors be detected and corrected.
10.2
10-1 INTRODUCTION
Let us first discuss some issues related, directly or
indirectly, to error detection and correction.
Topics discussed in this section:
Types of Errors
Redundancy
Detection Versus Correction
Forward Error Correction Versus Retransmission
Coding
Modular Arithmetic
10.3
Note
In a single-bit error, only 1 bit in the data
unit has changed.
10.4
Figure 10.1 Single-bit error
10.5
Note
A burst error means that 2 or more bits
in the data unit have changed.
10.6
Figure 10.2 Burst error of length 8
10.7
Note
To detect or correct errors, we need to
send extra (redundant) bits with data.
10.8
Figure 10.3 The structure of encoder and decoder
10.9
Note
In modulo-N arithmetic, we use only the
integers in the range 0 to N −1,
inclusive.
In a modulo-N system, if a number is greater than
N, it is divided by N and the remainder is the
result. If it is negative, as many Ns as needed are
added to make it positive.
10.10
Figure 10.4 XORing of two single bits or two words
10.11
10-2 BLOCK CODING
In block coding, we divide our message into blocks,
each of k bits, called datawords. We add r redundant
bits to each block to make the length n = k + r. The
resulting n-bit blocks are called codewords.
Topics discussed in this section:
Error Detection
Error Correction
Hamming Distance
Minimum Hamming Distance
10.12
Figure 10.5 Datawords and codewords in block coding
10.13
Example 10.1
The 4B/5B block coding discussed in Chapter 4 is a good
example of this type of coding. In this coding scheme,
k = 4 and n = 5. As we saw, we have 2k = 16 datawords
and 2n = 32 codewords. We saw that 16 out of 32
codewords are used for message transfer and the rest are
either used for other purposes or unused.
10.14
Four types of redundancy checks are used
in data communications
10.15
Vertical Redundancy Check
VRC
10.16
Performance
It can detect single bit error
It can detect burst errors only if the total
number of errors is odd.
10.17
Longitudinal Redundancy Check
LRC
10.18
Performance
LCR increases the likelihood of detecting
burst errors.
If two bits in one data units are damaged
and two bits in exactly the same positions
in another data unit are also damaged,
the LRC checker will not detect an error.
10.19
VRC and LRC
10.20
Error Correction
It can be handled in two ways:
1) receiver can have the sender retransmit
the entire data unit.
2) The receiver can use an error-
correcting code, which automatically
corrects certain errors.
10.21
Single-bit error correction
To correct an error, the receiver reverses the
value of the altered bit. To do so, it must
know which bit is in error.
Number of redundancy bits needed
◼ Let data bits = m
◼ Redundancy bits = r
Total message sent = m+r
The value of r must satisfy the following
relation:
2r ≥ m+r+1
10.22
Error Correction
10.23
Hamming Code
10.24
Hamming Code
10.25
Hamming Code
Example of Hamming Code
Single-bit error
Error
Detection