I'm new to CRC and Checksums and I am attempting the following query:
I am trying to determine the CRC using the generator polynomial P=x5+x4+x2 +1.
The message to be sent is = 1010001101.
For my query, I have been asked to:
- show the polynomial key;
- calculate the CRC &
- the message to be transmitted.
My attempt is as follows:
The polynomial generator is P=x5+x4+x2 +1. I've worked this out as 110101 (x to the power of 5=1; x to the power of 4=1; x to the power of 3=0; x to the power of 2=1; x to the power of 1=0; 1=1).
- I've then divided this into the message to be sent: 1010001101(msg) / 110101 (polyn) The Result = 11010; Remainder: 00011111.
For the message to be transmitted, I've subtracted the remainder from the original message (1010001101 - 00011111 = 101011111). Is this correct?
Is the CRC the number left (remainder) over after the message has been divided by the polynomial?
For error-checking.. would it be correct to say that if there is no remainder, the is no error in a received message? Or if not, how can I determine if there is an error in the received message?
Any help is greatly appreciated.
Many thanks.
Since the CRC polynomial is of 5th degree, the remainder has 5 bits. So the transmitted message has these 5 bits appended to its end (not subtracted from the message like you did). In your case, your division is right, and the CRC is 11111 (5 bits), so the message to be sent is 101000110111111.
For the error checking, when you divide the message appended by the CRC by the CRC polynomial, you will have a remainder of 00000 if no errors were detected (note that detected is key here - in a general case, you may have errors that lead to the same zero remainder but that has very low probability and in your specific case, with such short message, you are probably safe).