CS485 Sylabus

Pylonimial arithmetic in modulo 2

• CRC: a more robust (error detection) check summing technique

• Cyclic Redundancy Check (CRC):

• Cyclic Redundancy Check = a check "sum" computation technique based on division of:

 The message (bits)        and           A "CRC polynomial"

• The Cyclic Redundance Check (CRC) method is also known as

 polynomial code checksum

• Facts on CRC:

 The Cyclic Redundancy Check (CRC) method is the most commonly used "check summing" method in use today When a communication professional use the term "check sum" he/she is referring to a CRC check sum

Why is CRC is so popular:

• CRC codes can detect common occuring errors that are caused by noise (lightning) in transmission channels.

 CRC can detect n consecutive bit errors

• CRC encoders/decoders are easy to construct:

 Electronic circuits used to compute the CRC code consists of handful of elementary gates and 1-bit memery circuits (D-flipflops) !!!

• CRC computation

• Fact:

• The CRC check sum computation uses:

 Polynomial arithmetic in modulo 2 arithmetic

• Furthermore:

 The polynomials will be represented using bit strings. Polynomial arithmetic operation becomes simple binary number operations using XOR !!!

• Preliminary to CRC computation

• We will discuss the follwoing material first:

 Polynomials representation in modulo 2 arithmetic Performing modulo 2 arithmetic on polynomials Representing polymonials using bit strings Performing modulo 2 arithmetic on polynomials represented in bit strings

• Polynomial representation using modulo 2 arithmetic

• Modulo 2 representation:

 An even coefficient is mapped to 0 An odd coefficient is mapped to 1

• Example representing polynomials in modulo 2:

 ``` Polynomial: -x3 + 2x + 1 The polynomial in module 2 representation: x3 + 1 (mod 2) (Coefficient -1 is odd and is mapped to 1) (Coefficient 2 is even and is mapped to 0) (Coefficient 1 is odd and is mapped to 1) ```

• Polynomial arithmetic using modulo 2 arithmetic

 ``` (x3 + x) + (x + 1) = x3 + 2x + 1 = x3 + 1 (mod 2) ```

• Example: subtraction

 ``` (x3 + x) - (x + 1) = x3 - 1 = x3 + 1 (mod 2) ```

• Example: multiplication

 ``` (x2 + x) × (x + 1) = (x3 + x2) + (x2 + x) = x3 + 2x2 + x = x3 + x (mod 2) ```

• Example: division

 ``` x2 + 1 ---------------- x + 1 / x3 + x2 + x x3 + x2 --------- x x + 1 ------ -1 x3 + x2 + x ------------ = x2 + 1 remainder 1 (mod 2) x + 1 ```

• Modulo 2 arithmetic

• Summary: modulo 2 arithmetic

 ``` 0 1 0 1 + 0 + 0 + 1 + 1 ----- ----- ----- ----- 0 1 1 0 ```

Observation:

 The + (mod 2) operation is the same as an XOR (exclusive OR) operation used in logic !!!!

• Polynomial representation using a bit string

• Bit positions

• Bit string and position of a bit in the bit string:

 ``` Bit string: 1010 ^^^^ |||| |||+-- bit position 0 ||+--- bit position 1 |+---- bit position 2 +----- bit position 3 ```

• Bit string representation of a polynomial:

 The bit at position k is the coefficient of the factor xk in the polynomial

Example:

 ``` Polynomial: x5 + x4 + x2 + 1 x5 + x4 + x2 + 1 = 1x5 + 1x4 + 0x3 + 1x2 + 0x1 + 1x0 Bit string representation for the polynomial: 110101 ^^^^^^ |||||| |||||+----- x0 ||||+------ x1 |||+------- x2 ||+-------- x3 |+--------- x4 +---------- x5 ```

• Polynomial arithmetic using modulo 2 arithmetic with bit strings

• Polynomial arithmetic in modulo 2 can be perform with bit string representation as follows:

• Replace the + (mod 2) operation with:

 ``` XOR ```

 ``` (x3 + x) + (x + 1) = x3 + 2x + 1 = x3 + 1 (mod 2) In bit string representation: 1010 + 0011 ==> 1010 0011 ------ XOR 1001 ===> x3 + 1 (mod 2) Same result !!! ```

• Example: subtraction

 ``` (x3 + x) - (x + 1) = x3 - 1 = x3 + 1 (mod 2) In bit string representation: 1010 + 0011 ==> 1010 0011 ------ XOR 1001 ===> x3 + 1 (mod 2) Same result !!! ```

• Example: multiplication

 ``` (x2 + x) × (x + 1) = (x3 + x2) + (x2 + x) = x3 + 2x2 + x = x3 + x (mod 2) In bit string representation: 110 × 011 ==> 110 × 011 ----- 110 1100 00000 -------- XOR 1010 ====> x3 + x (mod 2) Same result !!! ```

• Example: division

 ``` x2 + 1 ---------------- x + 1 / x3 + x2 + x x3 + x2 --------- x x + 1 ------ -1 x3 + x2 + x ------------ = x2 + 1 remainder 1 (mod 2) x + 1 In bit string representation: 101 ====> Quotient = x2 + 1 (mod 2) --------- 11 / 1110 11|| ---v| 01| 00| ----v 10 11 ----- 1 ====> remainder = 1 (mod 2) ```

• Conclusion:

 We can use the bit string representation an the XOR operation to perform the compution for the polynomial arithmetic