C51编程:恳请详细指导如下这段关于CRC校验的确切意思,谢谢。
CRC SEQUENCE
The frame check sequence is derived from a cyclic redundancy
code best suited for frames with bit counts less than 127 bits
(BCH Code).
In order to carry out the CRC calculation the polynomial to be
diveded is defined as the polynomial, the coefficients of which
are given by the destuffed bit stream consisting of START OF
FRAME, ARBITRATION FIELD, CONTROL FIELD, DATA FIELD (if present)
and , for the 15 lowest coefficient , by 0. This polynomial is
divided (the coefficients are calculated modulo-2) by the
generator -polynomial:
x^15 + x^14 + x^10 + x^7 + x^4 + x^3 +1
The remainder of this polynomial division is the CRC SEQUENCE
transmitted over the bus. In order to implement this function ,a
15 bit shift register CRC_RG(14:0) can be used . If NXTBIT
denotes the next bit of the bit stream, given by the destuffed
bit sequence from START OF FRAME until the end of the DATA
FIELD, the CRC SEQUENCE is calculated as follows:
CRC_RG = 0; //initialize shift register
REPEAT
CRCNXT = NXTBIT EXOR CRC_RG(14);
CRC_RG(14:1) = CRC_RG(13:0); //shift left by
CRC_RG(0) = 0; //1 position
IF CRCNXT THEN
CRC_RG(14:0) = CRC_RG(14:0) EXOR (4599hex);
ENDIF
UNTIL(CRC SEQUENCE starts or there is an ERROR condition)
After the transmission/reception of the last bit of the DATA
FIELD, CRC_RG contains the CRC sequence.
发表时间:2002年5月15日7:08:00