2.3 - Error Detection & Correction
2.3 - Error Detection & Correction
ECE 578
Error detection
Error correction
2
Bit Errors in a Link
Types of errors
Isolated errors: Bit errors occurring independently
Burst errors: A cluster of bits in error
1011001010101010101010101000100010111001010010
Isolated Burst
3
How Often do Errors Occur?
BER = 10-7 (i.e., 1 bit every 10,000,000 bits)
4
Dealing with Errors
5
Error Detection
Example: 0 1 1 0 1 0 1 0 1 1 0 0 ← parity
Cannot tell where the error took place or how many occurred
6
Two-dimensional Parity
Arrange bits of a frame into a two dimensional array
1 0 0 1 0 1 0 1
0 1 1 1 0 1 0 0
1 1 1 0 0 0 1 0
1 0 0 0 1 1 1 0
0 0 1 1 0 0 1 1
1 0 1 1 1 1 1 0
7
(IP) Checksum
8
Cyclic Redundancy Check (CRC)
9
Polynomial Arithmetic
Any polynomial B(x) is divisible by a polynomial C(x) if deg(B) ≥ deg(C)
C(x) is called the divisor
If C(x) and B(x) are of the same degree, the remainder is obtained by
subtracting C(x) from B(x)
Modulo 2 arithmetic, subtraction is an XOR operation between
coefficients
10
CRC Calculation
Goal: For message M(x), and divisor C(x), construct polynomial P(x) that
is divisible by C(x)
Process:
Step 1: multiply M(x) by xk (add k zeros at the end of message) and obtain T(x) . k is
the degree of C(x).
Step 2: Divide T(x) by C(x)
Step 3: Subtract the remainder R(x) from T(x)
Step 4: Obtain P(x) = M(x)|R(x) divisible by C(x)
11
Example: CRC Calculation
M = 10011010,
C(x) = x3 + x2 +1
T(x) = ?
R(x) = ?
P(x) = ?
12
Example: CRC Calculation
M = 10011010, C(x) = x3 + x2 +1
13
Selection of C(x)
Single-bit errors: E(x) = xi, xk, x0 coefficients are nonzero, all single-bit
errors detected
Double-bit errors: C(x) has a factor with at least 3 terms
Odd number errors: C(x) contains the factor (x+1)
Any burst error of less than k bits and most burst errors of larger than k
bits
14
Commonly Used CRCs
CRC C(x)
CRC-8 x8 + x2 + x + 1
CRC-10 x10 + x9 + x5 + x4 + x + 1
CRC-12 x12 + x11 + x3 + x2 + 1
CRC-16 x16 + x15 + x2 + 1
CRC-CCITT x16 + x12 + x5 + 1
CRC-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x +1
15
Basics of Channel Coding
1011001010101010101010101000100010111001010010
n n
Weight of a word: The number of ones in the word.
Ex.: W(1011001)= 4
Hamming distance between x, y: d(x, y) = W(x y)
Ex. x = 1011001, y = 0010100, d = 4
Minimum distance: the minimum Hamming distance out of all distances
in a code
16
Detecting and Correcting Errors
An (n, k)-code can detect up to n-k-1 errors and correct up to n-k/2
errors
Example
Hamming (7,4)-code, can detect any single or two bit errors, and
correct any single bit error
Decoding Strategy
Maximum Likelihood Decoding – pick codeword with smallest
distance to the received word
17
Example – Repetition Code
1011001010101010101010101000100010111001010010
Organize data into an MxN matrix E.g. 9 x 7 matrix
read
1 8 15 22 …
2 9 16 23
3 10 17 24
write
4 11 18 25
5 12 19 26
6 13 20 27
7 14 21 28
19