You are on page 1of 12

Unit 01.04.

02
CS 5220:
COMPUTER COMMUNICATIONS

Error Control – Polynomial Codes (CRC)


XIAOBO ZHOU, Ph.D.
Professor, Department of Computer Science
Polynomial Codes
 Polynomial arithmetic instead of check sums
 Implemented using shift-register circuits
 Also called cyclic redundancy check (CRC)
codes
 Most data communications standards use
polynomial codes for error detection
 Polynomial codes also basis for powerful
error-correction methods
Binary Polynomial Arithmetic
 Binary vectors map to polynomials (polynomial degree k-1)
(ik-1 , ik-2 ,…, i2 , i1 , i0)  ik-1xk-1 + ik-2xk-2 + … + i2x2 + i1x + i0

Addition: (x7 + x6 + 1) + (x6 + x5) = x7 + x6 + x6 + x5 + 1


= x7 +(1+1)x6 + x5 + 1
= x7 +x5 + 1 since 1+1=0 mod2

Multiplication: (x + 1) (x2 + x + 1) = x(x2 + x + 1) + 1(x2 + x + 1)


= x 3 + x 2 + x + x2 + x + 1
= x3 + 1
Division
 Division with Decimal Numbers (Euclidean Division)
34 quotient dividend = quotient x divisor + remainder
35 ) 1222 dividend 1222 = 34 x 35 + 32
105
divisor
172
140
32 remainder
Binary Polynomial Division
 Polynomial Division, p(x) = q(x) g(x) + r(x)

x3+ x2+ x = q(x) quotient


x3 + x + 1 ) x6 + x5 Dividend p(x)
x6 + x 4 + x3
Divisor g(x)
x 5+x4 +x3
x5 + x3 + x2
x4 + x2
x4 + x2 + x
Note: Degree of r(x) is x = r(x) remainder
less than degree of divisor
Cyclic Redundancy Check
 Cyclic Redundancy Check (CRC) uses polynomial
code, treating bit strings as representation of
polynomials with coefficients of 0 and 1 only.
 A k-bit data frame is regarded as the coefficient list
for a polynomial with k terms, ranging from x^k-1 to
x^0. Such a polynomial is said to be of degree k-1
 Polynomial arithmetic is done by per-bit XOR
Examples: 10011011 + 11001010
11110000 - 10100110
CRC Idea - Checkbits & Error Detection

Information k bits Received information bits

Recalculate Generator
check bits Polynomial
k bits
Channel
Calculate
Compare
check bits Sent Information
Received
check accepted if
check bits
Generator bits check bits
Polynomial n – k bits match
CRC Procedure - Preparation
 Given a generator polynomial g(x) that has degree n-k
g(x) = xn-k + gn-k-1xn-k-1 + … + g2x2 + g1x + 1

 Information polynomial i(x) has k information bits (degree k – 1)


i(x) = ik-1xk-1 + ik-2xk-2 + … + i2x2 + i1x + i0
CRC Encoding Procedure
1. Multiply i(x) by n-k; (puts n-k zeros in (n-k) low order positions)
2. Divide xn-k i(x) by g(x), and get a remainder polynomial r(x) of at most degree n-k-1. The remainder is
the CRC checkbits;

q(x)
3. Add remainder r(x) to xn-k i(x);
g(x) ) xn-k(put check bits in the n-kxlower-order
i(x) n-k
i(x) = q(x)g(x)
positions).+The
r(x)
resulted polynomial
will be transmitted codeword
r(x)

b(x) = xn-k i(x) + r(x)


CRC Polynomial example:
k = 4, n–k = 3

Generator polynomial: g(x)= x3 + x + 1


Information: (1,1,0,0) i(x) = x3 + x2
Encoding dividend: x3i(x) = x6 + x5
x3 + x2 + x 1110
x3 + x + 1 ) x6 + x5 1011 ) 1100000
x6 + x 4 + x3 1011
x5 + x4 + x3 1110
x5 + x 3 + x2 1011
x4 + x2 1010
x4 + x2 + x 1011
010
x
Remainder (check bits)
Transmitted codeword:
b(x) = x6 + x5 + x
b = (1,1,0,0,0,1,0)
Summary of the Lesson
 Binary polynomial code and binary arithmetic are
key to CRC encoding and checkbits calculation

You might also like