Apparatus and method for parallel generation of cyclic redundancy check (CRC) codes

Abstract: A method and apparatus are disclosed for the efficient generation of cyclic redundancy check (CRC) codes employing CRC generator polynomials of the form (1 + x)·f(x). The efficiency is achieved by independently and concurrently generating in parallel a preliminary CRC code word R'(x) corresponding to f(x) and a term R"(x) corresponding to (1 + x) over a message M(x). The term corresponding to (1 + x) is generated in a manner to have either a zero (0) state or a one (1) state. Then, the term corresponding to (1 + x) is used to modify the preliminary CRC code word to obtain an overall CRC code word R(x) being generated over message M(x). If the term corresponding to (1 + x) is a 0 state, then the overall CRC code word is obtained by shifting the bits of the preliminary CRC code word once to the left. If the term corresponding to (1 + x) is a 1 state, then the overall CRC code word is obtained by shifting the bits of the preliminary CRC code word once to the left and adding f(x) to the shifted preliminary CRC code word.

Description: Technical Field This invention relates to the generation of code words and, more particularly, to the generation of cyclic redundancy check (CRC) code words. Background of the Invention Cyclic redundancy check (CRC) code words have been generated in both bit serial fashion and bit parallel fashion. In "high" bit rate communications networks it is desirable to generate the CRC code words in parallel fashion. Prior known arrangements for generating the CRC code words in parallel required the use of complex circuit arrangements which were difficult, if at all possible, to realize in usable fashion. This difficulty in implementation arises due to the form of the CRC generator polynomials that are typically employed to generate the CRC code words. In general, the CRC generator polynomials are of the form (1+x)˙f(x). The (1 + x) factor introduces prohibitive complexity for the prior parallel CRC code word generator arrangements. This is because in the prior arrangements CRC code words were generated by performing division by the entire CRC generator polynomial in one step. Such a division is extremely difficult to realize in a hardware design. Summary of the Invention The problems with prior parallel CRC code word generator arrangements are overcome, in accordance with the invention, by generating an overall CRC code word in a two step process employing a CRC generator polynomial of the form (1 + x)˙f(x). One step comprises generating a preliminary CRC code word corresponding to f(x). The second step comprises generating a term corresponding to (1 + x). These two steps are carried out independently and concurrently in parallel. Upon completion of these two steps, the preliminary CRC code word and the term corresponding to (1 + x) are combined in a prescribed manner to generate the overall CRC code word More specifically, the overall CRC code word is obtained by advantageously utilizing the term corresponding to (1 + x) to modify the preliminary CRC code word corresponding to f(x) in a prescribed manner. The term corresponding to (1 + x) is either a zero (0) state or a one (1) state. If this term is a 0 state, then the overall CRC code word is obtained by modifying the preliminary CRC code word in a first prescribed manner, i.e., by shifting the bits of the preliminary CRC code word corresponding to f(x) once to the left. If this term is a 1 state, then the overall CRC code word is obtained by modifying the preliminary CRC code word in a second prescribed manner, i.e., by shifting the bits of the preliminary CRC code word corresponding to f(x) once to the left and adding f(x) to the shifted preliminary CRC code word. Brief Description of the Drawing In the drawing: FIG. 1 shows, in simplified block diagram form, an arrangement for generating CRC code words in parallel; FIG. 2 illustrates, in simplified block diagram form, an arrangement for parallel generation of a preliminary CRC code word corresponding to f(x); FIG. 3 depicts, in simplified block diagram form, the output of the preliminary CRC code word generator 102 of FIG. 2; FIG. 4 shows, in simplified block diagram form, an arrangement for generating the term corresponding to (1 + x); and FIG. 5 graphically depicts the function of combination logic unit 104 of FIG. 1. Detailed Description Prior to describing the details of one implementation of the invention it is felt that a theoretical discussion of the principles underlying the invention would be helpful. Theoretical Discussion In the following, we briefly review properties of Cyclic Redundancy Check (CRC) codes. A CRC code is a polynomial code in the sense that bit strings are treated as representations of polynomials with coefficients of 0 and 1 only. An n-bit message is regarded as the coefficient list for a polynomial with (n) terms, ranging from x n-1 to x⁰. Polynomial arithmetic is done modulo 2, according to the rules of algebraic field theory. Hence, both addition and subtraction are identical to an EXCLUSIVE OR function. In the following, we fix the length of messages including the CRC field to be (n) and denote the generator polynomial by G(x). Assume that the degree of G(x) is (r). It is known that, if (x + 1) divides the generator polynomial G(x) and G(x) does not divide (x) and (x k + 1) for any (k) up to (n), then the Hamming weights of nonzero legal polynomials are at least four (4). This provides a method for finding the generator polynomial of a CRC code which can provide a Hamming distance of four (4). The following polynomials have become international standards: G(x)= (1 + x + x 4 + x 5 + x 9 + x 10 ) = (1 + x)(1 + x 4 + x 9 ) ; G(x)= (1 + x + x 2 + x 3 + x 11 + x 12 ) = (1 + x)(1 + x 2 + x 11 ) ; and G(x)= (1 + x 2 + x 15 + x 16 ) = (1 + x)(1 + x + x 15 ) for CRC-10, CRC-12 and CRC-16, respectively. All three of the polynomials are of the form (1 + x)˙f(x), where f(x) is a primitive polynomial. The function (1 + x) is a factor in the generator polynomial which provides a Hamming distance of four (4). It will be apparent that other polynomials may be equally employed in practicing the invention. A CRC code word generation procedure and apparatus are described that are especially suited to such polynomials and enables very simple parallel implementation in accordance with the invention. The notation, is used to represent the remainder obtained upon dividing a polynomial g(x) by a polynomial h(x). Let G(x), the CRC generator polynomial be such that, G(x) = (1 + x)f(x). Let M(x) be the message polynomial whose CRC code is desired and let (r) be the number of check bits (i.e. degree of G(x)). Now f(x) has degree (r-1). It is then desired to compute the remainder R(x) given by, Remainder R′(x) is defined as, In other words R'(x) is the CRC code for M(x), when f(x) is the generator polynomial, i.e., R′(x) ) is a preliminary CRC code word corresponding to f(x). Equation (6) can be rewritten as, x r-1 M(x) = Q'(x) · f(x) + R'(x), where Q′(x) is the quotient polynomial. Next, a term corresponding to (1+x) is defined as, That is, R"(x) is the remainder obtained upon dividing Q′(x) by (1 + x). Equation (8) can be rewritten as, Q'(x) = Q"(x)·(1+x) + R"(x) , where Q"(x) is the appropriate quotient polynomial. Putting equation (9) into equation (7) and multiplying throughout by (x) results in, x r M(x) = x·Q"(x)·(1+x)·f(x) + x·R"(x)·f(x) + x·R'(x) . Since the remainder operator is linear, dividing equation (10) throughout by (1+x)˙f(x)yields, This is because the first term on the right side of equation (10) yields a remainder of zero (0). Now, R"(x) is of degree zero (0) and, therefore, x˙R"(x)˙f(x) is of degree (r). The degree of (1+x)˙f(x) is (r). Therefore, exactly one division is needed to generate the remainder Since R"(x) is of degree zero (0), it can take one of two values, i.e., 0 or 1. If term R" (x) is 0, then the remainder is zero (0). If term R"(x) is 1, then it is only necessary to generate and the result is f(x). Referring to the second term on the right side of equation (11). R'(x) is of degree (r-2) and x˙R'(x) is of degree (r-1). The denominator is of degree (r). Therefore, the result is x˙R'(x). This merely involves a shift to the left of the bits of R'(x). The desired end result R(x) is, Generation of the overall CRC code involves two steps: the generation of R′(x) which is a preliminary CRC code of M(x) with f(x) as the generator polynomial and the generation of R″(x) which is a term corresponding to (1+x). Once these two steps are completed the desired overall CRC code, i.e., remainder R(x), is very simply obtained by using equation (12), in accordance with the invention. The following describes the parallel generation of R′(x) and R″(x). By way of an example, a 16-bit implementation is employed, however, it will be apparent that the results are generalizable to any other implementation, whether it is byte based or 32 bit based. Let M(x) have the polynomial representation, where (k) is the message length. Equation (13) can be rewritten as, where, Multiplying equation (14) by X r-1 results in, The following recursion is defined as, B i = x 16 [A k-1-i x r-1 + B i-1 ] with the boundary condition, B₋₁ = 0. From the definition of equation (17), B 0 = x 16 ·A k-1 ·x r-1 ; B 1 = x 16 ·A k-2 ·x r-1 + x 32 ·A k-1 ·x r-1 ; B i = x 16 ·A k-1-i x r-1 + x 32 A k-i x r-1 ; and B k-2 = x 16 A 1 x r-1 + ··· + x 16(k-1) A k-1 x r-1 . Therefore, equation (16) can be rewritten as, x r-1 ·M(x) = A 0 ·x r-1 + B k-2 . Then, by definition, with the boundary condition r₋₁ (x) = 0. An alternative representation of equation (20) is, A k-1-i x r-1 + x 16 ·r i-1 (x) = f(x)·C i (x) + r i (x), where, C i (x) is the appropriate quotient polynomial. Putting equation (21) into equation (17) results in, B 0 = x 16 ·r 0 (x) + x 16 ·f(x)·C 0 (x). Substituting equation (22) and equation (21) into equation (17) results in, B 1 = x 16 ·.r 1 (x) + x 16 ·f(x) [C 1 (x) + x 16 ·C 0 (x)] . Carrying out the recursion in equation (17) results in, Putting equation (24) into equation (19) results in, The remainder operator is linear. Dividing equation (25) by f(x) results in, since the second term on the right side of equation (25) produces a zero (0) remainder. Also, where Q' as defined earlier is the quotient produced by the division in equation (26). By definition the following recursion is obtained, D i (x) = x 16 [C i (x) + D i-1 (x)] , with boundary condition, D₋₁ = 0. Carrying out the recursion in equation (28) results in, Q'(x) = C k-1 (x) + D k-2 (x). By definition, with the boundary condition, t₋₁ = 0. Alternatively, equation (30) can be written as, C i (x) + x 16 ·t i-1 (x) = (1 + x)E i (x) + t i (x) , where E i (x) is a quotient polynomial. Substituting equation (31) into equation (28), carrying out the recursion and combining with equation (29), results in, Dividing throughout equation (32) by (1 + x) and using the fact that the remainder is a linear operator, results in, In order to arrive at the overall implementation, R′(x) is obtained recursively in equation (28) and R"(x) is obtained recursively in equation (33). The key step involved in generating R'(x) is the recursion specified in equation (20). Since f(x) is of degree (r-1), r i-1 (x) is of degree (r-2). Therefore, x¹⁶˙r i-1 is of degree (14+r). Since A k-1-i is of degree 15, A k-1-i (x r-1 ) is also of degree (14+r). If a block divider circuit is employed to carry out division by f(x), then the remainder is fed back and added to the incoming 16 bits. The key step for generating R"(x) is given in equation (30). Here, t i-1 is of degree 0, and x¹⁶t i-1 is of degree 16. C i (x) is of degree 15. First C i (x) for a generic polynomial is generated and division by (1 + x) can be performed by a block divider circuit. A technical advantage of this implementation and the invention is that the preliminary CRC code corresponding to f(x) and the term corresponding to (1 + x) are generated concurrently in parallel completely independent of each other. Exemplary Embodiment In the following, an example implementation of the invention is described for the CRC code generator polynomial, G(x) = (1 + x 2 + x 15 + x 17 + x 30 + x 31 ) = (1 + x)(1 + x + x 15 + x 16 + x 30 ). FIG. 1 shows, in simplied block diagram form, an exemplary embodiment for the parallel generation of a CRC code R'(x) utilizing a generator polynomial of the form (1+x)˙f(x). Accordingly, shown are message source 101, preliminary CRC code word R'(x) generator 102, term R"(x) generator 103 and combination logic 104. Message source 101 includes apparatus for interfacing to a transmission path 100 or the like to obtain message M(x) over which the CRC code R(x) is to be generated. Blocks of bits of predetermined length A i of message M(x) are supplied from message source 101 to both preliminary CRC code R'(x) generator 102 and term R" (x) generator 103. In this example, not to be construed as limiting the scope of the invention, each block of bits A i includes 16 bits in parallel. Preliminary CRC code R'(x) generator 102 is responsive to the supplied blocks of bits A i of message M(x) to generate the CRC code R'(x) corresponding to f(x) in a manner as described above in the theoretical discussion, namely, in accordance with equation (28). Also, term R"(x) generator 103 is responsive to the supplied blocks of bits A i to generate the term R"(x) also in a fashion as described above in the theoretical discussion, namely, in accordance with equation (33). It should be noted that R'(x) and R"(x) are only supplied as an output after all the blocks of bits A i of the entire message M(x) over which the CRC code R(x) is being generated have been input to both of generators 102 and 103. Thereafter, combination logic 104 combines R'(x) and R"(x) to yield the desired CRC code word R(x) as described above in the theoretical discussion, namely, in accordance with equation (18). It should be noted that for the CRC code generator polynomial of equation (34), R'(x) is of degree 30, R"(x) is of degree one (1) and R(x) is of degree 31. Additionally, preliminary CRC code R'(x) is generated in generator 102 independent of term R" (x ) being generated in generator 103. FIG. 2, shows, in simplified block diagram form, details of one arrangement which may be advantageously employed for preliminary CRC code R'(x) generator 102 of FIG. 1. Accordingly, bits a (i - 16) x⁰ through a (i - 1) x¹⁵ in each of blocks of bits A i of message M(x) are supplied to a corresponding plurality of EXCLUSIVE OR gates and then to stages of register 201, as shown. Register 201 in this example is a shift register having 16 stages. Outputs from register 201 are combined in additional EXCLUSIVE OR gates and then supplied to register 202. In this example, register 202 is also a shift register including stages A through N. Registers 201 and 202 are initialized so that all stages are in a zero (0) state. It is noted that outputs from registers 201 and 202, which in combination, form the preliminary CRC code R'(x) are not shown for clarity of exposition. The outputs from registers 201 and 202 are shown in FIG. 3 as being supplied as an output via controllable switch 301 under control of output control 302 after all the blocks of bits A i of message M(x) have been processed. It is noted that the symbol ⊕ represents an EXCLUSIVE OR gate and that an arrow into a register stage or an EXCLUSIVE OR gate represents an input and an arrow out of a register stage or an EXCLUSIVE OR gate represents an output. FIG. 4 shows, in simplified block diagram form, one arrangement which may be advantageously employed in term R"(x) generator 103 of FIG. 1. Accordingly, bits a (i - 16) x⁰ through a (i - 1) x¹⁵ in each of blocks of bits A i of message M(x) are supplied to stages 0 through 15, respectively, of register 401. In this example, register 401 includes 16 stages. Register 401 is initialized so that each stage is in a zero (0) state. Outputs from stages 0 through 13 and 15 and 16 of register 401 are combined via EXCLUSIVE OR gates, as shown. The end result of the EXCLUSIVE ORing after processing all blocks A i of message M(x) is supplied as an input to stage 16 of register 401. An output from stage 16 of register 401 is the desired term R"(x) which is supplied as an output via controllable switch 401 under control of output control 402 after all the blocks of bits A i of message M(x) have been processed. As indicated above, the ⊕ indicates an EXCLUSIVE OR gate and an arrow into a register stage or an EXCLUSIVE OR gate represents an input and arrow out of a register stage or an EXCLUSIVE OR gate represents an output. FIG. 5 graphically represents the function of combination logic 104 of FIG. 1. Combination logic 104 is operative to effect the conditions of equation (18), as indicated above. That is, if R"(x) is a zero (0) the desired CRC code R(x) is obtained by shifting the bits of R'(x) once to the left. If R"(x) is a one (1) the desired CRC code R(x) is obtained by shifting the bits of R'(x) once to the left and adding the function f(x) to the shifted R' (x).

