
8.4. Calculating the CRC-16 Error Check Field
This section describes the procedure for obtaining the CRC-16 error check field. A
packet can be considered as a continuous, serial stream of binary data (0, 1). The 16-bit
checksum is obtained by multiplying the serial data stream by 216 (10000000000000000)
and then dividing it by the
generator polynomial
x
16
+x
15
+x
2
+1, which can be expressed as
a binary data 11000000000000101. The quotient is ignored and the 16-bit remainder is the
checksum and is appended to end of the packet.
In calculating the CRC, all arithmetic operations (additions and subtractions) are
performed using MODULO TWO, or EXCLUSIVE OR operation.
Steps for the Generating the CRC-16 Checksum:
1) Form a new polynomial by dropping the MSB (Most Significant Bit) of the generator
polynomial and reversing the bit sequence. This yields the binary number 1010 0000 0000
0001 or A0 01 Hex.
2) Load a 16-bit register with initial value FF FF Hex.
3) Exclusive OR the first data byte with the loworder byte of the 16-bit register, storing the
result in the 16-bit register.
4) Shift the 16-bit register one bit to the right. If overflow bit is 1, then turn to step 5).
Otherwise, turn to step 6)
5a) If the bit shifted out to the right is one, Exclusive OR the 16-bit register with
38