Crc-16, Crc-32 – Altera SerialLite II Protocol User Manual

Page 60

Advertising
background image

60

Altera Corporation

SerialLite II Protocol Reference Manual

Data Link Layer Description

CRC-16
CRC-16 (CRC-CCITT) is two bytes in size and uses the following
polynomial:

G(x) = X16 + X12 + X5 + 1

The procedure to calculate the CRC-16 is as follows:

1.

The initial value of the CRC-16 calculation is 0xFFFF.

2.

The CRC calculation is performed with the least significant bit of the
most significant byte being the first bit in the CRC calculation.

3.

The bit sequence from the calculation is complemented and the
result is CRC-16.

The 16 bits of the CRC value are placed in the CRC field so that X15 is the
left most bit of the first byte, and X0 is the right most bit of the second
byte, as shown in

Figure 2–39

.

Figure 2–39. Bit Positioning for CRC-16

In the absence of bit errors, if the packet payload and CRC are sent to the
CRC-16 calculator, the remainder is 16'b0001_1101_0000_1111
(0x1D0F).

CRC-32
CRC-32 is four bytes in size and uses the following polynomial:

G(x) = X32 + X26 + X23 + X22 + X16 + X12 + X11 + X10

+ X8 + X7 + X5 + X4 + X2 + X + 1

The procedure to calculate the CRC-32 is as follows:

1.

The initial value of the CRC-32 calculation is 0xFFFF_FFFF.

2.

The CRC calculation is performed with the least significant bit of the
most significant byte being the first bit in the CRC calculation.

3.

The bit sequence from the calculation is complemented and the
result is CRC-32.

X

15

…X

8

X

7

… …X

0

Advertising