Method of arrangement of an algorithm in cyclic redundancy check

Information

  • Patent Grant
  • 10623018
  • Patent Number
    10,623,018
  • Date Filed
    Wednesday, May 20, 2015
    9 years ago
  • Date Issued
    Tuesday, April 14, 2020
    4 years ago
Abstract
A method of arrangement of an algorithm to calculate cyclic redundancy check (CRC) independent of the length of a polynomial generator and data stream which can be realized in digital implementation with a calculation latency of once clock cycle. The method allows a sequence of information and the corresponding polynomial generator be arranged into a transformation table.
Description
RELATED APPLICATIONS

The present application is a National Phase of International Application Number PCT/SG2015/050119, filed May 20, 2015.


FIELD OF THE INVENTION

The present invention pertains to the field of error correction in digital data processing and, more particularly, to an algorithm for generating system to calculate CRC independent of the length of polynomial generator and data stream.


BACKGROUND OF THE INVENTION

Error correction techniques and architectures are well known in digital data processing and communications systems, including systems having data storage subsystems such as magnetic, optical, or semiconductor based memory stores.


Detection and, where possible, correction of erroneous data has been achieved by using an encoder circuit to construct some number of “redundant” m-bit error check symbol, which mathematically characterize the information in a selected block of data. The error check symbol is then appended to the data block and transferred through a communication channel. When the data block is received, or later retrieved from memory, the accuracy or reliability of the data can be evaluated by use of these appended error check symbol.


Cyclic Redundancy check (CRC) is a classical error detection mechanism that is widely known in the art and used in numerous applications as a means to detect errors from a transmitted stream of information. Its general acceptance is due to the simplicity of implementation by which it can be used to encode into a stream of information to be transmitted and subsequently checked at the receiver.


CRC calculation is performed in polynomial arithmetic, whereby the basis of the algorithm is; that given both transmitter and receiver mutually acknowledge the use of the same polynomial generator, which is essentially a sequence of information used to construct and verify the error check symbol (in the context of CRC, it is also known as checksum) from the data stream, a stream of information (also known as packets or frames) is transmitted, whereby calculation of the error check symbol is created by performing polynomial division on the data stream against the chosen polynomial generator.


In prior art, in order to optimize the speed at which the error check symbol can be calculated, some have opted for the solution of deriving Boolean or logical expressions that are valid for specific polynomial generators with fixed data width, while other methodologies optimize the idea of using LFSR (linear feedback shift registers), but instead of single bit shifts, many bits or bytes may be shifted per clock cycle, however this then imposes additional rules for the algorithm. Further still, some methodologies proposed by the prior art attempts to optimize operation of performing CRC by checking for unchanged parts of certain streams of information, while others attempt to improve methodology by calculating partial remainders based on segments of the packet of information.


SUMMARY OF THE INVENTION

The present invention provides a method of arrangement of an algorithm to perform parallel cyclic redundancy check (CRC) comprising the step of: (i) considering a polynomial generator g(x)=gk−1xk−1+gk−2xk−2+gk−2xk−2+ . . . g0, and f(x)=m(x)xk−1+c(x); and m(x)=mL−1xL−1+mL−2xL−2+mL−2xL−2+. . . m0; (ii) transforming f(x) and g(x) into a table as a function of each other; (iii) considering an exemplary case whereby k=7 and L=7, obtaining fn−1=A, fn−1=A+B, fn−1=A+B+C . . . f2=E+F+G, f1=F+G, f0=G, wherein A, B, C . . . G are divisor coefficient, and (iv) obtaining ck-2=fk−2, ck−2=fk−2. . . c1=f1, c0=f0.


It is an object of the present invention to provide a method of arrangement of an algorithm that calculate the checksum used in cyclic redundancy checks, which is generic and independent of the length of the polynomial generator and data stream, and the method can be realized in digital logic implementation limited only by the propagation delay of the slowest synthesized combinatorial logic path and typically calculated within a period of a single system clock cycle.


Another object of the present invention is to provide a method of arrangement of an algorithm that calculates the checksum used in cyclic redundancy check, wherein a sequence of information and the corresponding polynomial generator are transformed into a table to simplify the realization and implementation of the method in synthesizable logic.


These and other objects, aspects, advantages and features of the present invention will be more fully understood and appreciated by those skilled in the art upon consideration of the following detailed description of a preferred embodiment, presented in conjunction with the accompanying drawings.


BRIEF DESCRIPTION OF THE DRAWINGS

It is to be understood that the accompanying drawings are provided for the purpose of illustration only, and are not intended as a definition of the limits of the invention. The drawings illustrate a preferred embodiment of the present invention, in which:






FIG. 1 shows a transformation table embodying a 7 bit data stream and a 7 bit polynomial generator in accordance with the present invention;



FIG. 2 shows an exemplary CRC checksum calculation in accordance with the present invention; and



