a = q b + rand that 0 <=r < b
Just to be different from the book, we will usex3 + x2 + 1as our example of a generator polynomial.
bn bn-1 bn-2 . . . b2 b1 b0view the bits of the message as the coefficients of a polynomial
B(x) = bn xn + bn-1 xn-1 + bn-2 xn-2 + . . . b2 x2 + b1 x + b0
xk B(x) = Q(x) G(x) + R(x)Treating all the coefficients not as integers but as integers modulo 2.
xk B(x) + R(x)
xk B(x) - R(x)
xk B(x) - R(x) = Q(x) G(x)In other words, if the transmitted message's bits are viewed as the coeeficients of a polynomial, then that polynomial will be divisible by G(X).
x7 + x6 + x4 + x2 + x + 1
x7 + | x2 + | 1 | ||||||||||||
| ||||||||||||||
x3+ | x2 + | 1 | ) | x10 + | x9 + | x7 + | x5 + | x4 + | x3 | |||||
x10+ | x9 + | x7 | ||||||||||||
| ||||||||||||||
x5 + | x4 + | x3 | ||||||||||||
x5 + | x4 + | x2 | ||||||||||||
| ||||||||||||||
x3 + | x2 | |||||||||||||
x3 + | x2 + | 1 | ||||||||||||
| ||||||||||||||
1 | ||||||||||||||
T(x) = B(x) xk - R(x)where k is the degree of the generator polynomial and R(x) is the remainder obtained when B(x) is divided by the generator.
E(x) = T(x) - T'(x)then the coefficients of E(x) will correspond to a bit string with a one in each position where T(x) differed from T'(x) and zeroes everywhere else. Thus, E(x) corresponds to a bitmap of the positions at which errors occurred.
E(x) = xn1 + xn2 + ... xnrwhere we assume that ni > ni+1 for all i and that n1 - nr <= j.
Factoring out the lowest degree term in this polynomial gives:
E(x) = xnr (xn1-nr + xn2-nr + ... + 1 )