# Calculating CRC code

I think I may be under a misconception. When calculating the CRC code, how many bits do you append to the original message? Is it the degree of the generator polynomial (e.g. x^3+1 you append three 0s) or is it the number of digits used to represent the generator polynomial (e.g. x^3+1 gives 1001 which gives four 0s)?

For example if you had the generator G(x)=x^4+x+2 and the message 10 000 101 would the numerator be 100 001 010 000 or 1 000 010 100 000?

-

The number of bits in the CRC is the degree of the generator polynomial. That is, for a generator polynomial of $x^3+1$ you get a 3-bit CRC. This is because the remainder in polynomail division always has lower degree than the divisor, so you only need to represent those terms with lower exponent than the leading term in the generator.