FIG. 3 shows USB CRC5 implementation as LFSR using generator polynomial G(x)=x5+x2+1 of a conventional method.





DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

CRC calculation is performed in polynomial arithmetic, whereby the basis of an algorithm is given that both the transmitter and the receiver use the same polynomial generator sequence, before a stream of information (also known as packets or frames) is transmitted, calculation will be made against the selected polynomial generator via polynomial division. The remainder of the result of the polynomial division is appended against the original packet of information to be transmitted. Thence when the information is transmitted and received by the receiver, a verification can be made by performing the same polynomial division to the received packet of information and checking if the resultant remainder is equal to zero, and hence an error is easily determined for cases when the remainder is not.


In the present invention, the method is employed to provide a method of arrangement of an algorithm that calculates the checksum used in CRC. With respect to mathematical context, the disclosure above can be explained by the following representation.


Suppose that the data stream is represented by m(x) with coefficients mL−1, mL−2, . . . and each polynomial degree is represented by xn-1 where n is the degree of the polynomial ranging from {0,n−1}, then the data stream can be said that

m(x)=mL−1xL−1+mL−2xL−2+mL−2xL−2+ . . . m0


Where L is the length of the data packet.


Additionally the polynomial generator can be similarly represented by

g(x)=gk−1xk−1+gk−2xk−2+gk−2xk−2+ . . . g0


Where k is the length of the polynomial generator. In the present invention, the CRC checksum calculated can be represented by

c(x)=ck−2xk−2+ck−3xk−3+ck−4xk−4+ . . . c0


The final frame of information to be transmitted after CRC has been calculated and appended to m(L) can be represented as:

f(x)=m(x)xk−1+c(x)


And let q(x) be the quotient product of data stream (appended by k−1 bits) and the polynomial generator and m(x) can be rewritten as

m(x)xk−1=g(x)q(x)+c(x)


Where the solution is derived from the following equation:







c


(
x
)


=

remainder


(



m


(
x
)




x

k
-
1




g


(
x
)



)






In prior art, FIG. 2 shows how c(x) is realized, and it can be seen that the present method of polynomial division infers a need to retain information about the past, in order to bring it forward and eventually arrive at a resultant value by which is the remainder. In digital logic systems, a number of Linear Feedback Shift Registers (LFSR) each corresponding to a degree of the polynomial up to the top most degree associated to the polynomial generator, are cascaded in series with additional Exclusive Or (XOR) logic wherever the degree of the polynomial generator is 1. An example of which can be seen in FIG. 3.


As a result, it would require minimum of k−1 number of clock cycles (where k−1 is the highest degree associated with the polynomial generator) in order to calculate the CRC for a given transmitted stream at the receiver side.



FIG. 1 illustrates an exemplary transformation of a 7 bit data stream and a 7 bit polynomial generator to a table in accordance with the present invention. As shown, the transformation table as described by this present invention of data stream plus CRC check sum (f(x): f0, f1, f2, f3 . . . f10, f11, f12), against the polynomial generator sequence (g(x): g0, g1 . . . g5, g6), giving rise to the divisor coefficients A, B . . . F, G. The divisor coefficients are used to calculate the CRC sequence in accordance with the present invention.


As shown in FIG. 2, the calculation of long division being performed on the data stream 1100100111 with additional 0000 being appended to the stream from the polynomial sequence 10101 or x4+x2+1. In the present preferred embodiment, the remainder at the bottom replaces the additional 0000 appended to the data stream as the CRC checksum.


In the preferred embodiment of the present invention, in order to effectively work out the algorithm, f(x) and g(x) are transformed into a table as a function of each other as shown in FIG. 1. Taking an exemplary case of L=7 and k=7 and where the blank spaces are corollary null in value. The mathematical meaning of q(x) becomes meaningless after making the transformation, and it can be seen that coefficients A, B, C . . . F, G arise, and let these coefficients be named as divisor coefficients.


Considering a special case where the polynomial generator is such that all the coefficients from the kth degree 0 to 6 are all one, and let n be the length of the data stream plus the length of the CRC check sum (L+(k−1)), it can be derived that

fn−1=A,fn−1=A+B,fn−1=A+B+C . . . f2=E+F+G,f1=F+G,f0=G


And therefore,

ck−2=fk−2,ck−2=fk−2 . . . c1=f1,c0=f0


If the polynomial generator is not special case, then the derivation above would require an extra multiplication factor based on the row index of the polynomial generator as shown in FIG. 1, with the row of divisor coefficients that have been shifted.


In accordance with the present invention, the algorithm is being used as disclosed to generate a system for CRC checksum which is independent of data or polynomial generator length typically calculated within one clock cycle, limited only by the propagation delay of the slowest synthesized combinatorial logic path.


The generation of the system determines the resultant reminder from performing polynomial division on a data sequence from a configurable polynomial generator without requiring knowledge about the past or having to implement feedback which implies memory. The present invention provides a novel approach by determining the coefficients of the quotient of the result from performing polynomial division by assuming that the remainder is zero, which infers that the remaining k−1 bits of the overall quotient is what would be the remainder of the polynomial division.