Claims: A method for the parallel generation of an overall cyclic redundancy check (CRC) code word employing a CRC generator polynomial of the form (1 + x)˙f(x) over a message M(x), including the steps of, interfacing to a transmission path to obtain blocks of bits A i in parallel of the message M(x), the method being CHARACTERIZED BY generating a preliminary CRC code word R'(x) using f(x) as a CRC generator polynomial in response to said blocks of bits A i of said message M(x), and generating a term R"(x) corresponding to (1 + x) in response to said blocks of bits A i of said message M(x), and modifying said preliminary CRC code word in a prescribed manner in response to said generated term corresponding to (1 + x) to obtain said overall CRC code word. The method as defined in claim 1, CHARACTERIZED IN THAT said steps of generating said preliminary CRC code word and said term corresponding to (1 + x) are occurring concurrently and independently. The method as defined in claim 2, CHARACTERIZED IN THAT said preliminary CRC code word is generated in accordance with where R'(x) is the preliminary CRC code word, M(x) is the message over which the overall CRC code word is being generated, and (r) is the degree of the CRC generator polynomial (1 + x)˙f(x). The method as defined in claim 3, CHARACTERIZED IN THAT said term corresponding to (1 + x) is generated in accordance with where R"(x) is the term corresponding to (1 + x) and Q'(x) is the quotient polynomial obtained from dividing said message M(x) by f(x). The method as defined in claim 4, CHARACTERIZED IN THAT said step of modifying includes modifying said preliminary CRC code word in a first prescribed manner when said term corresponding to (1 + x) has a first prescribed state and modifying said preliminary CRC code word in a second prescribed manner when said term corresponding to (1 + x) has a second prescribed state. The method as defined in claim 5, CHARACTERIZED IN THAT said first prescribed state is a logical 0 and said second prescribed state is a logical 1, said first prescribed manner of modifying said preliminary CRC code word comprises shifting the bits of said preliminary CRC code word once to the left when said prescribed state is a logical 0 and said second prescribed manner of modifying said preliminary CRC code word comprises shifting the bits of said preliminary CRC code word once to the left and adding f(x) to the shifted preliminary CRC code word when said prescribed state is a logical 1. Apparatus for the parallel generation of an overall cyclic redundancy check (CRC) code word employing a CRC generator polynomial of the form (1 + x)˙f(x) over a message M(x), including, means for interfacing to a transmission path to obtain blocks of bits A i in parallel of the message M(x), the apparatus being CHARACTERIZED BY means responsive to said blocks of bits A i of said message M(x) for generating a preliminary CRC code word R'(x) using f(x) as a CRC generator polynomial, means responsive to said blocks of bits A i of said message M(x) for generating a term R"(x) corresponding to (1 + x), and means responsive to said generated term corresponding to (1 + x) for modifying said preliminary CRC code word in a prescribed manner to obtain said overall CRC code word. The apparatus as defined in claim 7, CHARACTERIZED IN THAT said means for generating said preliminary CRC code word and said means for generating said term corresponding to (1 + x) are concurrently and independently generating said preliminary CRC code word and said term corresponding to (1 + x). The apparatus as defined in claim 8, CHARACTERIZED IN THAT said means for generating said preliminary CRC code word includes means for generating said preliminary CRC code word in accordance with where R'(x) is the preliminary CRC code word, M(x) is the message over which the overall CRC code word is being generated, and (r) is the degree of the CRC generator polynomial (1 + x)˙f(x). The apparatus as defined in claim 9, CHARACTERIZED IN THAT said means for generating said term corresponding to (1 + x) includes means for generating said term corresponding to (1 + x) in accordance with where R"(x) is the term corresponding to (1 + x), and Q'(x) is the quotient polynomial obtained from dividing said message M(x) by f(x). The apparatus as defined in claim 10, CHARACTERIZED IN THAT said means for modifying includes means for modifying said preliminary CRC code word in a first prescribed manner when said term corresponding to (1 + x) has a first prescribed state and means for modifying said preliminary CRC code word in a second prescribed manner when said term corresponding to (1 + x) has a second prescribed state. The apparatus as defined in claim 11, CHARACTERIZED IN THAT said first prescribed state is a logical 0 and said second prescribed state is a logical 1, said first prescribed manner of modifying said preliminary CRC code word comprises shifting the bits of said preliminary CRC code word once to the left when said prescribed state is a logical 0 and said second prescribed manner of modifying said preliminary CRC code word comprises shifting the bits of said preliminary CRC code word once to the left and adding f(x ) to the shifted preliminary CRC code word when said prescribed state is a logical 1.

Inventors: DRAVIDA SUBRAHMANYAM, DRAVIDA, SUBRAHMANYAM
Applicants: AT & T CORP, AT&T CORP.
Application year: 1991
Main classification: H03M13
IPC codes: G06F11, H03M13