I am an electronic engineer and have not found it important to consider CRC from a purely mathematical perspective. However, I have the following questions:
Why do we add n zeros to the message when we calculate the CRC, were n is the degree of the generator polynomial? I have seen this in the modulo-2 long division as well as the hardware implementation of CRC
Why do we want that the generator polynomial be divisible by (x+1)?
Why do we want that the generator polynomial not be divisible by x?
n
zeros when computing an n
-bit CRC because, when appending the CRC to the message and sending the whole (a usual practice in telecoms):
n
bit buffer, and on the transmit side it adds virtually no complexity (the extra terms of x(n)
reduce to an AND gate forcing message bits to zero during CRC transmission, and the n
extra reduction steps are performed as the CRC is transmitted).(M(x) * x^n) mod P(x) = R(x)
(perhaps, within some constant, or/and perhaps with some prescribed bits added at beginning of M(x)
, corresponding to an initialization of the CRC register), and the CRC computed on the receiving side is over the concatenation of M(x)
and R(x)
, that is(M(x) * x^n + R(x)) mod P(x)
, which is zero (or said constant).C(x)
as M(x) mod P(x)
, flipping the last bit of M(x)
and the last bit of C(x)
would go undetected, when most polynomials used in error detection insure that any two-bit error is detected up to some large message size.x+1
, because it ensures that any error affecting an odd number of bits is detected. However that practice is not universal, and it would sometime prevents selection of a better polynomial for some useful definitions of better, including maximizing the length of message such that m
errors are always detected (assuming no synchronization loss), for some combinations of m
and n
. In particular, if we want to be able to detect any 2-bit error for the longest message possible (which will be 2n
-1 bits including n
-bit CRC), we need the polynomial to be primitive, thus irreducible, thus (for n
>1) not divisible by x+1
.x
, because otherwise the last bit of CRC generated would be constant, and would not help towards detection of errors in the rest of the message+CRC.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With