Data Communication and Networking Fourth Edition by Behrouz A. Forouzan
Data Communication and Networking Fourth Edition by Behrouz A. Forouzan
fourth Edition by
Behrouz A. Forouzan
Chapter 10
Error Detection
and
Correction
10.1
Note
10.2
10-1 INTRODUCTION
10.3
Note
10.4
Figure 10.1 Single-bit error
10.5
Note
10.6
Figure 10.2 Burst error of length 8
10.7
Redundancy : is the central concept in detecting &
correcting errors.
We need to send some extra bits with our data. These
redundant bits are added by the sender and removed by
the receiver .
Note
10.8
McGraw-Hil ©TheMcGraw-Hil Companies,Inc.,2000
Figure 10.3 The structure of encoder and decoder
10.9
Detection Versus Correction
10.11
Coding
Redundancy is achieved through various coding
schemes. The sender adds redundant bits through a
process that creates a relationship between the
redundant bits and the actual data bits.
1 block coding .
Note
In this section , we concentrate on block
codes; we leave convolution codes
to advanced texts.
10.13
Modular Arithmetic
In modular arithmetic, we use only a limited range of
integers. We define an upper limit, called a modulus N.
We then use only the integers 0 to N - 1.
For example, if the modulus is 12, we use only the
integers 0 to 11.
In a modulo-N system, if a number is greater than N, it
is divided by N and the remainder is the result.
10.14
Modulo-2 Arithmetic
Of particular interest is modulo-2 arithmetic. In this
arithmetic, the modulus N is 2. We can use only 0
and 1. Operations in this arithmetic are very simple.
The following shows how we can add or subtract 2
bits.
Adding: 0+0=0 0+1=1 1+0=1 1+1=0
Subtracting: 0 -0=0 0 -1=1 1-0=1 1 -1=0
use the XOR (exclusive OR) operation for both
10.17
Topics discussed in this section:
Error Detection
Error Correction
Hamming Distance
Minimum Hamming Distance
10.18
Figure 10.5 Datawords and codewords in block coding
10.19
Example 10.1
10.20
Figure 10.6 Process of error detection in block coding
10.21
Error Detection
How can errors be detected by using block coding?
If the following two conditions are met, the
receiver can detect a change in the original
codeword.
10.22
Example 10.2
10.23
Example 10.2 (continued)
10.24
Table 10.1 A code for error detection (Example 10.2)
10.25
Note
10.26
Figure 10.7 Structure of encoder and decoder in error correction
10.27
Error Correction
As we said before, error correction is much
more difficult than error detection. In error
detection, the receiver needs to know only that
the received codeword is invalid; in error
correction the receiver needs to find (or –
guess) the original codeword sent.
10.29
Example 10.3 (continued)
1. Comparing the received codeword with the first
codeword in the table (01001 versus 00000), the
receiver decides that the first codeword is not the one
that was sent because there are two different bits.
10.31
Hamming Distance
One of the central concepts in coding for error
control is the idea of the Hamming distance.
Note
The Hamming distance between two
words is the number of differences
between corresponding bits.
10.32
Example 10.4
10.33
Minimum Hamming Distance
the measurement that is used for designing a code is the
minimum Hamming distance.
We use dmin to define the minimum Hamming distance in a
coding scheme.
Note
10.35
Example 10.6
Solution
We first find all the Hamming distances.
10.36
Three Parameters
Before we continue with our discussion, we need to
mention that any coding scheme needs to have at least
three parameters: the codeword size n, the dataword
size k, and the minimum Hamming distance dmin.
10.37
Hamming Distance and Error
let us discuss the relationship between the Hamming distance
and errors occurring during transmission.
10.38
Note
10.39
Example 10.7
10.40
Example 10.8
10.41
10-3 LINEAR BLOCK CODES
10.42
Note
10.43
Example 10.10
Example 10.11
In our first code (Table 10.1), the numbers of 1s in the
nonzero codewords are 2, 2, and 2. So the minimum
Hamming distance is dmin = 2. In our second code (Table
10.2), the numbers of 1s in the nonzero codewords are 3,
3, and 4. So in this code we have dmin = 3.
10.45
Types of linear Block Codes
1-Simple Parity-Check Code: the most familiar error-
detecting code is the simple parity-check code. In this
code, a k-bit dataword is changed to an n-bit codeword
where n = k + 1. The extra bit, called the parity bit, is
selected to make the total number of 1s in the codeword
even.
10.46
Table 10.3 Simple parity-check code C(5, 4)
10.47
Figure 10.10 Encoder and decoder for simple parity-check code
10.48
Example 10.12
10.50
Note
10.51