76
CRC-16 (Cyclic Redundancy Check)
The step by step procedure to form the CRC-16 check bytes
is as follows :
1. Load a 16-bit register with all 1's.
2. Exclusive OR the first 8-bit byte with the high order
byte of the 16-bit register, putting the result in the 16-
bit register.
3. Shift the 16-bit register one bit to the right.
4a. If the bit shifted out to the right (flag) is one, exclusive
OR the generating polynomial 1010 0000 0000 0001
with the 16-bit register.
4b. If the bit shifted out to the right is a zero; return to step
3
5. Repeat steps 3 and 4 until 8 shifts have been performed.
6. Exclusive OR the next 8 bit byte with the 16-bit register.
7. Repeat step 3 through 6 until all bytes of the message
have been exclusive OR with the 16-bit register and
shifted 8 times.
8. The contents of the 16-bit register are the 2 byte CRC
error check and is added to the message most
significant bits first.
See table below
16-BIT REGISTER
MBS
FLAG
(Exclusive or)
1111
1111
1111
1111
0
0000 0010
1111
1111
1111
1101
Shift 1
0111
1111
1111
1110
1
Polynomial
1010 0000 0000 0001
1101
1111
1111
1111
Shift 2
0110
1111
1111
1111
1
Polynomial
0101 0000 0000 0001
GENMOM.PM5
20/03/100, 10:29
76