导航: 老古网老古论坛XMOS公共讨论区XMOS开源项目区单片机程序设计嵌入式系统广告区域
→C51编程:恳请详细指导如下这段关于CRC校验的确切意思,谢

* 7478: C51编程:恳请详细指导如下这段关于CRC校验的确切意思,谢谢。

   zbby 
zbby发表的帖子 

 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

  
回复该帖

本主题共有 1 帖,分页:>>>>>该主题的所有内容[1]条

 *树形目录 只列出部分跟帖的标题以及简单的摘要信息 该主题的部分跟帖如下:

[上一篇帖子]:老古,下载特区的的‘SST 89C54 89C58的中文资料’已经损坏,能帮忙修
[下一篇帖子]:发个邮件给我,我给你发一个