[go: up one dir, main page]

CN102546089B - Method and device for implementing cycle redundancy check (CRC) code - Google Patents

Method and device for implementing cycle redundancy check (CRC) code Download PDF

Info

Publication number
CN102546089B
CN102546089B CN201110000482.7A CN201110000482A CN102546089B CN 102546089 B CN102546089 B CN 102546089B CN 201110000482 A CN201110000482 A CN 201110000482A CN 102546089 B CN102546089 B CN 102546089B
Authority
CN
China
Prior art keywords
crc
parallel
bit
bit width
code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201110000482.7A
Other languages
Chinese (zh)
Other versions
CN102546089A (en
Inventor
陈思思
杨锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sanechips Technology Co Ltd
Original Assignee
ZTE Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Priority to CN201110000482.7A priority Critical patent/CN102546089B/en
Publication of CN102546089A publication Critical patent/CN102546089A/en
Application granted granted Critical
Publication of CN102546089B publication Critical patent/CN102546089B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Error Detection And Correction (AREA)
  • Detection And Correction Of Errors (AREA)
  • Detection And Prevention Of Errors In Transmission (AREA)

Abstract

本发明涉及一种循环冗余校验CRC码的实现方法及装置,该实现方法包括:对并行输入的信息码进行预处理,并获得其有效数据位;从上一次CRC并行计算获得的CRC码中选择当前有效CRC寄存器位;将所述有效数据位及所述当前有效CRC寄存器位进行至少一次异或运算,获得新的CRC码。本发明通过数据位预处理和CRC寄存器位反馈处理,达到了可进行任意位宽信息码的并行CRC处理的效果,并且提高了CRC生成、校验系统的运算性能,在满足高速CRC数据处理需求下,大大节省了逻辑资源,降低了实现成本,提高了灵活性、兼容性。

The present invention relates to a method and device for implementing a cyclic redundancy check (CRC) code. The implementation method includes: preprocessing information codes input in parallel, and obtaining valid data bits; CRC codes obtained from the previous CRC parallel calculation Select the current effective CRC register bit; perform at least one XOR operation on the effective data bit and the current effective CRC register bit to obtain a new CRC code. The present invention achieves the effect of parallel CRC processing of arbitrary bit width information codes through data bit preprocessing and CRC register bit feedback processing, and improves the computing performance of the CRC generation and verification system, and satisfies the high-speed CRC data processing requirements In this way, logic resources are greatly saved, implementation costs are reduced, and flexibility and compatibility are improved.

Description

循环冗余校验CRC码的实现方法及装置Method and device for realizing cyclic redundancy check CRC code

技术领域technical field

本发明涉及通信领域,尤其涉及一种循环冗余校验CRC码的实现方法及装置。The invention relates to the communication field, in particular to a method and device for realizing a cyclic redundancy check (CRC) code.

背景技术Background technique

为了通信系统中可靠性传输,人们采用差错控制技术,其中最常用的是循环冗余校验(CyclicRedundancyCheck,CRC)。For reliable transmission in communication systems, people use error control technology, the most commonly used of which is cyclic redundancy check (CyclicRedundancyCheck, CRC).

CRC原理基于线性编码理论。发送端将要传送的k位信息码序列,以一定规则产生r位校验码(CRC码),附在信息码后构成(k+r)位发送序列。接收端根据CRC码生成规则进行校验,判断传送过程是否出错。The CRC principle is based on linear coding theory. The k-bit information code sequence to be transmitted by the sending end will generate an r-bit check code (CRC code) according to certain rules, and attach it to the information code to form a (k+r) bit transmission sequence. The receiving end checks according to the CRC code generation rules to determine whether there is an error in the transmission process.

例如,待传送的k位二进制信息码序列为D={d[k-1]d[k-2]……d[1]d[0]},将序列D左移r位,除以一个(r+1)位的生成多项式,得到r位的余式R={r[r-1]r[r-2]……r[1]r[0]},将余式R作为序列D的CRC码,生成发送序列M={d[k-1]d[k-2]……d[1]d[0]r[r-1]r[r-2]……r[1]r[0]}。For example, the k-bit binary information code sequence to be transmitted is D={d[k-1]d[k-2]...d[1]d[0]}, shift the sequence D to the left by r bits, and divide by one (r+1)-bit generator polynomial, get r-bit remainder R={r[r-1]r[r-2]...r[1]r[0]}, use remainder R as sequence D CRC code, generate the sending sequence M={d[k-1]d[k-2]...d[1]d[0]r[r-1]r[r-2]...r[1] r[0]}.

实际应用中,CRC的实现方法有串行计算和并行计算。串行计算电路由线性反馈移位寄存器和异或运算逻辑组成。特点为:逐位计算,每个时钟周期输入1比特信息码。经过k个时钟周期,得到CRC码。以CRC-32为例说明,串行计算电路如图1所示。In practical applications, the implementation methods of CRC include serial computing and parallel computing. The serial calculation circuit is composed of a linear feedback shift register and an XOR operation logic. Features: bit by bit calculation, input 1 bit information code per clock cycle. After k clock cycles, the CRC code is obtained. Taking CRC-32 as an example, the serial computing circuit is shown in Figure 1.

典型并行计算电路由异或运算逻辑和CRC寄存器反馈电路组成。特点为将信息码划分为长为n(1≤n≤k)比特的若干数据块,每个时钟周期输入n比特信息码。根据串行计算方法中各线性反馈移位寄存器与输入信息码的变化关系推导出的逻辑关系式,每次计算n比特信息码的CRC码,通过个时钟周期计算得到整个待发送信息码的最终CRC码。缺点为CRC计算电路的计算宽度固定。当要支特任意长信息码的CRC计算时,需要n路CRC并行计算逻辑。如图2为典型CRC并行计算电路结构。A typical parallel computing circuit is composed of XOR operation logic and CRC register feedback circuit. It is characterized by dividing the information code into several data blocks with a length of n (1≤n≤k) bits, and inputting n-bit information codes in each clock cycle. According to the logical relational expression deduced from the change relationship between each linear feedback shift register and the input information code in the serial calculation method, the CRC code of the n-bit information code is calculated each time, by The final CRC code of the entire to-be-sent information code is calculated in clock cycles. The disadvantage is that the calculation width of the CRC calculation circuit is fixed. When it is necessary to support CRC calculation of arbitrary length information codes, n-way CRC parallel calculation logic is required. Figure 2 is a typical CRC parallel computing circuit structure.

但是现有技术中,CRC串行计算为每次只能计算1比特信息码,效率低,无法满足高速率数据传送的CRC生成、校验处理。虽然CRC并行计算速度快,但现有技术的并行计算中对应不同的逻辑关系式而位宽n也不同,则一路CRC并行计算逻辑的固定计算位宽,无法应用于其它位宽的CRC并行计算。例如,n位并行电路计算k位信息码的CRC码,必须满足条件:k能整除n,即(k%n=0)。若不满足整除条件,则最后一次计算输入的信息码位宽为(k%n),范围为(1~n-1),n位并行计算的逻辑电路无法计算最终CRC码。因此,计算任意长信息码的CRC码,则需要n套并行位宽分别为(1~n)的逻辑电路。但是,随着数据传送速率的不断提高,CRC并行计算位宽也不断增加。当计算位宽n较大时资源消耗非常大,并且不同计算位宽的逻辑电路间的切换控制电路也越来越复杂。However, in the prior art, the CRC serial calculation can only calculate 1-bit information code each time, which is inefficient and cannot meet the requirements of CRC generation and verification processing for high-speed data transmission. Although the CRC parallel calculation speed is fast, the parallel calculation of the prior art corresponds to different logical relations and the bit width n is also different, so the fixed calculation bit width of one CRC parallel calculation logic cannot be applied to CRC parallel calculations of other bit widths . For example, if an n-bit parallel circuit calculates the CRC code of a k-bit information code, the condition must be met: k can be divisible by n, that is (k%n=0). If the divisibility condition is not satisfied, the information code bit width of the last calculation input is (k%n), and the range is (1~n-1), and the n-bit parallel calculation logic circuit cannot calculate the final CRC code. Therefore, to calculate the CRC code of any long information code, n sets of logic circuits with parallel bit widths of (1~n) are required. However, with the continuous improvement of the data transfer rate, the CRC parallel calculation bit width is also increasing. When the calculation bit width n is large, the resource consumption is very large, and the switching control circuit between logic circuits with different calculation bit widths becomes more and more complicated.

发明内容Contents of the invention

本发明的主要目的是提供一种循环冗余校验CRC码的实现方法及装置,旨在使得校验CRC码实现过程中,既占用更少的资源,又提高了其性能。The main purpose of the present invention is to provide a method and device for realizing a cyclic redundancy check CRC code, aiming at making the process of implementing the check CRC code occupy less resources and improve its performance.

本发明提供了一种循环冗余校验CRC码的实现方法,包括以下步骤:The present invention provides a kind of implementation method of cyclic redundancy check CRC code, comprises the following steps:

根据CRC并行计算电路最大并行计算位宽和本次并行计算位宽,将并行输入的信息码进行整形处理,获得数据块;According to the maximum parallel computing bit width of the CRC parallel computing circuit and the current parallel computing bit width, the parallel input information codes are reshaped to obtain data blocks;

根据CRC并行计算电路最大并行计算位宽或者本次并行计算位宽对应的CRC并行计算逻辑关系式,从所述数据块中选出有效数据位;Select valid data bits from the data block according to the maximum parallel computing bit width of the CRC parallel computing circuit or the CRC parallel computing logical relationship corresponding to the parallel computing bit width this time;

从上一次CRC并行计算获得的CRC码中选择当前有效CRC寄存器位;Select the current effective CRC register bit from the CRC code obtained by the last CRC parallel calculation;

将所述有效数据位及所述当前有效CRC寄存器位进行至少一次异或运算,获得新的CRC码;Perform at least one XOR operation on the valid data bits and the current valid CRC register bits to obtain a new CRC code;

上述整形处理包括:The above plastic processing includes:

根据CRC并行计算电路最大并行计算位宽和本次并行计算位宽,对并行输入信息码高位进行补零或清零操作,将并行输入的信息码整形为n比特的{(n-Vn)’b0,d[Vn-1:0]}数据块,其中n为最大并行计算位宽,Vn为本次并行计算位宽。According to the maximum parallel computing bit width of the CRC parallel computing circuit and the current parallel computing bit width, the high bits of the parallel input information code are zero-filled or cleared, and the parallel input information code is shaped into n-bit {(n-Vn)' b0, d[Vn-1:0]} data block, where n is the maximum parallel computing bit width, and Vn is the current parallel computing bit width.

优选地,当并行输入信息码位宽等于最大并行计算位宽n时,整形处理也可以直接对并行输入信息码进行透传,则整形后的数据块仍为输入的信息码。Preferably, when the bit width of the parallel input information code is equal to the maximum parallel computing bit width n, the shaping process can also directly transparently transmit the parallel input information code, and the shaped data block is still the input information code.

优选地,上述从上一次CRC并行计算获得的CRC码中选择当前有效CRC寄存器位的步骤具体为:Preferably, the above-mentioned step of selecting the current effective CRC register bit from the CRC code obtained by the last CRC parallel calculation is specifically:

根据本次并行计算位宽所对应的寄存器位系数,从上一次CRC并行计算获得的CRC码中选择当前有效CRC寄存器位。According to the register bit coefficient corresponding to the bit width of this parallel calculation, the current effective CRC register bit is selected from the CRC code obtained by the previous CRC parallel calculation.

优选地,上述将所述有效数据位及所述当前有效CRC寄存器位进行至少一次异或运算,获得新的CRC码的步骤之后还包括:Preferably, the above-mentioned valid data bits and the current valid CRC register bits are subjected to at least one XOR operation, and the step of obtaining a new CRC code further includes:

判断所述并行输入的信息码是否为最后一次数据输入,是则将所述新的CRC码记为最终的CRC码;否则返回执行对并行输入的信息码进行预处理,并获得其有效数据位的步骤。Judging whether the information code input in parallel is the last data input, if so, record the new CRC code as the final CRC code; otherwise return to perform preprocessing on the information code input in parallel, and obtain its valid data bits A step of.

本发明还提供了一种循环冗余校验CRC码的实现装置,包括:The present invention also provides a device for implementing a cyclic redundancy check (CRC) code, comprising:

整形单元,用于根据CRC并行计算电路最大并行计算位宽和本次并行计算位宽,将并行输入的信息码进行整形处理,获得数据块;The shaping unit is used to perform shaping processing on the information code input in parallel according to the maximum parallel computing bit width of the CRC parallel computing circuit and the current parallel computing bit width to obtain a data block;

选择单元,用于根据CRC并行计算电路最大并行计算位宽或者根据本次并行计算位宽对应的CRC并行计算逻辑关系式,从所述数据块中选出有效数据位;The selection unit is used to select valid data bits from the data block according to the maximum parallel computing bit width of the CRC parallel computing circuit or according to the CRC parallel computing logic relation corresponding to the parallel computing bit width of this time;

CRC寄存器反馈选择模块,用于从上一次CRC并行计算获得的CRC码中选择当前有效CRC寄存器位;The CRC register feedback selection module is used to select the current effective CRC register bit from the CRC code obtained by the last CRC parallel calculation;

异或运算模块,用于将所述有效数据位及所述当前有效CRC寄存器位进行至少一次异或运算,获得新的CRC码;An XOR operation module, configured to perform at least one XOR operation on the effective data bits and the current effective CRC register bits to obtain a new CRC code;

上述整形单元进行整形处理具体为:The shaping processing performed by the above-mentioned shaping unit is specifically as follows:

根据CRC并行计算电路最大并行计算位宽和本次并行计算位宽,对并行输入信息码高位进行补零或清零操作,将并行输入的信息码整形为n比特的{(n-Vn)’b0,d[Vn-1:0]}数据块,其中n为最大并行计算位宽,Vn为本次并行计算位宽。According to the maximum parallel computing bit width of the CRC parallel computing circuit and the current parallel computing bit width, the high bits of the parallel input information code are zero-filled or cleared, and the parallel input information code is shaped into n-bit {(n-Vn)' b0, d[Vn-1:0]} data block, where n is the maximum parallel computing bit width, and Vn is the current parallel computing bit width.

优选地,当并行输入信息码位宽等于电路最大并行计算位宽时,整形处理也可以直接对并行输入信息码进行透传,则整形后的数据块仍为输入的信息码。Preferably, when the bit width of the parallel input information code is equal to the maximum parallel calculation bit width of the circuit, the shaping process can also directly transparently transmit the parallel input information code, and the shaped data block is still the input information code.

优选地,上述CRC寄存器反馈选择模块具体用于:根据本次需要计算位宽所对应的寄存器位系数,从上一次CRC并行计算获得的CRC码中选择当前有效CRC寄存器位。Preferably, the above-mentioned CRC register feedback selection module is specifically configured to: select the currently effective CRC register bit from the CRC code obtained by the previous CRC parallel calculation according to the register bit coefficient corresponding to the bit width required for this current calculation.

优选地,上述循环冗余校验CRC码的实现装置还包括:Preferably, the implementation device of the above-mentioned cyclic redundancy check CRC code also includes:

循环模块,用于判断所述并行输入的信息码是否为最后一次数据输入,是则将所述新的CRC码记为最终的CRC码;否则返回执行对并行输入的信息码进行预处理,并获得其有效数据位的步骤。The loop module is used to judge whether the information code input in parallel is the last data input, if so, record the new CRC code as the final CRC code; otherwise return to execute the preprocessing of the information code input in parallel, and Steps to get its valid data bits.

本发明循环冗余校验CRC码的实现方法及装置,通过数据位预处理和CRC寄存器位反馈处理,达到了可进行任意位宽信息码的并行CRC处理的效果,从而解决了现有技术串行电路每个时钟周期只能计算一位信息码,而并行电路计算位宽固定、逻辑大、控制复杂的问题。而且,本发明还能够提高CRC生成、校验系统的运算性能,在满足高速CRC数据处理需求下,大大节省了逻辑资源,降低了实现成本,提高了灵活性、兼容性。The implementation method and device of the cyclic redundancy check CRC code of the present invention, through data bit preprocessing and CRC register bit feedback processing, achieve the effect of parallel CRC processing of any bit width information code, thereby solving the problem of the prior art string The row circuit can only calculate one bit of information code per clock cycle, while the parallel circuit calculates the problem of fixed bit width, large logic, and complex control. Moreover, the present invention can also improve the computing performance of the CRC generation and verification system, greatly save logic resources, reduce implementation costs, and improve flexibility and compatibility while meeting the requirements of high-speed CRC data processing.

附图说明Description of drawings

图1是现有技术中CRC码的串行计算电路的结构示意图;Fig. 1 is the structural representation of the serial computing circuit of CRC code in the prior art;

图2是现有技术中CRC码的典型并行计算电路的结构示意图;Fig. 2 is the structural representation of the typical parallel computing circuit of CRC code in the prior art;

图3是本发明循环冗余校验CRC码的实现方法一实施例的流程示意图;Fig. 3 is a schematic flow chart of an embodiment of an implementation method of a cyclic redundancy check (CRC) code in the present invention;

图4是本发明循环冗余校验CRC码的实现方法中数据位预处理的流程示意图;Fig. 4 is the schematic flow chart of data bit pretreatment in the implementation method of cyclic redundancy check CRC code of the present invention;

图5是本发明循环冗余校验CRC码的实现方法另一实施例的流程示意图;Fig. 5 is a schematic flow chart of another embodiment of the implementation method of the cyclic redundancy check CRC code of the present invention;

图6是本发明循环冗余校验CRC码的实现装置一实施例的结构示意图;Fig. 6 is a structural schematic diagram of an embodiment of a device for implementing a cyclic redundancy check (CRC) code in the present invention;

图7是本发明循环冗余校验CRC码的实现装置一实施例中数据位预处理模块的结构示意图;FIG. 7 is a schematic structural diagram of a data bit preprocessing module in an embodiment of a device for implementing a cyclic redundancy check (CRC) code in the present invention;

图8是本发明循环冗余校验CRC码的实现装置另一实施例的结构示意图。FIG. 8 is a schematic structural diagram of another embodiment of a device for implementing a cyclic redundancy check (CRC) code according to the present invention.

本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization of the purpose of the present invention, functional characteristics and advantages will be further described in conjunction with the embodiments and with reference to the accompanying drawings.

具体实施方式Detailed ways

以下结合说明书附图及具体实施例进一步说明本发明的技术方案。The technical solutions of the present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

本发明提供了一种循环冗余校验CRC码的实现方法及装置,可以支持任意计算位宽的信息码的CRC码计算。The invention provides a method and device for realizing a cyclic redundancy check CRC code, which can support the calculation of the CRC code of an information code with arbitrary calculation bit width.

图3是本发明循环冗余校验CRC码的实现方法一实施例的流程示意图。FIG. 3 is a schematic flowchart of an embodiment of a method for implementing a cyclic redundancy check (CRC) code in the present invention.

本实施例循环冗余校验CRC码的实现方法,包括以下步骤:The implementation method of the cyclic redundancy check CRC code of the present embodiment comprises the following steps:

步骤S10、对并行输入的信息码进行预处理,并获得其有效数据位;Step S10, preprocessing the information code input in parallel, and obtaining its effective data bits;

步骤S11、从上一次CRC并行计算获得的CRC码中选择当前有效CRC寄存器位;Step S11, selecting the current effective CRC register bit from the CRC code obtained by the previous CRC parallel calculation;

步骤S12、将所述有效数据位及所述当前有效CRC寄存器位进行至少一次异或运算,获得新的CRC码。Step S12 , performing at least one XOR operation on the valid data bits and the current valid CRC register bits to obtain a new CRC code.

本实施例循环冗余校验CRC码的实现方法,通过数据位预处理和CRC寄存器位反馈处理,达到了可进行任意位宽信息码的并行CRC处理的效果,从而解决了现有技术串行电路每个时钟周期只能计算一位信息码,而并行电路计算位宽固定、逻辑大、控制复杂的问题。而且,本发明还能够提高CRC生成、校验系统的运算性能,在满足高速CRC数据处理需求下,大大节省了逻辑资源,降低了实现成本,提高了灵活性、兼容性。The implementation method of the cyclic redundancy check CRC code in this embodiment, through data bit preprocessing and CRC register bit feedback processing, has achieved the effect of parallel CRC processing of arbitrary bit width information codes, thereby solving the problem of prior art serial The circuit can only calculate one bit of information code per clock cycle, while the parallel circuit calculates the problem of fixed bit width, large logic, and complex control. Moreover, the present invention can also improve the computing performance of the CRC generation and verification system, greatly save logic resources, reduce implementation costs, and improve flexibility and compatibility while meeting the requirements of high-speed CRC data processing.

参照图4,上述步骤S10具体包括:With reference to Fig. 4, above-mentioned step S10 specifically comprises:

步骤S101、根据CRC并行计算电路最大并行计算位宽和本次并行计算位宽,将并行输入的信息码进行整形处理,获得数据块;Step S101, according to the maximum parallel computing bit width of the CRC parallel computing circuit and the current parallel computing bit width, perform shaping processing on the information code input in parallel to obtain a data block;

假设,信息码序列为d[k-1:0],且当次需要计算Vn比特信息码的CRC码,则当次输入信息码为d[Vn-1:0],将d[Vn-1:0]整形为位宽等于CRC并行计算电路最大计算位宽n的数据块。该数据块结构为低Vn比特为本次输入信息码,高(n-Vn)比特为0,即{(n-Vn)’b0,d[Vn-1:0]}。Assuming that the information code sequence is d[k-1:0], and the CRC code of the Vn-bit information code needs to be calculated at this time, then the current input information code is d[Vn-1:0], and d[Vn-1 :0] is shaped into a data block whose bit width is equal to the maximum computing bit width n of the CRC parallel computing circuit. The data block structure is that the low Vn bit is the input information code, and the high (n-Vn) bit is 0, that is, {(n-Vn)’b0, d[Vn-1:0]}.

步骤S102、根据CRC并行计算电路并行计算位宽或者本次并行计算位宽对应的逻辑关系式,从数据块{(n-Vn)’b0,d[Vn-1:0]}选出有效数据位。Step S102, according to the parallel calculation bit width of the CRC parallel calculation circuit or the logical relational expression corresponding to the parallel calculation bit width this time, select valid data from the data block {(n-Vn)'b0, d[Vn-1:0]} bit.

上述整形处理主要包括以下两种实现方法:The above shaping processing mainly includes the following two implementation methods:

第一种、若数据输入位宽为变化值,根据本次并行计算位宽Vn,对高位进行补零或清零操作,将并行输入的信息码整形为n比特的{(n-Vn)’b0,d[Vn-1:0]}数据块,其中n为电路最大并行计算位宽,Vn为本次并行计算位宽;然后,根据最大计算位宽对应的数据位系数d_dex_n[n-1:0]从整形后的数据块中选择有效数据位。实现中选择单元可用选择器直接选出当前有效CRC寄存器位,也可将c_dex_Vn[r-1:0]作为滤波器系数,与crc[r-1:0]进行点乘运算,或者其它方式最终选出当前有效CRC寄存器位。The first type, if the data input bit width is a variable value, according to this parallel calculation bit width Vn, perform zero padding or clearing operations on the high bits, and reshape the parallel input information code into n-bit {(n-Vn)' b0, d[Vn-1:0]} data block, where n is the maximum parallel computing bit width of the circuit, and Vn is the parallel computing bit width of this time; then, according to the data bit coefficient d_dex_n[n-1 corresponding to the maximum computing bit width :0] Select valid data bits from the shaped data block. In the implementation, the selection unit can use the selector to directly select the current effective CRC register bit, or use c_dex_Vn[r-1:0] as the filter coefficient, do the dot multiplication operation with crc[r-1:0], or other methods to finally Selects the currently valid CRC register bit.

第二种、若数据输入位宽等于电路最大并行计算位宽n,而当次计算位宽为Vn,则输入信息码也可以不进行补零或清零操作,直接作透传,整形后的数据块仍为输入的信息码d[n-1:0];则根据当次计算位宽Vn对应的数据位系数d_dex_Vn[n-1:0]从整形后的数据块中选择有效数据位。The second type, if the data input bit width is equal to the maximum parallel calculation bit width n of the circuit, and the current calculation bit width is Vn, then the input information code can also be directly transparently transmitted without padding or clearing operations, and the reshaped The data block is still the input information code d[n-1:0]; then select valid data bits from the reshaped data block according to the data bit coefficient d_dex_Vn[n-1:0] corresponding to the calculated bit width Vn.

当然,若数据输入位宽为其他情况时,也可以通过其他方法将输入信息码整形为{(n-Vn)’b0,d[Vn-1:0]}数据块,并根据最大计算位宽对应的数据位系数选择有效数据位。若输入信息码进行透传方式的整形处理,则根据当次计算位宽Vn对应的数据位系数选择有效数据位。Of course, if the data input bit width is other cases, other methods can also be used to shape the input information code into {(n-Vn)'b0, d[Vn-1:0]} data blocks, and calculate the bit width according to the maximum The corresponding data bit coefficient selects valid data bits. If the input information code is subjected to shaping processing in the transparent transmission mode, effective data bits are selected according to the data bit coefficient corresponding to the current calculated bit width Vn.

上述步骤S11具体为:根据本次计算位宽Vn对应的寄存器位系数c_dex_Vn[r-1:0],从上一输入数据的CRC计算结果的r位CRC码crc[r-1:0]中选出参与本次计算的当前有效CRC寄存器位。实现中选择单元可用选择器直接选出当前有效CRC寄存器位,也可将c_dex_Vn[r-1:0]作为滤波器系数,与crc[r-1:0]进行点乘运算,或者其它方式最终选出当前有效CRC寄存器位。The above step S11 is specifically: according to the register bit coefficient c_dex_Vn[r-1:0] corresponding to the bit width Vn of this calculation, from the r-bit CRC code crc[r-1:0] of the CRC calculation result of the last input data Select the currently valid CRC register bits involved in this calculation. In the implementation, the selection unit can use the selector to directly select the current effective CRC register bit, or use c_dex_Vn[r-1:0] as the filter coefficient, do the dot multiplication operation with crc[r-1:0], or other methods to finally Selects the currently valid CRC register bit.

上述步骤S12中,将上述有效数据位与上述当前有效CRC寄存器位进行至少一次异或运算,获得新的CRC码,并且将该新的CRC码更新至CRC寄存器。本实施例中,可以将有效数据位和当前有效CRC寄存器位一起进行至少一次异或运算,获得新的CRC码;或者也可以先将有效数据位进行至少一次异或运算,获得有效数据位异或结果,再将该有效数据位异或结果与当前有效CRC寄存器位进行至少一次异或运算,获得新的CRC码。异或运算的次数可以根据具体情况而决定,在此就不做限定。In the above step S12, at least one XOR operation is performed on the valid data bits and the current valid CRC register bits to obtain a new CRC code, and the new CRC code is updated to the CRC register. In this embodiment, the valid data bits and the current effective CRC register bits can be XORed at least once to obtain a new CRC code; or the valid data bits can be firstly XORed at least once to obtain the valid data bits XOR or the result, and then at least one XOR operation is performed on the effective data bit XOR result and the current effective CRC register bit to obtain a new CRC code. The number of XOR operations can be determined according to specific situations, and is not limited here.

图5是本发明循环冗余校验CRC码的实现方法另一实施例的流程示意图。Fig. 5 is a schematic flowchart of another embodiment of the method for implementing a cyclic redundancy check (CRC) code according to the present invention.

在上述实施例的基础上,本实施例循环冗余校验CRC码的实现方法在上述步骤S12之后还包括:On the basis of the above-mentioned embodiments, the implementation method of the cyclic redundancy check CRC code in this embodiment also includes after the above-mentioned step S12:

步骤S13、判断上述并行输入的信息码是否为最后一次数据输入,是则执行步骤S14;否则返回执行步骤S10;Step S13, judging whether the information code input in parallel is the last data input, if yes, execute step S14; otherwise, return to execute step S10;

步骤S14、将上述新的CRC码记为最终的CRC码,并结束流程。Step S14, record the above-mentioned new CRC code as the final CRC code, and end the process.

当判断上述并行输入的信息码不是最后一次数据输入时,返回执行步骤S10,循环进行CRC并行计算,直到当数据输入结束后,再将获得的CRC码记为最终的CRC码。When it is judged that the information code input in parallel is not the last data input, return to step S10 and perform CRC parallel calculation in a loop until the data input is completed, and then record the obtained CRC code as the final CRC code.

图6是本发明循环冗余校验CRC码的实现装置一实施例的结构示意图。FIG. 6 is a schematic structural diagram of an embodiment of a device for implementing a cyclic redundancy check (CRC) code according to the present invention.

本实施例循环冗余校验CRC码的实现装置,包括:The implementation device of the cyclic redundancy check CRC code in this embodiment includes:

数据位预处理模块10,用于对并行输入的信息码进行预处理,并获得其有效数据位;Data bit preprocessing module 10, used to preprocess the information codes input in parallel, and obtain its effective data bits;

CRC寄存器反馈选择模块11,用于从上一次CRC并行计算获得的CRC码中选择当前有效CRC寄存器位;The CRC register feedback selection module 11 is used to select the current effective CRC register bit from the CRC code obtained by the last CRC parallel calculation;

异或运算模块12,用于将所述有效数据位及所述当前有效CRC寄存器位进行至少一次异或运算,获得新的CRC码。The XOR operation module 12 is configured to perform at least one XOR operation on the effective data bits and the current effective CRC register bits to obtain a new CRC code.

参照图7,上述数据位预处理模块10具体包括:With reference to Fig. 7, above-mentioned data bit preprocessing module 10 specifically comprises:

整形单元101,用于根据CRC并行计算电路最大并行计算位宽和本次并行计算位宽,将并行输入的信息码进行整形处理,获得数据块;The shaping unit 101 is used to perform shaping processing on the information code input in parallel according to the maximum parallel computing bit width of the CRC parallel computing circuit and the current parallel computing bit width to obtain a data block;

选择单元102,用于根据CRC并行计算电路最大计算位宽或者本次并行计算位宽对应的CRC并行计算逻辑关系式,从数据块中选出有效数据位。The selection unit 102 is configured to select valid data bits from the data block according to the maximum calculation bit width of the CRC parallel calculation circuit or the CRC parallel calculation logic relation corresponding to the current parallel calculation bit width.

假设,信息码序列为d[k-1:0],且当次需要计算Vn比特信息码的CRC码,则当次输入信息码为d[Vn-1:0],整形单元101将d[Vn-1:0]整形为位宽等于CRC并行计算电路最大计算位宽n的数据块。该数据块结构为低Vn比特为本次输入信息码,高(n-Vn)比特为0,即{(n-Vn)’b0,d[Vn-1:0]}。选择单元102再根据最大计算位宽n对应的CRC并行计算逻辑关系式的数据位系数d_dex_n[n-1:0]从整形后的n比特数据块{(n-Vn)’b0,d[Vn-1:0]}中选出参与异或计算的有效数据位。另一种方法,若输入信息码位宽等于电路最大并行计算位宽,输入信息码为d[n-1:0],整形单元101透传输入信息码,即整形后的数据块为d[n-1:0]。选择单元102再根据当次计算位宽Vn对应的CRC并行计算逻辑关系式的数据位系数d_dex_Vn[n-1:0]从d[n-1:0]中选出参与异或计算的有效数据位。Suppose, the information code sequence is d[k-1:0], and when the CRC code of the Vn bit information code needs to be calculated, then the current input information code is d[Vn-1:0], and the shaping unit 101 converts d[ Vn-1:0] is shaped into a data block whose bit width is equal to the maximum computing bit width n of the CRC parallel computing circuit. The data block structure is that the low Vn bit is the input information code, and the high (n-Vn) bit is 0, that is, {(n-Vn)’b0, d[Vn-1:0]}. The selection unit 102 then calculates the data bit coefficient d_dex_n[n-1:0] of the CRC parallel calculation logic relation corresponding to the maximum calculation bit width n from the shaped n-bit data block {(n-Vn)'b0, d[Vn -1:0]} to select valid data bits involved in XOR calculation. In another method, if the bit width of the input information code is equal to the maximum parallel computing bit width of the circuit, the input information code is d[n-1:0], and the shaping unit 101 transparently transmits the input information code, that is, the shaped data block is d[ n-1:0]. The selection unit 102 selects valid data from d[n-1:0] to participate in the XOR calculation according to the data bit coefficient d_dex_Vn[n-1:0] of the CRC parallel calculation logic relation corresponding to the current calculation bit width Vn bit.

上述整形单元101进行整形处理主要包括以下两种实现方法:The shaping processing performed by the shaping unit 101 mainly includes the following two implementation methods:

第一种、若数据输入位宽为变化值,根据本次并行计算位宽Vn,对高位进行补零或清零操作,将并行输入的信息码整形为n比特的{(n-Vn)’b0,d[Vn-1:0]}数据块,其中n为CRC并行计算电路最大计算位宽,Vn为本次并行计算位宽;然后,根据最大计算位宽对应的数据位系数d_dex_n从整形后的数据块中选择有效数据位。实现中选择单元可用选择器直接选出当前有效CRC寄存器位,也可将c_dex_Vn[r-1:0]作为滤波器系数,与crc[r-1:0]进行点乘运算,或者其它方式最终选出当前有效CRC寄存器位。The first type, if the data input bit width is a variable value, according to this parallel calculation bit width Vn, perform zero padding or clearing operations on the high bits, and reshape the parallel input information code into n-bit {(n-Vn)' b0, d[Vn-1:0]} data block, where n is the maximum computing bit width of the CRC parallel computing circuit, and Vn is the parallel computing bit width of this time; then, according to the data bit coefficient d_dex_n corresponding to the maximum computing bit width, it is reshaped Select valid data bits in subsequent data blocks. In the implementation, the selection unit can use the selector to directly select the current effective CRC register bit, or use c_dex_Vn[r-1:0] as the filter coefficient, do the dot multiplication operation with crc[r-1:0], or other methods to finally Selects the currently valid CRC register bit.

第二种、若数据输入位宽等于电路最大并行计算位宽n,而当次计算位宽为Vn,则输入信息码不进行补零或清零操作,直接作透传,整形后的数据块仍为输入的信息码d[n-1:0];则根据当次计算位宽Vn对应的数据位系数d_dex_Vn[n-1:0]从整形后的数据块中选择有效数据位。The second type, if the data input bit width is equal to the maximum parallel calculation bit width n of the circuit, and the current calculation bit width is Vn, then the input information code does not perform zero padding or zero clearing operations, and is directly transparently transmitted, and the shaped data block It is still the input information code d[n-1:0]; then select valid data bits from the reshaped data block according to the data bit coefficient d_dex_Vn[n-1:0] corresponding to the current calculated bit width Vn.

当然,若数据输入位宽为其他情况时,也可以通过其他方法将输入信息码整形为{(n-Vn)’b0,d[Vn-1:0]}数据块,并根据最大计算位宽对应的数据位系数选择有效数据位。若输入信息码进行透传方式的整形处理,则根据当次计算位宽Vn对应的数据位系数选择有效数据位。Of course, if the data input bit width is other cases, other methods can also be used to shape the input information code into {(n-Vn)'b0, d[Vn-1:0]} data blocks, and calculate the bit width according to the maximum The corresponding data bit coefficient selects valid data bits. If the input information code is subjected to shaping processing in the transparent transmission mode, effective data bits are selected according to the data bit coefficient corresponding to the current calculated bit width Vn.

由于计算位宽为n时参与异或运算的有效数据比特包含了计算位宽为(1~n-1)时的所有有效数据比特。计算位宽为Vn(Vn≤n)时的数据位系数为计算位宽为n时的数据位系数的低Vn比特。即d_dex_n[n-1:0]={(n-Vn)’b0,d_dex_Vn[Vn-1:0]}。因此,d_dex_Vn的不同值可由最大计算位宽对应的数据位系数d_dex_n根据Vn获得,则数据位预处理模块10在数据处理过程中,只需保存d_dex_n值,而不用保存所有n个不同数据位系数d_dex_Vn,从而节省了存储空间。Since the valid data bits participating in the XOR operation when the calculation bit width is n include all valid data bits when the calculation bit width is (1˜n−1). The data bit coefficient when the calculation bit width is Vn (Vn≤n) is the low Vn bit of the data bit coefficient when the calculation bit width is n. That is, d_dex_n[n-1:0]={(n-Vn)'b0,d_dex_Vn[Vn-1:0]}. Therefore, the different values of d_dex_Vn can be obtained from the data bit coefficient d_dex_n corresponding to the maximum calculation bit width according to Vn, then the data bit preprocessing module 10 only needs to save the d_dex_n value during the data processing process, instead of saving all n different data bit coefficients d_dex_Vn, thus saving storage space.

CRC寄存器反馈选择模块11可以通过选择器直接选出其当前有效CRC寄存器位,也可通过将c_dex_Vn[r-1:0]作为滤波器系数,与crc[r-1:0]进行点乘运算,或者其它方式最终选出当前有效CRC寄存器位。另外,由于计算位宽n大于等于CRC寄存器位宽r时,CRC寄存器位系数c_dex[r-1:0]等于数据位系数d_dex[n-1:0]的最高r比特,即c_dex[r-1:0]=d_dex[n-1:n-r]。计算位宽n小于CRC寄存器位宽r时,CRC寄存器位系数c_dex[r-1:0]等于n比特数据位系数补上(r-n)比特0,即c_dex[r-1:0]={d_dex[n-1:0],(r-n)’b0}。因此,c_dex_Vn的不同值可由最大计算位宽对应的数据位系数d_dex_n根据Vn值得到,则CRC寄存器反馈选择模块11在处理过程中只需保存d_dex_n值,无需保存所有n个不同寄存器位系数c_dex_Vn,进一步节省了存储空间。The CRC register feedback selection module 11 can directly select its current effective CRC register bit through the selector, and can also perform dot multiplication operation with crc[r-1:0] by using c_dex_Vn[r-1:0] as the filter coefficient , or other methods to finally select the current effective CRC register bit. In addition, since the calculation bit width n is greater than or equal to the CRC register bit width r, the CRC register bit coefficient c_dex[r-1:0] is equal to the highest r bits of the data bit coefficient d_dex[n-1:0], that is, c_dex[r- 1:0]=d_dex[n-1:n-r]. When the calculation bit width n is smaller than the CRC register bit width r, the CRC register bit coefficient c_dex[r-1:0] is equal to the n-bit data bit coefficient plus (r-n) bit 0, that is, c_dex[r-1:0]={d_dex [n-1:0], (r-n)'b0}. Therefore, the different values of c_dex_Vn can be obtained from the data bit coefficient d_dex_n corresponding to the maximum calculation bit width according to the Vn value, then the CRC register feedback selection module 11 only needs to save the value of d_dex_n during the processing, without saving all n different register bit coefficients c_dex_Vn, Further save storage space.

异或运算模块12可以通过直接异或或者其他异或逻辑方法实现,将上述有效数据位与上述当前有效CRC寄存器位进行至少一次异或运算,获得新的CRC码,并且将该新的CRC码更新至CRC寄存器。本实施例中,可以将有效数据位和当前有效CRC寄存器位一起进行至少一次异或运算,获得新的CRC码;或者也可以先将有效数据位进行至少一次异或运算,获得有效数据位异或结果,再将该有效数据位异或结果与当前有效CRC寄存器位进行至少一次异或运算,获得新的CRC码。异或运算的次数可以根据具体情况而决定,在此就不做限定。The XOR operation module 12 can be realized by direct XOR or other XOR logic methods, and performs at least one XOR operation with the above-mentioned effective data bit and the above-mentioned current effective CRC register bit to obtain a new CRC code, and the new CRC code Update to CRC register. In this embodiment, the valid data bits and the current effective CRC register bits can be XORed at least once to obtain a new CRC code; or the valid data bits can be firstly XORed at least once to obtain the valid data bits XOR or the result, and then at least one XOR operation is performed on the effective data bit XOR result and the current effective CRC register bit to obtain a new CRC code. The number of XOR operations can be determined according to specific situations, and is not limited here.

本实施例循环冗余校验CRC码的实现装置,通过数据位预处理模块10和CRC寄存器位反馈选择模块11的处理,达到了可进行任意位宽信息码的并行CRC处理的效果,从而解决了现有技术串行电路每个时钟周期只能计算一位信息码,而并行电路计算位宽固定、逻辑大、控制复杂的问题。而且,本发明还能够提高CRC生成、校验系统的运算性能,在满足高速CRC数据处理需求下,大大节省了逻辑资源,降低了实现成本,提高了灵活性、兼容性。The implementation device of the cyclic redundancy check CRC code in this embodiment, through the processing of the data bit preprocessing module 10 and the CRC register bit feedback selection module 11, can achieve the effect of parallel CRC processing of any bit width information code, thereby solving the problem of The serial circuit in the prior art can only calculate one bit of information code per clock cycle, while the parallel circuit calculates the problem of fixed bit width, large logic and complex control. Moreover, the present invention can also improve the computing performance of the CRC generation and verification system, greatly save logic resources, reduce implementation costs, and improve flexibility and compatibility while meeting the requirements of high-speed CRC data processing.

图8是本发明循环冗余校验CRC码的实现装置另一实施例的结构示意图。FIG. 8 is a schematic structural diagram of another embodiment of a device for implementing a cyclic redundancy check (CRC) code according to the present invention.

在上述实施例的基础上,本实施例循环冗余校验CRC码的实现装置,还包括:On the basis of the foregoing embodiments, the implementation device of the cyclic redundancy check CRC code in this embodiment also includes:

循环模块13,用于判断所述并行输入的信息码是否为最后一次数据输入,是则将所述新的CRC码记为最终的CRC码;否则通过数据位预处理模块10执行对并行输入的信息码进行预处理,并获得其有效数据位的步骤。Loop module 13, is used for judging whether the information code of described parallel input is last data input, is then described new CRC code is recorded as final CRC code; Otherwise carries out parallel input by data bit preprocessing module 10 The step of preprocessing the information code and obtaining its valid data bits.

当循环模块13判断上述并行输入的信息码不是最后一次数据输入时,再通过上述数据位预处理模块10,循环进行CRC并行计算,直到当数据输入结束后,再将获得的CRC码记为最终的CRC码。When the loop module 13 judges that the above-mentioned parallel input information code is not the last data input, then through the above-mentioned data bit preprocessing module 10, the CRC parallel calculation is performed in a loop, until after the data input ends, the obtained CRC code is recorded as the final CRC code.

以上所述仅为本发明的优选实施例,并非因此限制其专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above is only a preferred embodiment of the present invention, and does not limit the scope of its patents. Any equivalent structure or equivalent process transformation made by using the description of the present invention and the contents of the accompanying drawings is directly or indirectly used in other related technical fields. All are included in the scope of patent protection of the present invention in the same way.

Claims (8)

1.一种循环冗余校验CRC码的实现方法,其特征在于,包括以下步骤:1. an implementation method of cyclic redundancy check CRC code, is characterized in that, comprises the following steps: 根据CRC并行计算电路最大并行计算位宽和本次并行计算位宽,将并行输入的信息码进行整形处理,获得数据块;According to the maximum parallel computing bit width of the CRC parallel computing circuit and the current parallel computing bit width, the parallel input information codes are reshaped to obtain data blocks; 根据CRC并行计算电路最大并行计算位宽或者本次并行计算位宽对应的CRC并行计算逻辑关系式,从所述数据块中选出有效数据位;Select valid data bits from the data block according to the maximum parallel computing bit width of the CRC parallel computing circuit or the CRC parallel computing logical relationship corresponding to the parallel computing bit width this time; 从上一次CRC并行计算获得的CRC码中选择当前有效CRC寄存器位;Select the current effective CRC register bit from the CRC code obtained by the last CRC parallel calculation; 将所述有效数据位及所述当前有效CRC寄存器位进行至少一次异或运算,获得新的CRC码;Perform at least one XOR operation on the valid data bits and the current valid CRC register bits to obtain a new CRC code; 所述整形处理包括:The shaping process includes: 根据CRC并行计算电路最大并行计算位宽和本次并行计算位宽,对并行输入信息码高位进行补零或清零操作,将并行输入的信息码整形为n比特的{(n-Vn)’b0,d[Vn-1:0]}数据块,将d[Vn-1:0]整形为位宽等于CRC并行计算电路最大计算位宽n的数据块;其中n为最大并行计算位宽,Vn为本次并行计算位宽,(n-Vn)’b0代表高(n-Vn)比特为0,d[Vn-1:0]代表当次输入的信息码。According to the maximum parallel computing bit width of the CRC parallel computing circuit and the current parallel computing bit width, the high bits of the parallel input information code are zero-filled or cleared, and the parallel input information code is shaped into n-bit {(n-Vn)' b0, d[Vn-1:0]} data block, reshape d[Vn-1:0] into a data block whose bit width is equal to the maximum computing bit width n of the CRC parallel computing circuit; where n is the maximum parallel computing bit width, Vn is the bit width of this parallel calculation, (n-Vn)'b0 means that the high (n-Vn) bit is 0, and d[Vn-1:0] means the information code input this time. 2.根据权利要求1所述的方法,其特征在于,当并行输入信息码位宽等于最大并行计算位宽n时,整形处理也可以直接对并行输入信息码进行透传,则整形后的数据块仍为输入的信息码。2. The method according to claim 1, characterized in that, when the parallel input information code bit width is equal to the maximum parallel computing bit width n, the shaping process can also directly transparently transmit the parallel input information code, then the data after shaping The block is still the input information code. 3.根据权利要求1所述的方法,其特征在于,所述从上一次CRC并行计算获得的CRC码中选择当前有效CRC寄存器位的步骤具体为:3. The method according to claim 1, wherein the step of selecting the current effective CRC register bit from the CRC code obtained by the last CRC parallel calculation is specifically: 根据本次并行计算位宽所对应的寄存器位系数,从上一次CRC并行计算获得的CRC码中选择当前有效CRC寄存器位。According to the register bit coefficient corresponding to the bit width of this parallel calculation, the current effective CRC register bit is selected from the CRC code obtained by the previous CRC parallel calculation. 4.根据权利要求1至3中任一项所述的方法,其特征在于,所述将有效数据位及所述当前有效CRC寄存器位进行至少一次异或运算,获得新的CRC码的步骤之后还包括:4. according to the method described in any one in claim 1 to 3, it is characterized in that, described valid data bit and described current valid CRC register bit are carried out at least one XOR operation, after obtaining the step of new CRC code Also includes: 判断所述并行输入的信息码是否为最后一次数据输入,是则将所述新的CRC码记为最终的CRC码;否则返回执行对并行输入的信息码进行预处理,并获得其有效数据位的步骤。Judging whether the information code input in parallel is the last data input, if so, record the new CRC code as the final CRC code; otherwise return to perform preprocessing on the information code input in parallel, and obtain its valid data bits A step of. 5.一种循环冗余校验CRC码的实现装置,其特征在于,包括:5. A realization device of cyclic redundancy check CRC code, is characterized in that, comprises: 整形单元,用于根据CRC并行计算电路最大并行计算位宽和本次并行计算位宽,将并行输入的信息码进行整形处理,获得数据块;The shaping unit is used to perform shaping processing on the information code input in parallel according to the maximum parallel computing bit width of the CRC parallel computing circuit and the current parallel computing bit width to obtain a data block; 选择单元,用于根据CRC并行计算电路最大并行计算位宽或者本次并行计算位宽对应的CRC并行计算逻辑关系式,从所述数据块中选出有效数据位;The selection unit is used to select valid data bits from the data block according to the maximum parallel computing bit width of the CRC parallel computing circuit or the CRC parallel computing logic relation corresponding to the parallel computing bit width of this time; CRC寄存器反馈选择模块,用于从上一次CRC并行计算获得的CRC码中选择当前有效CRC寄存器位;The CRC register feedback selection module is used to select the current effective CRC register bit from the CRC code obtained by the last CRC parallel calculation; 异或运算模块,用于将所述有效数据位及所述当前有效CRC寄存器位进行至少一次异或运算,获得新的CRC码;An XOR operation module, configured to perform at least one XOR operation on the effective data bits and the current effective CRC register bits to obtain a new CRC code; 所述整形单元进行整形处理具体为:The shaping processing performed by the shaping unit is specifically: 根据CRC并行计算电路最大并行计算位宽和本次并行计算位宽,对并行输入信息码高位进行补零或清零操作,将并行输入的信息码整形为n比特的{(n-Vn)’b0,d[Vn-1:0]}数据块,将d[Vn-1:0]整形为位宽等于CRC并行计算电路最大计算位宽n的数据块;其中n为最大并行计算位宽,Vn为本次并行计算位宽,(n-Vn)’b0代表高(n-Vn)比特为0,d[Vn-1:0]代表当次输入的信息码。According to the maximum parallel computing bit width of the CRC parallel computing circuit and the current parallel computing bit width, the high bits of the parallel input information code are zero-filled or cleared, and the parallel input information code is shaped into n-bit {(n-Vn)' b0, d[Vn-1:0]} data block, reshape d[Vn-1:0] into a data block whose bit width is equal to the maximum computing bit width n of the CRC parallel computing circuit; where n is the maximum parallel computing bit width, Vn is the bit width of this parallel calculation, (n-Vn)'b0 means that the high (n-Vn) bit is 0, and d[Vn-1:0] means the information code input this time. 6.根据权利要求5所述的装置,其特征在于,当并行输入信息码位宽等于电路最大并行计算位宽时,整形处理也可以直接对并行输入信息码进行透传,则整形后的数据块仍为输入的信息码。6. The device according to claim 5, wherein when the bit width of the parallel input information code is equal to the maximum parallel computing bit width of the circuit, the shaping process can also directly transparently transmit the parallel input information code, and the shaped data The block is still the input information code. 7.根据权利要求5所述的装置,其特征在于,所述CRC寄存器反馈选择模块具体用于:根据本次需要计算位宽所对应的寄存器位系数,从上一次CRC并行计算获得的CRC码中选择当前有效CRC寄存器位。7. The device according to claim 5, wherein the CRC register feedback selection module is specifically used to: calculate the register bit coefficient corresponding to the bit width according to the needs of this time, and obtain the CRC code obtained from the previous CRC parallel calculation Select the currently valid CRC register bit. 8.根据权利要求5至7中任一项所述的装置,其特征在于,还包括:8. The device according to any one of claims 5 to 7, further comprising: 循环模块,用于判断所述并行输入的信息码是否为最后一次数据输入,是则将所述新的CRC码记为最终的CRC码;否则返回执行对并行输入的信息码进行预处理,并获得其有效数据位的步骤。The loop module is used to judge whether the information code input in parallel is the last data input, if so, record the new CRC code as the final CRC code; otherwise return to execute the preprocessing of the information code input in parallel, and Steps to get its valid data bits.
CN201110000482.7A 2011-01-04 2011-01-04 Method and device for implementing cycle redundancy check (CRC) code Active CN102546089B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110000482.7A CN102546089B (en) 2011-01-04 2011-01-04 Method and device for implementing cycle redundancy check (CRC) code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110000482.7A CN102546089B (en) 2011-01-04 2011-01-04 Method and device for implementing cycle redundancy check (CRC) code

Publications (2)

Publication Number Publication Date
CN102546089A CN102546089A (en) 2012-07-04
CN102546089B true CN102546089B (en) 2014-07-16

Family

ID=46352122

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110000482.7A Active CN102546089B (en) 2011-01-04 2011-01-04 Method and device for implementing cycle redundancy check (CRC) code

Country Status (1)

Country Link
CN (1) CN102546089B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107733568A (en) * 2017-09-22 2018-02-23 烽火通信科技股份有限公司 The method and device of CRC parallel computations is realized based on FPGA

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103297196B (en) * 2013-06-20 2016-09-28 成都国星通信有限公司 A kind of cyclic redundancy check method of non-whole byte data
CN105049057B (en) * 2015-08-17 2018-04-20 中国航天科技集团公司第九研究院第七七一研究所 A kind of 32 checking circuits of CRC towards the input of 128 parallel-by-bits
CN111431541B (en) * 2019-01-09 2023-05-12 电信科学技术研究院有限公司 Method and device for obtaining CRC (cyclic redundancy check) code
CN110188415B (en) * 2019-05-13 2023-05-26 北京遥感设备研究所 Method and system for verifying universal cyclic redundancy check circuit IP (Internet protocol) card
CN110377452A (en) * 2019-07-19 2019-10-25 上海燧原智能科技有限公司 A kind of processing method of cyclic redundancy check data, cyclic redundancy check circuit and storage medium
CN113300716B (en) * 2020-07-14 2025-02-21 阿里巴巴集团控股有限公司 Method, device and computer-readable medium for generating cyclic redundancy check code
CN111897674B (en) * 2020-08-07 2024-07-19 上海富瀚微电子股份有限公司 Cyclic redundancy check circuit IP verification system and method
CN113110954B (en) * 2021-04-23 2023-10-24 恒烁半导体(合肥)股份有限公司 CRC (cyclic redundancy check) code parallel computing method, CRC code parallel computing device and application of CRC code parallel computing device
CN115412204B (en) * 2022-08-31 2023-09-08 深圳云豹智能有限公司 Method, device and storage medium for realizing cyclic redundancy check
CN115801185A (en) * 2022-10-26 2023-03-14 山东云海国创云计算装备产业创新中心有限公司 Chip self-adaptive check retransmission method, system, storage medium and equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1324517A (en) * 1998-08-26 2001-11-28 艾利森电话股份有限公司 Parallet CRC generation circuit for generating a CRC code
CN1679267A (en) * 2002-08-23 2005-10-05 因芬尼昂技术股份公司 Parallel processing of decoding and cyclic redundancy check when receiving mobile radio signals
CN101527615A (en) * 2009-04-07 2009-09-09 华为技术有限公司 Implementation method of cyclic redundancy check (CRC) codes and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB0607976D0 (en) * 2006-04-22 2006-05-31 Univ Belfast Apparatus and method for computing an error detection code

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1324517A (en) * 1998-08-26 2001-11-28 艾利森电话股份有限公司 Parallet CRC generation circuit for generating a CRC code
CN1679267A (en) * 2002-08-23 2005-10-05 因芬尼昂技术股份公司 Parallel processing of decoding and cyclic redundancy check when receiving mobile radio signals
CN101527615A (en) * 2009-04-07 2009-09-09 华为技术有限公司 Implementation method of cyclic redundancy check (CRC) codes and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107733568A (en) * 2017-09-22 2018-02-23 烽火通信科技股份有限公司 The method and device of CRC parallel computations is realized based on FPGA
CN107733568B (en) * 2017-09-22 2020-05-12 烽火通信科技股份有限公司 Method and device for realizing CRC parallel computation based on FPGA

Also Published As

Publication number Publication date
CN102546089A (en) 2012-07-04

Similar Documents

Publication Publication Date Title
CN102546089B (en) Method and device for implementing cycle redundancy check (CRC) code
CN110070178B (en) Convolutional neural network computing device and method
US9071275B2 (en) Method and device for implementing cyclic redundancy check codes
CN101777924B (en) A turbo code decoding method and device
US8989242B2 (en) Encoding/decoding processor and wireless communication apparatus
US8661308B2 (en) Method and device for fast cyclic redundancy check coding
CN103199873B (en) The quickly configuration method of two-stage piecemeal CRC computing
CN101478314A (en) Reed-solomon coder-decoder and decoding method thereof
CN114063973B (en) Galois Field Multiplier and Erasure Codec System
CN107239362A (en) Parallel CRC (Cyclic redundancy check) code calculation method and system
CN112468161B (en) RS high-speed coding circuit
CN102761394A (en) Method and device for processing data
CN102982205A (en) Fixed polarity conversion method for design of digital circuit
CN103336680B (en) Realize the circuit of binary shift left mould algorithm for inversion
CN110620587B (en) Polar code BP decoding unit based on transmission of different data types
CN106788878A (en) A kind of Parallel CRC error correction method with monobit errro correction function
CN105721107B (en) A kind of piecemeal calculates device and method of the CRC to improve clock frequency
CN102130744B (en) Method and device for computing Cyclic Redundancy Check (CRC) code
CN103401566A (en) Parameterization BCH (broadcast channel) error-correcting code parallel encoding method and device
CN100417031C (en) Method of realizing Reed Solomen convolution code in broadband radio insertion system
CN118132035A (en) A multi-mode trigonometric function operation circuit
CN102118225B (en) Coding-decoding method used for any-bit polynomial division type codes based on multi-index table
CN102684710B (en) Viterbi decoding method of tail-biting convolutional code based on SSE (Streaming Simd Extensions)
CN104702293A (en) Dual-mode BCH decoder circuit for body area network
CN105049057B (en) A kind of 32 checking circuits of CRC towards the input of 128 parallel-by-bits

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20151110

Address after: 518057 Nanshan District Guangdong high tech Industrial Park, South Road, science and technology, ZTE building, Ministry of Justice

Patentee after: ZTE Corp.

Patentee after: SANECHIPS TECHNOLOGY Co.,Ltd.

Address before: 518057 Nanshan District Guangdong high tech Industrial Park, South Road, science and technology, ZTE building, Ministry of Justice

Patentee before: ZTE Corp.

TR01 Transfer of patent right

Effective date of registration: 20221201

Address after: 518055 Zhongxing Industrial Park, Liuxian Avenue, Xili street, Nanshan District, Shenzhen City, Guangdong Province

Patentee after: SANECHIPS TECHNOLOGY Co.,Ltd.

Address before: 518057 Ministry of justice, Zhongxing building, South Science and technology road, Nanshan District hi tech Industrial Park, Shenzhen, Guangdong

Patentee before: ZTE Corp.

Patentee before: SANECHIPS TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right