None.
None.
This disclosure relates to a binary number multiplying method and circuit using an array of adders.
It finds a particularly important, although not exclusive, application in the field of computer systems implementing algorithms requiring many multiplications to be carried out quickly such as for example in the digital signal processing field.
It can therefore be used, more simply and more efficiently, instead of known multipliers implemented by coding or with counters.
Multipliers of the type based on a dot matrix scheme are already known.
Here the multiplicand is shifted, multiplied by a multiplier bit and added with the intermediate sum from the previous calculation.
The operation is then repeated to the last bit, addition of the shifted multiplicand values being performed either by coding using simplifying algorithms considering the successive elements as multiples, (coding of the type known by the name “Booth” coding), which makes it possible to reduce the number of multiplicands to be added, or by using an array of half-adders arranged as counters.
Such multipliers can however be further improved; this is because they prove to be expensive in terms of power and are also difficult to test beforehand perfectly reliably.
An aspect of the disclosure starts with a new arrangement with successive approximations organised in three stages, which does not use the matrix generated by the known logical ANDs of multipliers and multiplicands, but the EXCLUSIVE OR, which is much easier to test.
With an embodiment of the invention, the calculation matrix is re-expressed in a different form, by transforming it so that it expresses the actual structure of the number sought.
With this aim, an embodiment of the invention essentially proposes a method for multiplying, using an array of adders, two binary numbers X and Y of N and M bits respectively, namely:
defining an initial matrix [Eni=xn−i·yi], characterised in that
the initial matrix [Eni=xn−i·yi] is transformed into a matrix [Eni=(xn−i⊕yi)·(yi−1 ⊕yi)=(xn−i⊕yi)·Yi] with Yi=yi−1⊕y, or [Eni=eni·Yi] with eni=xn−i⊕yi, wherein the step of multiplying comprises:
forming a first approximation Un0 and Rn+10 of a sum and carry of the first two rows y0 and y1 of this matrix thus transformed over the entire length of said numbers,
using this first approximation as an input for a following estimation step which is repeated for all the following rows, successively carrying out an addition of the following Yi+1 rows up to the last non-zero row, according to a first given series of propagation equations,
carrying-out a propagation of the carries Rni−1 over the zero Yi+1 rows according to a second given series of propagation equations, in order to obtain the final result of the product: P=pM+N+1·2M+N+1+pM+N·2M+N+ . . . +pn·2N+ . . . +p1·21+p0·20
In advantageous embodiments, one and/or another of the following provisions are also used:
called EI1;
called E′I1
with the following carry look-ahead hypotheses: if the second row is not zero (Y1=1), a carry is anticipated irrespective of the value of the first row (Y0=0 or Y0=1)
called EI2
with: Y0=0⊕y0=y0 and Y1=y0⊕y1;
called E′I2
with the following carry look-ahead hypotheses: if the two rows are not zero (Y0=1 and Y1=1), a carry is anticipated;
called EI3;
called E′I3 with the following carry look-ahead hypotheses: irrespective of the values of Y0 and Y1, a carry is anticipated;
called EI4;
called EI5;
called EI6;
called EI7;
called EI8;
called EEP1
with Eni+1=(xn⊕yi+1)·Yi+1 and Yi+1=yi⊕yi+1;
called EEP2;
called EEP3
with en+1i+1=xn−i⊕yi+1;
called EP1;
called EP2;
An embodiment of the invention also proposes a multiplying system comprising calculation means implementing the above-mentioned method.
It also proposes more precisely a multiplier making it possible to multiply input signals comprising a first N-bit binary number (X) and a second M-bit binary number (Y), namely:
defining an initial matrix [Eni=xn−i·yi],
wherein the multiplier comprises:
calculation means for transforming the initial matrix [Eni=xn−i·yi] into a matrix [Eni=(xn−i⊕yi)·(yi−1⊕yi)=(xn−i⊕yi)·Yi] with Yi=yi−1⊕yi or [Eni=eni·Yi] with eni=xn−i⊕yi,
initial estimation module (MEOi) arranged to provide a first approximation Un0 and Rn+10 of the sum and carry of the first two rows y0 and y1 over an entire length N of said numbers, comprising N estimation blocks (MIi) connected in parallel, each estimation block being capable of performing said sums and said carries,
an estimation/propagation module (MEEPi) arranged to successively carry out the addition of the following Yi+1 rows up to the last non-zero row, according to a first given series of propagation equations, comprising estimation/propagation blocks (MEPi) connected in cascade, each estimation/propagation block being capable of performing said sums and said carries,
and a propagation module (MPi), propagating the carries Rni−1 on the zero yi+1 rows according to a second given series of propagation equations.
Advantageously, the means (MPi) of propagating the carries Rni−1 comprise estimation blocks in inverse cascade, each estimation block being capable of performing said carries.
Also advantageously and in order to speed up the operation of the means (Mpi) of propagating the carries Rni−1, a Carry-Look-Ahead type form of adder is used.
The disclosure will be better understood from a reading of the following description of embodiments given hereinafter for information only and non-limitatively.
This refers to the accompanying figures, wherein:
The product will therefore be expressed in 10 bits:
P=p9·29+p8·28+ . . . +p1·21+p0·20 (see row 1 of
For the known form the values Eni are furthermore such that Eni=xn−i·yi and the values Eni outside the hatched area 2 of
According to an embodiment of the invention, a new expression of this initial matrix is used with values Eni such that:
E
n
i=(xn−i⊕yi)·(yi−1⊕yi)=(xn−1⊕yi)·Yi
with Yi=yi−1⊕yi or Eni=eni·Yi with eni=xn−i⊕yi.
The equivalence between the two forms of matrix {the known form (referenced 3 in
It has already been noted that the new matrix 4 has a row 5 more than the standard matrix 3 (with Eni=xn−i·yi), since the last row 6 of this matrix 4 contains the values:
En5=(xn−5⊕y5)·Y5=xn−5·Y5 and Y5=y4⊕y5=y4 which can therefore be non-zero.
More precisely, the known matrix expressed as a function of Eni=xn−i·yi is transformed into a new matrix expressed as a function of Eni=(xn−i⊕yi)·(yi−1⊕yi) by re-expression of the sets of bits at 1 of the known matrix.
This transformation is done on the basis of the following considerations.
Let there be a set of bits having the value 1.
This set is generated by the bits xk to xk+n−1 having the value 1 multiplied by the bits y1 to y1+m−1 having the value 1. The result S is expressed thus:
S=(xk+n−1·2k+n−1+ . . . +xk+1·2k+1+xk·2k)·(y1+ω−1·2i+m−1+ . . . +yi+1·2i+1+y1·21)
By assigning the values xi=1, yi=1 and factorising 2k and 21, it becomes:
S=2k+1·(2n−1+ . . . +21+20)·(2m−1+ . . . +21+20)
S=2k+1·(2n−20)·(2m−20)=2k+1·(2n+m−2m−2n+20)
S=2k+1·[(2n+m−2m)+(2+∞−2n−2∞)+(20−2−∞+2−∞)]
S=2k+1·(2n+m−2m)+(2+∞−2k+1+n−2+∞)+(2k+1−2−∞+2−∞)
with:
2k+1·(2n+m−2m): portion referenced 7 in dot-and-dash lines in
(2+∞−2k+1+n−2+∞): portion referenced 8 and 8′ in
(2k+1−2−∞+2−∞): portion referenced 9 and 9′ in
Thus and in a numerical example with a multiplier y=63669=1111100010110101 and a multiplicand x=40119=1001110010110111 the initial matrix is expressed according to Table I below.
And after transformation according to an embodiment of the invention, the matrix 10 of
Bits 11, 12, 13, 14 and 15 surrounded by a double frame represent the 2∞ values and bits 16, 17, 18, 19 and 20 the 2+∞ values.
It should therefore be noted that an additional row 21 is necessary for the matrix transformed into 21+m.
It can also be seen that, in the multiplication described, it is not necessary to add the 2−∞ values since it is carried out with adders that always assume a carry.
Neither is it necessary to propagate the carries beyond the parallelogram for the same reason.
There will now be described in greater detail the principle of the multiplication (applied to the above numerical example) implemented in the embodiment of the invention more particularly described here, with reference to
First of all the first approximation Un0 and Rn+10 of the sum of the first 2 rows of the matrix is calculated.
Let E00 to E90 and E01 to E91 be the rows to be added:
The estimate is: Un0=
As regards the refinement in n, this is:
The refinement is therefore: Rn0=Y1·(En1⊕En−10).
At the next row (row 23 in
This algorithm is shown by
Here, Rn1 comprises only one propagation component.
An Rn1 refinement component is calculated with the corrected value (Un−10⊕Rn−10) and En2 such that Rn1=
This is shown in
For this case also it is necessary to generate the propagation component (Un−10⊕Un−20)·Rn−10. Synthesis of the two cases (Y2=0 and Y2=1) gives the following formulae:
That is after simplification:
For the following rows 24 to 37, the previous formulae are generalised.
If row (i+1) is not zero (Yi+1=1),
Synthesis of the two cases (Yi+1=0 and Yi+1=1 then gives the following formulae:
That is after simplification:
When all the rows E0i to E31i have been added (result of row 37 in
To do this, and according to the embodiment of the invention more particularly described here, propagation is done with the following equations:
that is according to EP1 (row 39).
It should be noted here that this corresponds to additions with zero rows.
Finally the result at row 39 of
More precisely, and in order to show in logic circuit form the first approximation used above, it should be noted that the initial approximation Un0 and Rn+10 of the sum of the first two rows of the matrix is calculated with so-called “initial estimation” modules implementing the following equations:
For implementation in modules, the signals to be generated are grouped together so as to minimise the inputs. The equations arranged by module then instead calculate Un0 and RN+10 with the following initial estimation/refinement equations or formulae:
By substituting the values En0=(xn⊕y0)·Y0 and En+11=(xn⊕y1)·Y1 in the above equations, this gives:
The following is obtained:
This can also be expressed as:
These equations are set out in diagram 40 of
The addition of the following rows of the matrix is in fact calculated with the so-called “estimation/propagation” modules implementing the following equations:
As previously, the signals are grouped together in order to minimise the inputs and therefore the equations arranged by module instead calculate a system that is a function of Uni and Rn+1i:
As regards the expression of Rn+1i, this can be broken down as a function of the terms and Yi+1 and Rni−1 as follows:
R
n+1
i
=Y
i+1
·R
n
i−1·[
Then, with grouping together of the two terms in Yi+1·Rni−1 and simplification, it becomes:
R
n+1
i
=Y
i+1
·R
n
i−1·[
R
n+1
i
=Y
i+1
·R
n
i−1
·[E
n+1
i+1⊕
R
n+1
i
=Y
i+1
·R
n
i−1·(En+1i+1⊕Un−1i−1)⊕YI+1·
A recursive equation discovered by the inventor furthermore shows that: Yi+1·Rni−1·(En+1i+1⊕Un−1i−1)=0.
The following system of equations is thus obtained:
which is the one implemented in one embodiment of the invention.
The system of equations EEP2 can also be simplified by the following transformations:
The following is written: En+1i+1=(xn−i⊕yi+1)·Yi+1=en+1i+1·Yi+1 with
e
n+1
i+1
=x
n−i
⊕y
i+1
or in general terms eKJ=xK−J⊕yJ.
The second equation of EEP2 is then written:
R
n+1
i
=Y
i+1·
That is:
R
n+1
i
=Y
i+1·
Factorisation of a term (Yi+1⊕Rni−1):
R
n+1
i
=Y
i+1·(Yi+1⊕Rni−1)·(
By grouping together the factor term of
This gives:
R
n+1
i=(Yi+1⊕Rni−1)·[(en+1i+1⊕Uni−1)⊕
However another recursive equation discovered by the inventor furthermore shows that:
(Yi+1⊕Rni−1)·[
Hence: Rn+1i=(Yi+1⊕Rni−1)·(
The following system of equations is then obtained:
with: en+1i+1=xn−i⊕yi+1
which is the one more particularly implemented in one embodiment of the invention.
As indicated above, one possible arrangement of this system 41 is shown in
Several other gate arrangements are possible.
Either using the expression:
R
n+1
i
=Y
i+1·
or using the expression:
R
n+1
i
=U
i+1·[
Finally, according to the embodiment of the invention more particularly described here, a second series of equations is used which therefore implement the equations:
For this a final propagation module (referred to as MP) (see
the first stage 44 comprises a row of initial estimation modules (MI0 to MI4),
the second stage 45 comprises four rows of estimation/propagation modules (MEP10 to MEP15, MEP20 to MEP26, MEP30 to MEP37, MEP40 to MEP48),
the third stage 46 comprises an array of propagation modules (MPxx).
As regards the most significant bit, this is generated by an EXCLUSIVE OR cascade 47.
Finally, there is shown at 48 (
A description has also been given with reference to
In order to reduce the propagation time, the last propagation module stage can in fact be replaced by a “Carry-Look-Ahead” type stage 49 taking as an input the form of expression in Uni−1, Un−1i−1 and Rni−1 or the form of expression in Uni−1, en+1i+1 and Rni−1.
Here again, and as for
As regards
A first stage 51 comprising the initial estimation modules ME0i 52 is provided, which feeds the second stage 53 of estimation and propagation modules MEP1i 54, which itself feeds the third stage 55 of propagation modules MEPmi to give the product P.
One functional interpretation of the initial estimation modules 52 and estimation/propagation modules 54 is described in
These interpretations are a function of one way of expressing the equations implemented.
Other interpretations are of course possible for other expressions of the equations.
More precisely,
Using an estimation input En0 which feeds a multiplexer 60, on the one hand directly (link 58) and on the other hand via an estimation calculator 59, mixing is performed with the input y1, in order to obtain the initial estimate Un0.
As regards the carry Rn0, this is obtained using the inputs En−10 and En1 which feed a refinement calculation unit 61 as described above before activating a multiplexer 62 into which the input y1 is also introduced, in order to obtain in the end the carry Rn0.
As regards
Using the inputs Uni−1 and Rni−1 the correction in n of the values is performed (block 63) by application of the refinement.
The output 64 then feeds, on the one hand an estimation calculator 65, itself connected to the multiplexer 66, on the other hand (line 67) the same multiplexer (bit 0) into which the value yi+1 is also introduced, and finally a refinement calculator 67. The multiplexer 66 gives the value Uni.
As regards the carry Rn+1, this is obtained by means of a multiplexer 69 fed by the values Yi+1 and Rn−1i−1 and by the output of the calculator 68, and the propagation/refinement calculation circuit 70, a circuit itself having as inputs Un−1i−1, Uni−1 and Rni−1.
As is self-evident and established by what has gone before, this invention is not limited to the embodiments more particularly described. On the contrary it encompasses all the variants thereof and in particular those where the logic circuits are constituted differently for obtaining the same result.
An embodiment of this invention provides a multiplying method and circuit satisfying practical requirements better than those known previously, in particular in that it permits a particular property not present in the prior art, on account of the intermediate expression of the number calculated in a form of approximations with successive refinements. Such a form facilitates operational tests of the proposed circuit, and for a cost in general lower and a speed at the very least equivalent.
Although the present disclosure has been described with reference to one or more examples, workers skilled in the art will recognize that changes may be made in form and detail without departing from the scope of the disclosure and/or the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
0610142 | Nov 2006 | FR | national |
This Application is a Section 371 National Stage Application of International Application No. PCT/FR2007/000452, filed Mar. 15, 2007 and published as WO 2008/062106 on May 29, 2008, not in English.
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/FR2007/000452 | 3/15/2007 | WO | 00 | 8/31/2009 |