This invention relates to an integrated circuit design in communication area, and more particularly, to an integrated circuit design of a Galois field multiplier.
Galois field multiplier, as a special multiplier, is also known as finite field multiplier for all of its calculations are performed over finite field. It has been widely used in various applications of communication, such as encoding, error correction, encryption, etc.
Some processors have been provided with the capability of Galois field multiplication, logic modules or traditional DSPs (digital signal processor) are also adaptable for achieving Galois field multiplication. These schemes, however, involve complicated multiplication over Galois field, take significant processing time. Due to its extensive usage, Galois field multiplier is usually implemented as a single circuit, generally, a microelectronic IC (integrated circuit) for the purpose of efficiency. With respect to IC design, it is desirable for shrinking the circuit area as small as possible for cost efficiency.
In the prior art, IC design methods of Galois field multiplier can be mainly classified into three categories: Bit-serial, digit-serial and Bit parallel.
According to Bit-serial and digit-serial methods, when inputting multiplicator and multiplicand, they are serially inputted into Galois field multiplier bit by bit, which may have the advantages of decreased hardware footprint and lower design complexity. Both of Bit-serial and digit-serial methods have O(m) logic area for GF(2m) multiplication, while Bit-serial method may lead to a larger multiplication output response latency, typically m clock cycles.
Bit parallel method, on the other hand, specifies when inputting multiplicator and multiplicand, they are inputted in parallel into Galois field multiplier based on actual bit width of them, which has the advantages of smaller multiplication output response latency, merely 1 clock cycle, but along with increased hardware footprint and higher design complexity. When dealing with GF (2m) multiplication, Bit parallel method needs O(m2) logic area. However, existed Bit parallel method is often optimized with specific primitive polynomials, most of which focus on trinomials, i.e., primitive polynomial, such as P(x)=x4+x+1, therefore lacking universality in their design.
Hence, it is needed to provide a Galois field multiplier with decreased hardware footprint, simple design, smaller response latency, as well as strong universality.
To overcome the defections of Galois field multiplier aforementioned, this invention provides a Galois field multiplier, which has decreased hardware footprint, smaller response latency and perfect universality.
According to one aspect of this invention, a Galois field multiplier is provided, comprising: a multiplication circuit for inputting two m bits binary multiplicators and outputting their product, wherein m is an integral power of 2 and output of said multiplication circuit is consisted of a high bits portion and a low bits portion; a memory for storing a Galois field multiplication coefficient array calculated from a selected Galois field primitive polynomial; a first module for performing operation on the output of said multiplication circuit and the stored Galois field multiplication coefficient array to obtain the product of said two m bits binary multiplicators over Galois field multiplication.
The aforementioned and other objects, features and advantages of this invention will be apparent from the following detailed description in conjunction with the accompanying drawings, wherein like reference numerals designate like elements, and in which:
Some preferred embodiments of this invention will be described in detail with reference to the drawings of those embodiments. However, the present invention can be implemented in various ways, and should not be limited to the embodiments described herein. On the contrary, those embodiments are provided for a full and clear understanding of this invention, and as such those skilled in the art can be completely conveyed of the scope of this invention.
First, some essential knowledge about Galois field multiplication will be introduced blow for a better understanding of this invention.
Galois field GF(x) represents a group of elements on which some binary operations can be performed, and the addition and multiplication thereof must comply with the commutative law, the distribution law and the associative law.
The multiplication over Galois field can be defined as:
Mod {AB/P(x)} (1)
For the convenience of this description, both AB and A·B are used hereinafter to represent the traditional multiplication of two multiplicators, only Mod {AB/P(x)} represents the Galois field multiplication, and no further explanation will be given.
There are many ways in the prior art to implement Galois field multiplication, while this invention will focus on its implementation in circuit design. The benefit of circuit implementation is its high processing speed. For communication application requiring a rapid response, such as encoding, encryption, error correction, etc, circuit implementation is the only eligible choice. Assuming both A and B are m bits binary codes, and:
A=a
m-1
a
m-2
. . . a
1
a
0
a
iε{0,1},i ε{0,1 . . . m−1} (2)
B=b
m-1
b
m-2
. . . b
1
b
0
b
iε{0,1},i ε{0,1 . . . m−1} (3)
each of A, B may represent a permutation of bits 0 or 1, and m is an integer power of 2, which in computer field is commonly selected to be 8, 16, 32, 64, 128, 256, etc.
Following Galois field multiplication, A and B can be represented as:
In converting complex Galois field calculations into computer area, the primitive element x is set to 2 in view of the binary architecture utilized in computer systems. In doing so, the addition over Galois field is equal to the binary “XOR” operation. Therefore, in this specification all of the plus symbols represent “XOR” operation, and the Galois field multiplier described below is Galois field multiplier with x=2.
Thus, within the above equations (4) and (5), a m bits binary code can be represented as the XOR value of its low m/2 bits and its high m/2 bite left shifted by m/2 bits respectively.
It will be noted, in binary Galois field multiplier design, the inventors take advantage of the divide-and-conquer policy in software design. When resolving problems having too much data to be handled, or hard to be settled, the direct solver requires a large amount of time to be resolved, or even cannot be tackled. We often divide such a problem into several sub-questions, attempting to resolve each sub-question in an appropriate manner, thereafter, combining those resolutions to form the final answer to the whole problem by a suitable method. If any sub-question is still hard to be tackled, it can be divided into smaller sub-questions and so on, until it can be resolved successfully. The above mentioned is the basic thought of the divide-and-conquer policy.
With the basic thought of divide-and-conquer policy, when calculating Galois field multiplication Mod {AB/P(x)} it can be divided into two problems: first, calculating the value of AB, and then obtaining the result of Galois field multiplication by modulo operation depending on a selected Galois field primitive polynomial P(x).
As to the calculation of AB, given:
D
0(x)=Al(x)Bl(x)
D
1(x)=[Al(x)+Ah(x)][Bl(x)+Bh(x)]
D
2(x)=Ah(x)Bh(x) (6)
wherein Al(x) and Al(x) represent the low bits portion and the high bits portion of A respectively, and Bl(x) and Bh(x) represent the low bits portion and the high bits portion of B respectively. In this invention, Al(x) is equal to Al over Galois field and will not be distinguished hereinafter, as such, Al(x) is equal to Al over Galois field and will not be distinguished (similarly, D0(x) and D0, D1(x) and D1, D2(x) and D2 have the same meanings and will not be distinguished also), that is, if A is a 16 bits binary code, Al(x) is the low 8 bits of A, and Al(x) is the high 8 bits thereof, it is the same with B. According to equations (4), (5), (6), the following equation can be derived:
wherein, f2m-1, . . . fm, fm-1, . . . f0 are expanded coefficients, i.e., the value of each bit of the product AB. For example, if the product AB is 10101 in binary, it can be expressed as 1×24+0×23+1×22+0×21+1×20 when x=2, and thus each f2m-1, . . . fm, fm-1, . . . f0 corresponds to the respective coefficient, i.e., the value of each bit.
The equation (7) can be proven as follow:
AB=A
l
B
l
+x
m/2
[A
h
B
l
+A
l
B
h
]+x
m
A
h
B
h
D
0(x)+xm/2[D0(x)+D1(x)+D2(x)]+xmD2(x)=AlBl+xm/2[D0(x)+D1(x)+D2(x)]+xmAhBhD0(x)+D1(x)+D2(x)=AlBl+AhBh+[AlBl+AhBh+AlBh+AhBl]=AlBh+AhBl
Due to AlBl+AhBh+AlBl+AhBh=0, AlB1+AhBh+AlB1+AhBh+0 for XOR operation, D0(x)+xm/2[D1(x)+D0(x)+D2(x)]+xmD2(x)=AlB1+xm/2[AhBl+AlBh]+xmAhBh
Equation (1) can be reformed as:
Commonly, P(x) is represented as P(x)=xm-1+xm-2+ . . . +1, each coefficient fm-1, . . . f0 is 0 or 1, it can be seen that fm-1xm-1+ . . . +f0≦P(x), then
That is, for the potion in which coefficients having corresponding degree less than m of Galois field multiplication, the result of modulo P(x) is equal to itself.
A Galois field multiplication coefficient array F is defined as:
Then each F can be calculated in prior based on a given primitive polynomial, as such the Galois field multiplication can be transformed to modulo operation:
Mod {AB/P(x)}=(f2m-2F2m-2+ . . . +fmFm)+(fm-1xm-1+ . . . +f0 (10)
From the perspective of divide-and-conquer, it can be seen from the above analysis, the equation (7) is important and the front half of it shows a method for calculating (AB).
There are m any equations of P(x) from reference documents discussing the choice of P(x), for example, U.S. Pat. No. 6,766,345B2 (Galosis Field Multiplier System) has proposed many candidates of P(x). Further, there may be more than one primitive polynomial for a given m. A primitive polynomial for m=8 commonly found in many communication standards is P(x)=x8+x4+x3+x2+1.
Thus, the value of primitive polynomial can be derived by bring x=2 into the primitive polynomial, and thus obtaining all of the coefficients of equation (9).
According to the above analysis, in a divide-and-conquer policy, this invention first provides a circuit to calculate (AB) by using equation (7), and then a circuit to calculate Mod {AB/P(x)} by equation (10) using coefficients F derived from equation (9).
With respect to the circuit design of this invention, the bit number m of two multiplicators A and B are known, and such circuit can be adaptable to any m in theory, however, m is fixed for a particular circuit, and such circuit can not calculate Galois field multiplication for any multiplicators having a bit number larger than m.
Specially, according to equation (10), the first module performs “AND” operation on each bit of the high bits portion of the output of said multiplication circuit and that of the corresponding multiplication coefficient in the Galois field multiplication coefficient array stored in said memory respectively, thereafter XOR all of the “AND” results, and then performs XOR operation on the results of above XOR and the low bits portion of output of said multiplication circuit, so as to obtain the product of the two multiplicators over Galois field.
In an implementation, said memory storing the Galois field multiplication coefficient array calculated from a selected Galois field primitive polynomial can be implemented in the form of shift register, which are able to calculate and store the Galois field multiplication coefficient array. It is also possible to calculate the Galois field multiplication coefficient array in advance and then store it in a memory array, or by any other methods of those skilled in the art. Said Galois field multiplication coefficient array comprises m-1 Galois field multiplication coefficients, each of them is m bit binary code.
In an alternative implementation, the first module may comprise a plurality of AND gates and a plurality of XOR gates, wherein the AND gates are divided into at least m-1 groups, each group having at least m AND gates and engaging in the bitwise AND operation of a coefficient in the Galois field multiplication coefficient array and the high bits portion of output of said multiplication circuit. Further, the XOR gates of the first module can be divided into two groups, each group having at least m XOR gates. Wherein each XOR gate of the first XOR group having at least m XOR gates receives the corresponding bits of output of each AND gate group as input and outputs the XOR result of corresponding bits of output of each AND gate group having at least m XOR gates; each XOR gate of the m XOR gates of the second XOR group is used to perform a XOR operation on each output of the first XOR group and a corresponding bit of the low bits portion of output of said multiplication circuit, and then output each bit of the result of Galois field multiplication. With respect to
Here, the output of the first XOR gates group is (f2m-2F2m-2+ . . . +fmFm), the output of the second XOR gates group is (fm-1xm-1+ . . . +f0)+(f2m-2F2m-2+ . . . +fmFm), wherein f2m-2F2m-2 output by the first XOR group refers to “AND” operation of f2m-2 and F2m-2.
The embodiment described above is merely a particular implementation of said first module, which as implemented in IC has a small hardware footprint, rapid response and superior universality. Certainly, those skilled in the art may understand that the first module also can be implemented in other manners, for example, in digital logics, or in DSP chipsets.
No material multiplication circuit is shown in
In one implementation, with reference to
In another implementation, the third module shown in
Due to both of A and B are of m bits, the product of AB is of 2m-1 bits, and thus the output of that circuit for calculating AB has 2m-1 bits.
It can be seen from the above discuss, this invention pertains to a Bit Parallel method in nature. Through calculating and storing the coefficients associated with the primitive polynomial in advance, as compared with existed Bit Parallel methods, it is possible to reduce the response latency and shrink the area of the circuit. Also, since the primitive polynomial can be calculated in advance, any primitive polynomial can be chosen for this invention, and hence maximizing the universality of this invention.
This invention can be implemented as a general circuit, as a module of an integrated circuit, or even as a stand alone integrated circuit.
Resorting to the Cu-08 library from IBM semiconductor solutions, the inventors have implemented a 32 bits Galois field multiplier with superior performance according to this invention, which can achieve a frequency of 300 MHz easily. Table 1 below shows some performance parameters of the Galois field multiplier and its multiplication array of the invention.
It can be seen from table 1, the resulted multiplication array tends to increment its circuit area by 3 times, i.e., every bit added in each multiplicator, three times increased the circuit area as compared to its original area, implying a linear increment tendency in the circuit area of the multiplication array, and thus a linear increased response latency thereof. Further, when the bit number of the multiplicators increases as twice over its original number, the response latency only increases slightly. It demonstrates the successful of the design provided by this invention. Although the increasing tendency of the whole area of the Galois field multiplier is O(m2), i.e., GF(64) tends to 4 times as large as GF(32), GF(128) is 4 times as large as GF(64), and so on, the response latency will increase linearly.
While some example embodiments have been described with reference to the drawings, it should be understood that this invention is not to be restricted to those exact embodiments. Many modifications and variations are apparent to those skilled without departing from the scope and spirit of this invention. All of those modifications and variations are intended to be comprised in the scope of this invention as defined in the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
2009-10142713.0 | May 2009 | CN | national |