Ch07-Error Detection and Correction
Ch07-Error Detection and Correction
Behrouz A Forouzan, Data Communications and Networking, 5th Edition, McGraw-Hill Education, 2013
1/34
Ch7 – Error Detection & Correction
7.1. Introduction
7.2. Block coding
7.3. Linear block codes
7.4. Cyclic codes
7.5. Checksum
2/34
7.1. Introduction
- Single error
- Burst error
3/34
7.1. Introduction
- The structure of encoder and decoder
4/34
7.1. Introduction
- XOR
5/34
7.2. Block coding
- Datawords and codewords in block coding
6/34
7.2. Block coding
- Process of error detection in block coding
7/34
7.2. Block coding
- Example
9/34
7.2. Block coding
- Example
• d(10101, 11110) = 3
11/34
7.2. Block coding
- Min Hamming dmin of all possible codeword pairs
dmin = 2
12/34
7.2. Block coding
- Min Hamming dmin of all possible codeword pairs
dmin = 3
13/34
7.2. Block coding
- Detect up to s errors dmin = s+1
- Correct up to t error dmin = 2t+1
- Example:
A code scheme has a Hamming distance dmin = 4. What is the error
detection and correction capability of this scheme?
Detect up to 3 errors (s = 3)
Correct up to 1 error (t = 1)
Part of its capability is wasted
Error correction codewords need an odd dmin (3, 5, 7,…)
14/34
7.3. Linear block codes
- A linear block code: XOR of 2 valid codewords
creates another valid codeword
15/34
7.3. Linear block codes
- Parity-check code (n = k+1, dmin = 2)
16/34
7.3. Linear block codes
- Parity-check code (n = k+1, dmin = 2)
17/34
7.3. Linear block codes
- Example
Assume the sender sends the dataword 1011. The codeword
created from this dataword is 10111, which is sent to the
receiver.
Show all the possible scenarios at the receiver?
1) No error
2) 1 error
3) 2 errors
4) Conclude?
18/34
7.3. Linear block codes
- Two-dimensional parity-check code
19/34
7.3. Linear block codes
- Two-dimensional parity-check code
20/34
7.3. Linear block codes
- Two-dimensional parity-check code
21/34
7.4. Cyclic codes
- Special linear block codes: if a codeword is
cyclically shifted (rotated) another codeword
23/34
7.4. Cyclic codes
- How to create a codeword given a dataword?
24/34
7.4. Cyclic codes
- How to detect an error?
25/34
7.4. Cyclic codes
- How to detect an error?
26/34
7.4. Cyclic codes
- How to detect an error?
c(x) e(x)
+
g(x) g(x)
• Detect a single bit error, i.e., e(x) = xi, i=0, 1,…, n-1?
27/34
7.4. Cyclic codes
- How to detect an error?
c(x) e(x)
+
g(x) g(x)
28/34
7.4. Cyclic codes
- Some standard generator polynomials
29/34
7.4. Cyclic codes
- Burst errors x i (x j i ... 1)
x r ... 1
Prob.2: A bit stream 10011101 is transmitted using the standard CRC method
described in the text. The generator polynomial is x3 + 1. Show the actual bit
string transmitted. Suppose the third bit from the left is inverted during
transmission. Show that this error is detected at the receiver’s end.
Prob.3: In CRC, show the relationship between the following entities (size
means the number of bits)?
c) The degree of the polynomial generator and the size of the divisor
d) The degree of the polynomial generator and the size of the remainder
31/34
Prob. – Ch07
Prob.4: What is the Hamming distance for each of the following codewords?
a) d(10000, 00000)
b) d(10101, 10000)
c) d(11111,11111)
d) d(000, 000)
Prob.5: Find the minimum Hamming distance for the following cases
32/34
Prob. – Ch07
Prob.6: Prove that the code represented by Table 10.8 is not a linear code. You need
to find only one case that violates the linearity.
Prob.7: Assuming even parity, find the parity bit for each of the following data
units.
a) 1001011
b) 0001100
c) 1000000
d) 1110111
33/34
Prob. – Ch07
Prob.8: Given the dataword 1010011110 and the divisor 10111.
b. Show the checking of the codeword at the receiver site (assume no error)
Prob.9: Assuming the bit error rate is p, what is the probability of m errors in
an n-bit data unit?
Prob.10: When we have to correct the errors and when we need to detect the
errors and request to transmit again?
34/34