### The effect of errors on a CRC message

• Preliminaries

• Recall from the CRC decoding procedure:

• Let M be CRC protected message
• Let G be the generator polynomial

• If the message M is received with no error, then:

 ``` -------- G / M ..... Remainder = 0000...000 ```

• The error polynomial

• Error polynomial:

• Error polynomial = the polynomial that represents the bit errors in the received message

• If a bit is received correctly:

 The corresponding bit in the error polynomial = 0

• If a bit is received incorrectly:

 The corresponding bit in the error polynomial = 1

• Example:

 ``` Transmitted message = 10001100 Received message = 11101100 |||||||| VVVVVVVV Error polynomial = 01100000 ```

• How to determine the error polynomial:

 ``` Error = ReceivedMsg XOR TransmittedMsg ```

• The CRC computation and the error polynomial

• Claim:

• The CRC remainder computed using:

 ``` Received Message / generator polynomial ```

is equal to the CRC remainder computed using:

 ``` Error / generator polynomial ```

• Proof:

 ``` Error = ReceivedMsg XOR TransmittedMsg Therefore: Error % GP = (ReceivedMsg XOR TransmittedMsg) % GP (GP = Gen Poly) = (ReceivedMsg % GP) XOR (TransmittedMsg % GP) // TransmittedMsg % GP = 0 !!! = (ReceivedMsg % GP) XOR 0 = ReceivedMsg % GP ```

• Example: (previous example)

• Message with bit errors:

 ``` Generator polynomial: 1101 (Math. notation: 1×x3 + 1×x2 + 0×x1 + + 1×x0) N = 4 (Generator polynomial has 4 terms, or bits in "1001") Sender: (from a previous example) Message: 10001 CRC protected message: 10001100 1. Received message = 11101100 2. Check CRC by dividing "received message" by generator polynomial: 00011 ---------------- 1101 / 11101100 1101 ---- (XOR) 01111 1101 ---- (XOR) 1000 1101 ---- (XOR) 0101 <---- remainder = 101 ≠ 000 !!! 3. Received message is assumed to be corrupted Bit errors have been detected !!! ```

• We can obtain the same CRC remainder as follows:

 ``` 1. Received message = 11101100 = 10001100 + 01100000 ^ | "error polynomial" 2. Check CRC by dividing the error polynomial by generator polynomial: 1001 ---------------- 1101 / 01100000 1101 ---- 1000 1101 ----- 101 <---- same remainder = 101 !!! ```

• When can the CRC method detect error ?

• Recall that:

• The CRC method has detect (some) bit errors if:

 The remainder of the check procedure ≠ 0000..0000

• In other words:

 ``` if ( ReceivedMsg % GenPolynome ≠ 0000...0000 ) then: bit errors has been detected ```

• From above:

 ``` ReceivedMsg % GenPolynome = Error % GenPolynome !!! ```

Therefore:

 ``` if ( Error % GenPolynome ≠ 0000...0000 ) then: bit errors has been detected ```

In other words:

• If the error polynomial is not divisible by the generator polynomial, then:

 The bit error(s) will be detected by the CRC method (Because the remainder of the division is ≠ 000...0000 !!!)

Otherwise:

 The bit error(s) will not be detected by the CRC method (Because the remainder of the division is = 000...0000 !!!)

• Example:

 ``` Generator polynomial: 1101 (Math. notation: 1×x3 + 1×x2 + 0×x1 + + 1×x0) N = 4 (Generator polynomial has 4 terms, or bits in "1001") Sender: (from a previous example) Message: 10001 CRC protected message: 10001100 1. Received message = 11100100 = 10001100 XOR 01101000 2. Check CRC by dividing "received message" by generator polynomial: 00011 ---------------- 1101 / 11100100 1101|||| ----v||| 01101|| 1101|| ----vv 0000 3. Received message is assumed to be CORRECT Bit errors have NOT been detected !!! ```