10.1 chapter 10 error detection and correction.. 10.2 data can be corrupted during transmission....
TRANSCRIPT
![Page 1: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/1.jpg)
10.1
Chapter 10
Error Detection and
Correction
.
![Page 2: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/2.jpg)
10.2
Data can be corrupted during transmission.
Some applications require that errors be detected and corrected.
Note
![Page 3: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/3.jpg)
10.3
10-1 INTRODUCTION10-1 INTRODUCTION
Let us first discuss some issues related, directly or Let us first discuss some issues related, directly or indirectly, to error detection and correction.indirectly, to error detection and correction.
Types of ErrorsRedundancyDetection Versus CorrectionForward Error Correction Versus RetransmissionCodingModular Arithmetic
Topics discussed in this section:Topics discussed in this section:
![Page 4: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/4.jpg)
10.4
In a single-bit error, only 1 bit in the data unit has changed.
Note
![Page 5: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/5.jpg)
10.5
Figure 10.1 Single-bit error
![Page 6: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/6.jpg)
10.6
A burst error means that 2 or more bits in the data unit have changed.
Note
![Page 7: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/7.jpg)
10.7
Figure 10.2 Burst error of length 8
![Page 8: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/8.jpg)
10.8
To detect or correct errors, we need to send extra (redundant) bits with data.
Note
![Page 9: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/9.jpg)
10.9
Figure 10.3 The structure of encoder and decoder
![Page 10: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/10.jpg)
10.10
In modulo-N arithmetic, we use only the integers in the range 0 to N −1, inclusive.
Note
![Page 11: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/11.jpg)
10.11
Figure 10.4 XORing of two single bits or two words
![Page 12: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/12.jpg)
10.12
10-2 BLOCK CODING10-2 BLOCK CODING
In block coding, we divide our message into blocks, In block coding, we divide our message into blocks, each of k bits, called each of k bits, called datawordsdatawords. We add r redundant . We add r redundant bits to each block to make the length n = k + r. The bits to each block to make the length n = k + r. The resulting n-bit blocks are called resulting n-bit blocks are called codewordscodewords..
Error DetectionError CorrectionHamming DistanceMinimum Hamming Distance
Topics discussed in this section:Topics discussed in this section:
![Page 13: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/13.jpg)
10.13
Figure 10.5 Datawords and codewords in block coding
![Page 14: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/14.jpg)
10.14
The 4B/5B block coding 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.
Example 10.1
![Page 15: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/15.jpg)
10.15
Figure 10.6 Process of error detection in block coding
![Page 16: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/16.jpg)
10.16
Let us assume that k = 2 and n = 3. Table 10.1 shows the list of datawords and codewords. Later, we will see how to derive a codeword from a dataword.
Assume the sender encodes the dataword 01 as 011 andsends it to the receiver. Consider the following cases:
1. The receiver receives 011. It is a valid codeword. The receiver extracts the dataword 01 from it.
Example 10.2
![Page 17: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/17.jpg)
10.17
2. The codeword is corrupted during transmission, and 111 is received. This is not a valid codeword and is discarded.
3. The codeword is corrupted during transmission, and 000 is received. This is a valid codeword. The receiver incorrectly extracts the dataword 00. Two corrupted bits have made the error undetectable.
Example 10.2 (continued)
![Page 18: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/18.jpg)
10.18
Table 10.1 A code for error detection (Example 10.2)
![Page 19: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/19.jpg)
10.19
An error-detecting code can detect only the types of errors for which it is designed; other types of errors may
remain undetected.
Note
![Page 20: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/20.jpg)
10.20
Figure 10.7 Structure of encoder and decoder in error correction
![Page 21: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/21.jpg)
10.21
The Hamming distance between two words is the number of differences
between corresponding bits.
Note
![Page 22: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/22.jpg)
10.22
Let us find the Hamming distance between two pairs of words.
1. The Hamming distance d(000, 011) is 2 because
Example 10.4
2. The Hamming distance d(10101, 11110) is 3 because
![Page 23: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/23.jpg)
10.23
The minimum Hamming distance is the smallest Hamming distance between all possible pairs in a set of words.
Note
![Page 24: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/24.jpg)
10.24
Find the minimum Hamming distance of the coding scheme in Table 10.1.
SolutionWe first find all Hamming distances.
Example 10.5
The dmin in this case is 2.
![Page 25: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/25.jpg)
10.25
Find the minimum Hamming distance of the coding scheme in Table 10.2.
SolutionWe first find all the Hamming distances.
The dmin in this case is 3.
Example 10.6
![Page 26: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/26.jpg)
10.26
A simple parity-check code can detect an odd number of errors.
Note
![Page 27: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/27.jpg)
10.27
Figure 10.11 Two-dimensional parity-check code
![Page 28: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/28.jpg)
10.28
Figure 10.11 Two-dimensional parity-check code
![Page 29: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/29.jpg)
10.29
Figure 10.11 Two-dimensional parity-check code
![Page 30: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/30.jpg)
10.30
10-4 CYCLIC CODES10-4 CYCLIC CODES
Cyclic codesCyclic codes are special linear block codes with one are special linear block codes with one extra property. In a cyclic code, if a codeword is extra property. In a cyclic code, if a codeword is cyclically shifted (rotated), the result is another cyclically shifted (rotated), the result is another codeword.codeword.
Cyclic Redundancy CheckHardware ImplementationPolynomialsCyclic Code Analysis
Topics discussed in this section:Topics discussed in this section:
![Page 31: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/31.jpg)
10.31
CRC
Transmit polynomial P(x) that is evenly divisible by C(x), and receive polynomial P(x) + E(x); E(x)=0 implies no errors.
Recipient divides (P(x) + E(x)) by C(x); the remainder will be zero in only two cases: E(x) was zero (i.e. there was no error), or E(x) is exactly divisible by C(x). Choose C(x) to make second case extremely rare.
![Page 32: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/32.jpg)
10.32
Example
Make all legal messages divisible by 3 If you want to send 10
First multiply by 4 to get 40 Now add 2 to make it divisible by 3 = 42
When the data is received .. Divide by 3, if there is no remainder there is no
error If no error, divide by 4 to get sent message
If we receive 43, 44, 41, 40, then error
![Page 33: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/33.jpg)
10.33
Figure 10.14 CRC encoder and decoder
![Page 34: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/34.jpg)
10.34
Figure 10.15 Division in CRC encoder
![Page 35: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/35.jpg)
10.35
Figure 10.16 Division in the CRC decoder for two cases
![Page 36: 10.1 Chapter 10 Error Detection and Correction.. 10.2 Data can be corrupted during transmission. Some applications require that errors be detected and](https://reader034.vdocuments.us/reader034/viewer/2022051417/5697bfec1a28abf838cb88b9/html5/thumbnails/36.jpg)
10.36
The divisor in a cyclic code is normally called the generator polynomial
or simply the generator.
Note