Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Polynomial Arithmetic for CRC

Please keep in mind that the polynomial arithmetic here is different from normal integer arithmetic, because: Coefficients of the polynomial may be only zero or one Operations are performed using modulo 2. 1. How to represent a binary sequence using polynomial, and how to represent a polynomial using binary sequence? Examples: M1 = 0010,1101 M1(x) = 0x7 + 0x6 + 1x5 + 0x4 + 1x3 + 1x2 + 0x1 + 1x0 = x5 + x3 + x2 + 1 M2 = 1000,0100 M2(x) = 1x7 + 0x6 + 0x5 + 0x4 + 0x3 + 1x2 + 0x1 + 0x0 = x7 + x2

2. How to subtract (or add) two polynomials? Answer: Represent the polynomials using binary sequences Perform bit-wise XOR between the two sequences Convert the XOR result back to polynomial Examples: M1(x) M2(x) M1 M2 = 0010,1101 1000,0100 = 1010,1001 x7 + x5 + x3 + 1 3. How to represent transmission errors using polynomial arithmetic? If a bit is flipped in transmission we get an error. Flipping a bit is equivalent to XOR the bit with 1. We therefore can represent transmission error by XORing an error binary sequence with the original sequence. Example: M1 = 0010,1101. During transmission the 3rd bit is flipped (one-bit error), and the receiver actually receives R = 0010,1001. Therefore, E = 0000,0100, and R = M1 E. If the number of 1s in E is two, we say we get two-bit error in our transmission. Remember that adding two polynomials is equivalent to XORing their binary sequence representations. Therefore another way to represent transmission error is to use polynomial addition.

Example: R = M1 E M1(x) + (x2) = (x5 + x3 + x2 + 1) + (x2) = x5 + x3 + 1 R 4. How to do polynomial multiplication? Answer: multiplying two polynomials is similar to normal polynomial multiplication with addition defined above (XOR). Example from lecture slides: M = x3 + x2 + 1, N = x4 + x2 + x. M N =

1101 10110 0000 1101 1101 0000 1101 11111110

M N

= x7 + x6 + x5 + x4 + x3 + x2 + x

5. How to do polynomial division? Answer: dividing a polynomial with another one of lower degree is similar to normal polynomial division with subtract defined above (XOR). Example from lecture slides: P(x) / C(x):

C(x) = P(x) =

x 3 + x2 + 1 x10 + x7 + x5 + x4 + x2 + 1

= 1101 = 10010110101

1101 C(x)

10010110101 1101 1000 1101 1011 1101 1101 1101 0101

P(x)

Remainder (lower degree than divisor C(x))

6. How is CRC related to above? CRC works as follows. The sender appends a few bits (CRC code) to a given binary sequence (a message), so that the polynomial representation of the concatenated binary sequence (transmitted message) is completely divisible by a given polynomial (CRC generator). Say the sender transmits a binary sequence (with CRC codes appended) P, which is completely divisible by C. Say the receiver receives a binary sequence R = P E, where E is the transmission error. Since polynomial addition is defined as binary XOR, we can also represent the received binary sequence as: R(x) = P(x) + E(x), where E(x) is the polynomial representation of the error E. The receiver divides the received binary sequence (received message) R (or R(x)) by the given CRC generator C (or C(x)). Note that the sender and receiver agree on the same CRC generator. If the remainder is non-zero, then the receiver knows there must be errors in the transmission (R P, or E 0). If the remainder is zero, two scenarios are possible: The received message matches the transmitted message (R = P, or E = 0), or The (polynomial representation of the) error is also completely divisible by the CRC generator. The art of CRC design is to choose the CRC generator to rule out the above 2nd scenario for typical patterns of transmission errors (i.e., for certain types of Es). See textbook for more elaboration on: Given a binary sequence (message) and a CRC generator, how to append bits to the end of the message so that the concatenated binary sequence is completely divisible by the CRC generator, and CRC generators that do not completely divide typical transmission errors (Es).

7. More hints on homework question 4-b. You basically have to look for an error binary sequence (with only two 1s) that is completely divisible by the given CRC polynomial. The minimum length of the error sequence limits the largest value of n. You can try to multiply the given CRC polynomial with another polynomial (of your choice) to see how you can get a product with only two 1s. This way the product polynomial will be completely divisible by the CRC polynomial. In your exploration you might figure out the minimum length of the product polynomial.

You might also like