CRC Proof
9/7/01

In class on Sept. 7 we worked through the proof that a feedback shift register constructed and used as directed in the text will compute M(x) mod C(x) where M and C are polynomials in x with degree(C)=k.

The proof is by induction on the length M.

Base case: clearly, when |M| = 0, the register, initialized to 0, contains 0 and M mod C = 0.

Induction step: show that if the register contains M mod C, then after extending M by one more bit, b, the register contains (Mx+b) mod C.

Part 1: compute (Mx+b) mod C in terms of the initial shift register contents
Let R = M mod C (the assumed initial contents of the shift register.
Then (Mx+b) mod C = ((Mx mod C) + (b mod C)) mod C
= ((M mod C)(x Mod C) + (b mod C)) mod C
= (Rx + b) mod C -- because x mod C and b mod C are x and b respectively

Part 2: figure out what 1 step of operation of the shift register computes
Examining the structure of the shift register we see:
    Call the bit shifted out of the high order bit c
    the shift operation alone is equivalent to multiplying R by x and subtracting x^k if c is 1
    if c is 1, (C - x^k) is added to the new value
    the value b (1 or 0) is added to the new value
so the new value in the shift register is
    R' = Rx - c(x^k) + c(C-x^k) + b = Rx +cC + b since the coefficent computations are  
    performed mod 2 so c(x^k) + c(x^k) = c(x^k)-c(x^k) = 0.
Thus R' mod C = (Rx + cC + b) mod C = (Rx + b) mod C since cC mod C is 0.

Now combining parts 1 and 2, we have R' mod C = (Rx+b) mod C = (Mx+b) mod C. We need the further observation that since the shift register doesn't have an x^k term, degree(R')<k, hence R' mod C = R' , so we conclude R' = (Mx + b) mod C, which is what we set out to do.