Thus, it would be apparent to those skilled in the art that many more modifications are possible without departing from the inventive concepts herein. The invention, therefore, is not to be restricted except in the spirit of the appended claims.

Claims
  • 1. A method of arrangement of an algorithm to perform parallel cyclic redundancy check (CRC) comprising: (i) considering a polynomial generator g(x)gk−1xk−1+gk−2xk−2+ . . . g0, and f(x)=m(x)xk−1+c(x); and m(x)=mL−1xL−1+mL−2xL−2+mL−2xL−2+ . . . m0;(ii) transforming f(x) and g(x) into a table as a function of each other;(iii) considering exemplary case of k=7 and L=7, obtaining fn−1=A, fn−1=A+B, fn−1=A+B+C . . . f2=E+F+G, f1=F+G, f0=G, wherein A, B, C . . . G are divisor coefficient, and(iv) obtaining ck−2=fk−2, ck−2=fk−2 . . . c1=f1, c0=f0.
  • 2. The method of arrangement of an algorithm of claim 1, wherein in step (iii), the derivation requires an extra multiplication factor based on the divisor coefficients of the polynomial generator, if all the coefficients of g(x) of the polynomial generator is not equal to 1.
  • 3. The method of arrangement of an algorithm of claim 1, wherein the divisor coefficients, A, B . . . F, G are used to obtained CRC checksum from the data stream against the polynomial generator sequence by utilization of the mathematical formulation that can be realized in step (iii).
  • 4. The method of arrangement of an algorithm of claim 1, wherein the algorithm is independent of the length of the polynomial generator and data stream.
  • 5. The method of arrangement of an algorithm of claim 1, wherein the algorithm realized in digital logic implementation is limited in speed only by the propagation delay of the slowest synthesized combinatorial logic path with a typical latency of one system clock cycle.
  • 6. The method of claim 1, wherein the method is implemented in a digital data storage system for error correction.
  • 7. A method of arrangement of an algorithm to perform parallel cyclic redundancy check (CRC) comprising: (i) considering a polynomial generator g(x) gk−1xk−1+gk−2xk−2+gk−2xk−2+ . . . g0, and f(x)=m(x)xk−1+c(x); and m(x)=mL−1xL−1+mL−2xL−2+ . . . m0;(ii) transforming f(x) and g(x) into a table as a function of each other;(iii) considering exemplary case of k=7 and L=7, obtaining fn−1=A, fn−1=A+B, fn−1=A+B+C . . . f2=E+F+G, f1=F+G, f0=G, wherein A, B, C . . . G are divisor coefficient, and(iv) obtaining ck−2=fk−2, ck−2−fk−2 . . . c1=f1, c0=f0,wherein the parallel CRC is performed by a circuit.
  • 8. The method of claim 7, wherein in step (iii), the derivation requires an extra multiplication factor based on the divisor coefficients of the polynomial generator, if all the coefficients of g(x) of the polynomial generator is not equal to 1.
  • 9. The method of claim 7, wherein the divisor coefficients, A, B . . . F, G are used to obtained CRC checksum from the data stream against the polynomial generator sequence by utilization of the mathematical formulation that can be realized in step (iii).
  • 10. The method of claim 7, wherein the algorithm is independent of the length of the polynomial generator and data stream.
  • 11. The method of claim 7, wherein the algorithm realized in digital logic implementation is limited in speed only by the propagation delay of the slowest synthesized combinatorial logic path with a typical latency of one system clock cycle.
  • 12. The method of claim 7, wherein the method is implemented in a digital data storage system for error correction.
PCT Information
Filing Document Filing Date Country Kind
PCT/SG2015/050119 5/20/2015 WO 00
Publishing Document Publishing Date Country Kind
WO2016/186571 11/24/2016 WO A
US Referenced Citations (8)
Number Name Date Kind
8185811 Li May 2012 B2
20050066257 Tsai et al. Mar 2005 A1
20050114614 Anderson May 2005 A1
20050149818 Tsai et al. Jul 2005 A1
20080320370 Shinagawa et al. Dec 2008 A1
20110314346 Vas Dec 2011 A1
20140281817 Grube Sep 2014 A1
20140351624 Resch Nov 2014 A1
Foreign Referenced Citations (1)
Number Date Country
0840462 Dec 2004 EP
Non-Patent Literature Citations (3)
Entry
International Search Report, PCT/SG2015/050119, dated Apr. 22, 2016, 3 pages.
International Written Opinion, PCT/SG2015/050119, dated Apr. 22, 2016, 5 pages.
Ming-Der Shien et al., “A Systematic Approach for Parallel CRC Computations”, Journal of Information Science and Engineering, vol. 17, pp. 445-461, May 2001.
Related Publications (1)
Number Date Country
20180131388 A1 May 2018 US