User's Manual
WaveCom Electronics Inc
MA4061/MA4070 Manual; MAN1L2301 Rev03 (Mar 2002)
Approved: R. L.
41
7.6 CRC Calculation
The CRC calculations are performed using a table driven approach. The polynomial used is
X^16+X^15+X^2+1.
Only the basic algorithm and lookup table will be described here. Sample code is available on request. For
further information, this approach is described in detail in the following paper:
Perez, Aram; Byte-wise CRC Calculations, IEEE Micro, June 1983, pp. 40 - 50
The algorithm for the CRC calculation is as follows:
Exclusive-OR the input byte with the low-order byte of the CRC register to get X.
Shift the CRC register 8 bits to the right.
Exclusive-OR the CRC register with the contents of the table, using X as an index.
Repeat steps 1 - 3 for all message bytes.
☛
Note: The CRC register is 16 bits long, and should be cleared to 0 before beginning the
calculations.
For the transmit message: After all the message bytes have been processed, the CRC is tagged on to the
end of the message with the least significant byte first.
For the received message: After all the received message bytes have been processed, the resulting CRC
should be zero. If it is not zero, at least one bit error has occurred. If it is zero, it is assumed that no errors
have occurred.