JP2551037B2 - Inverse arithmetic circuit - Google Patents
Inverse arithmetic circuitInfo
- Publication number
- JP2551037B2 JP2551037B2 JP62266019A JP26601987A JP2551037B2 JP 2551037 B2 JP2551037 B2 JP 2551037B2 JP 62266019 A JP62266019 A JP 62266019A JP 26601987 A JP26601987 A JP 26601987A JP 2551037 B2 JP2551037 B2 JP 2551037B2
- Authority
- JP
- Japan
- Prior art keywords
- value
- bits
- circuit
- multiplication
- bit
- 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.)
- Expired - Fee Related
Links
Description
【発明の詳細な説明】 〔産業上の利用分野〕 この発明は逆数演算回路に関する。The present invention relates to an inverse arithmetic circuit.
この発明は、逆数演算回路において、2の補数演算の
桁あふれを誤差修正演算に積極的に取り入れて必要最小
限の演算を行うことにより、全体の回路規模を小さくし
たものである。According to the present invention, in the reciprocal arithmetic circuit, the overflow of the two's complement arithmetic is positively incorporated into the error correction arithmetic to perform the minimum necessary arithmetic, thereby reducing the entire circuit scale.
値Xの逆数Y=1/Xを求め、この逆数Yを値Zに乗算
すれば、除算Z/Xを行うことができる。If the reciprocal number Y = 1 / X of the value X is obtained and the reciprocal number Y is multiplied by the value Z, the division Z / X can be performed.
そして、その逆数Yを求める場合、NR法(ニュートン
・ラフソン法)によれば、逆数Yを高速に求めることが
できるが、その逆数Yを求めるためのNR法の繰り返し演
算は、次式で与えられる。When obtaining the reciprocal number Y, the reciprocal number Y can be obtained at high speed by the NR method (Newton-Raphson method). However, the iterative calculation of the NR method for obtaining the reciprocal number Y is given by the following equation. To be
Y(n+1)=Y(n)(2−X・Y(n)) ・・・(i) そして、繰り返しがn回目の相対誤差ε(n)を用い
て、 Y(n)=1/X・(1+ε(n)) ・・・(ii) と表すと、(i)式は、 Y(n+1)=Y(n)(2−X・Y(n) ・・(i) ={1/X・(1+ε(n))}〔2−X{1/X・(1+
ε(n)}〕 =1/X・(1+ε(n)){2−(1+ε(n)} =1/X・(1+ε(n))(1−ε(n)) =1/X・{1−(ε(n))2} =1/X(1+ε(n+1)) ε(n+1)=−(ε(n))2 となり、誤差ε(n)は繰り返しの1回ごとに2乗され
て小さくなるので、値Y(n+1)は高速に真値へと収束して
いく。Y (n + 1) = Y (n) (2-X · Y (n) ) (i) Then, using the relative error ε (n) at the n-th iteration, Y (n) = 1 / X · (1 + ε (n) ) (ii), the equation (i) becomes Y ( n) n + 1) = Y (n) (2-X · Y (n) · · (i) = {1 / X · (1 + ε (n) )} [2-X {1 / X · (1+
ε (n) }] = 1 / X · (1 + ε (n) ) {2- (1 + ε (n) } = 1 / X · (1 + ε (n) ) (1-ε (n) ) = 1 / X · {1- (ε (n) ) 2 } = 1 / X (1 + ε (n + 1) ) ε (n + 1) =-(ε (n) ) 2 and the error ε (n) is squared at each iteration. As a result, the value Y (n + 1) rapidly converges to the true value.
第6図は、このNR法により逆数Y(=1/X)を求める
ためのデジタル演算回路を示す。FIG. 6 shows a digital operation circuit for obtaining the reciprocal Y (= 1 / X) by the NR method.
すなわち、デジタルの値Xが、ROM(1)において値
Xに対応した初期値Y(0)に変換され、この値Y(0)がマル
チプレクサ(2)を通じて乗算回路(3)に供給されて
値Xとの積X・Y(n)(今の場合には、n=0)が算出さ
れ、さらに、この積が減算回路(4)に供給されて定数
「2」との差(2−X・Y(n))が算出される。That is, the digital value X is converted into the initial value Y (0) corresponding to the value X in the ROM (1), and this value Y (0) is supplied to the multiplication circuit (3) through the multiplexer (2) to obtain the value. The product X · Y (n) (n = 0 in this case) is calculated, and this product is supplied to the subtraction circuit (4) to calculate the difference (2-X) from the constant “2”.・ Y (n) ) is calculated.
そして、この差が乗算回路(5)に供給されてROM
(1)からの値Y(0)との積、すなわち、 Y(n)(2−X・Y(n))=Y(n+1) ただし、今の場合、n=0 が算出され、この積Y(n+1)がレジスタ(6)に供給され
て次の繰り返し計算時まで保持される。Then, this difference is supplied to the multiplication circuit (5) and the ROM
The product with the value Y (0 ) from (1), that is, Y (n) (2-X · Y (n) ) = Y (n + 1) However, in this case, n = 0 is calculated, This product Y (n + 1) is supplied to the register (6) and held until the next iterative calculation.
そして、以後、マルチプレクサ(2)は図とは逆の状
態に切り換えられ、(n+1)回目の繰り返し計算時に
は、レジスタ(6)からの値Y(n)がマルチプレクサ
(2)を通じて乗算回路(3),(5)に供給される。Then, after that, the multiplexer (2) is switched to a state opposite to that shown in the figure, and during the (n + 1) th iteration calculation, the value Y (n) from the register (6 ) is passed through the multiplexer (2) to the multiplication circuit (3). , (5).
したがって、乗算回路(3)からは値Y(n+1)が取り出
されるとともに、繰り返し数nがある値に達したとき、
値Y(n+1)は必要な精度の逆数Yとなる。Therefore, when the value Y (n + 1) is taken out from the multiplication circuit (3) and the number of repetitions n reaches a certain value,
The value Y (n + 1) is the reciprocal Y of the required precision.
ところが、この演算回路においては、2つの乗算回路
(3),(5)を必要とするので、全体の回路規模が大
きくなってしまう。However, since this arithmetic circuit requires two multiplication circuits (3) and (5), the overall circuit scale becomes large.
すなわち、今、値Xがiビット、値Y(n)がjビットと
すると、乗算回路(3)はiビットとjビットとの乗算
を行うので、(i+j)ビットの語長となり、乗算回路
(5)は(i+j)ビットjビットとの乗算を行うの
で、(i+2j)ビットの語長を必要とする。That is, assuming that the value X is i bits and the value Y (n) is j bits, the multiplication circuit (3) multiplies i bits and j bits, resulting in a word length of (i + j) bits. Since (5) performs multiplication with (i + j) bits and j bits, it requires a word length of (i + 2j) bits.
そして、例えば、浮動小数点演算においては、i=24
ビット程度なので、乗算回路(3),(5)の語長は非
常に長くなってしまい、この結果、乗算回路(3),
(5)が非常に大規模になるとともに、消費電力あるい
は発熱もかなりの大きさとなってしまう。Then, for example, in floating point arithmetic, i = 24
Since it is about bits, the word lengths of the multiplication circuits (3) and (5) become very long, and as a result, the multiplication circuits (3) and (5)
As (5) becomes very large in scale, power consumption or heat generation also becomes considerably large.
この発明は、このような問題点を解決しようとするも
のである。The present invention is intended to solve such a problem.
今、(i)式を変形すると、次のようになる。 Now, when the equation (i) is transformed, it becomes as follows.
Y(n+1)=Y(n)(2−X・Y(n)) ・・(i) =2Y(n)−X・(Y(n))2 =Y(n)−Y(n)(Y(n)・X−1) ・・(iii) ここで、この(iii)式において、右辺の第1項は、
前回の演算結果を示し、第2項は、今回の演算結果と、
前回の演算結果との誤差あるいはその修正量を示す。Y (n + 1) = Y (n) (2-X · Y (n) ) ··· (i) = 2Y (n) −X · (Y (n) ) 2 = Y (n) −Y (n ) (Y (n) · X−1) ··· (iii) Here, in the equation (iii), the first term on the right side is
The previous calculation result is shown, and the second term is the calculation result of this time,
Indicates the error from the previous calculation result or its correction amount.
一方、(ii)式は、 Y(n)=1/X・(1+ε(n)) ・・・(ii) であるから、次式が成り立つ。On the other hand, since the equation (ii) is Y (n) = 1 / X · (1 + ε (n) ) (ii), the following equation holds.
Y(n)・X=1+ε(n) ・・・(iv) そして、この(iv)式において、 |ε(n)|<2-k とすれば、(iv)式の左辺は、ε(n)0のとき、 となり、ε(n)<0のとき、 となる。すなわち、 であり、上位からkビットを求める必要はなく、小数点
以下第k位から下位を求めればよいことが判る。Y (n) · X = 1 + ε (n) (iv) Then, in this equation (iv), if | ε (n) | <2- k , the left side of the equation (iv) is ε ( n) When 0, And when ε (n) <0, Becomes That is, Therefore, it is understood that it is not necessary to obtain k bits from the high order, and the low order can be obtained from the kth place after the decimal point.
また、(iv)式を変形すると、 Y(n)・X−1=ε(n) ・・・(vi) となり、これは(iii)式の右辺の第2項のカッコ内で
もあるが、この(vi)式は、ε(n)0のとき、 となり、ε(n)<0のとき、 となる。すなわち2の補数により表現すると、 Y(n)・X−1=−S・2-k+P-k-1・2-k-1+P-k-2・2
-k-2+ ・・・(vii) となり、やはり上位からkビットを求める必要はなく、
小数点以下第k位から下位を求めればよいことになる。Further, when the equation (iv) is modified, Y (n) · X−1 = ε (n) ... (vi), which is also in the parentheses of the second term on the right side of the equation (iii), This equation (vi) is expressed as follows when ε (n) 0 And when ε (n) <0, Becomes That is, when expressed by a two's complement, Y (n) .X-1 = -S.2- k + P- k- 1.2-k-1 + P- k-2.2
-k-2 + ... (vii), so again there is no need to find k bits from the higher order,
It is only necessary to obtain the lower order from the kth place after the decimal point.
この発明は、以上の点に着目して乗算回路を簡略化し
たものである。The present invention focuses on the above points and simplifies the multiplication circuit.
乗算回路の語長が短かくなる。 The word length of the multiplication circuit becomes short.
第1図において、iビットのデジタル値Xが、乗算回
路(3)に供給されるとともに、ROM(1)に供給され
て値Xに対応したjビットの初期値Y(0)に変換され、こ
の値Y(0)がマルチプレクサ(2)を通じて乗算回路
(3)に供給され、乗算回路(3)からは両入力値の積
Y(n)・X(今の場合は、n=0)の下位の(i+j−
k)ビットが取り出され、この積が加算回路(7)に供
給されて定数「−1」が加算され、加算回路(7)から
は両入力値の和(Y(n)・X−1)の下位の(i+j−
k)ビットが取り出される。In FIG. 1, an i-bit digital value X is supplied to a multiplication circuit (3) and is also supplied to a ROM (1) to be converted into a j-bit initial value Y (0) corresponding to the value X, This value Y (0) is supplied to the multiplication circuit (3) through the multiplexer (2), and the product of both input values is supplied from the multiplication circuit (3).
The lower (i + j−) of Y (n) · X (n = 0 in this case)
k) bits are taken out, this product is supplied to the adder circuit (7) and the constant “−1” is added, and the sum (Y (n) · X−1) of both input values is added from the adder circuit (7). Lower (i + j-
k) Bits are taken.
なお、この場合、一例を後述するが、乗算回路(3)
と加算回路(7)とは一体化して積和回路とすることが
できる。In this case, the multiplication circuit (3) will be described as an example later.
And the adder circuit (7) can be integrated into a sum-of-products circuit.
そして、加算回路(7)の(i+j−k)ビットの出
力値が乗算回路(5)に供給されるとともに、ROM
(1)からの値Y(0)がマルチプレクサ(2)を通じて乗
算回路(5)に供給され、乗算回路(5)からは両入力
値の(i+2j−k)ビット以下の積Y(n)(Y(n)・X−
1)(今の場合は、n=0)が取り出される。Then, the output value of the (i + j−k) bits of the adder circuit (7) is supplied to the multiplier circuit (5) and the ROM
The value Y (0 ) from (1) is supplied to the multiplication circuit (5) through the multiplexer (2), and from the multiplication circuit (5) the product Y (n) (of less than (i + 2j−k) bits of both input values is obtained. Y (n) / X-
1) (n = 0 in this case) is taken out.
そして、この積が減算回路(4)に供給されるととも
に、ROM(1)からのjビットの初期値Y(0)がマルチプ
レクサ(2)を通じて減算回路(4)に供給され、減算
回路(4)からは両入力値iビットの差、 Y(n+1)=Y(n)(2−Y(n)・X)∵(iii)式 ただし、今の場合、n=0 が取り出され、この値Y(n+1)がレジスタ(6)に供給さ
れて次の繰り返し計算時まで保持される。Then, this product is supplied to the subtraction circuit (4), and the j-bit initial value Y (0) from the ROM (1) is supplied to the subtraction circuit (4) through the multiplexer (2). ), The difference between both input values i bits, Y (n + 1) = Y (n) (2-Y (n) · X) ∵ (iii) Equation, However, in this case, n = 0 is extracted, This value Y (n + 1) is supplied to the register (6) and held until the next iterative calculation.
そして、以後、マルチプレクサ(2)は図とは逆の状
態に切り換えられ、(n+1)回目の繰り返し計算時に
は、レジスタ(6)からの値Y(n)がマルチプレクサ
(2)を通じて回路(3)〜(5)に供給される。After that, the multiplexer (2) is switched to a state opposite to that shown in the figure, and the value Y (n) from the register (6 ) is passed through the multiplexer (2) to the circuits (3) to It is supplied to (5).
したがって、減算回路(4)からは値Y(n+1)が取り出
されるとともに、繰り返し数nがある値に達したとき、
値Y(n+1)は必要な精度の逆数Yとなる。Therefore, when the value Y (n + 1) is taken out from the subtraction circuit (4) and the number of repetitions n reaches a certain value,
The value Y (n + 1) is the reciprocal Y of the required precision.
こうして、値Xの逆数Yが演算されるが、この場合、
特にこの発明によれば、(iii)式に基づいて逆数Yを
求めるとともに、このとき、(iii)式の右辺の第2項
は、(v),(vii)式に示すように、小数点以下第k
位から下位だけを求めればよく、上位のkビットを求め
る必要がないので、乗算回路(3)は、その入力のビッ
ト数i,jに対して(i+j−k)ビットだけを出力すれ
ばよく、したがって、乗算回路(3)の規模を小さくで
きるとともに、消費電力や発熱を小さくできる。Thus, the reciprocal Y of the value X is calculated. In this case,
In particular, according to the present invention, the reciprocal Y is obtained based on the equation (iii), and at this time, the second term on the right side of the equation (iii) is a decimal point as shown in the equations (v) and (vii). The k th
Since it is only necessary to obtain the lower bits from the order and it is not necessary to obtain the upper k bits, the multiplication circuit (3) needs to output only (i + j−k) bits for the number of input bits i, j. Therefore, the scale of the multiplication circuit (3) can be reduced, and power consumption and heat generation can be reduced.
また、乗算回路(3)において乗算を行うとき、上位
ビットへのキャリビットの伝播時間を節約できるので、
乗算の処理速度を速くでき、結果として逆数回路全体の
演算速度を速くできる。Further, when carrying out multiplication in the multiplication circuit (3), it is possible to save the propagation time of the carry bit to the upper bits,
The processing speed of multiplication can be increased, and as a result, the operation speed of the entire reciprocal circuit can be increased.
さらに、乗算回路(3)の出力語長が(i+j−k)
ビットになるので、乗算回路(5)の出力語長もkビッ
ト少ない(i+2j−k)ビットとなる。しかも、この場
合、入力値Xがiビットであるから出力値Y(n+1)の有効
ビット数もiビットであり、したがって、実際には、乗
算回路(5)の下位ビットの乗算はある程度省略でき、
すなわち、乗算回路(5)の出力語長は(i+2j−k)
ビットよりもさらに少ないビット数にできる。したがっ
て、乗算回路(5)も規模を小さくでき、消費電力や発
熱を小さくできるとともに、全体の演算速度を向上させ
ることができる。Furthermore, the output word length of the multiplication circuit (3) is (i + j−k)
Since it becomes bits, the output word length of the multiplication circuit (5) is also reduced by k bits to (i + 2j-k) bits. Moreover, in this case, since the input value X is i bits, the number of effective bits of the output value Y (n + 1) is also i bits. Therefore, in practice, the multiplication of the lower bits of the multiplication circuit (5) is to some extent. Can be omitted,
That is, the output word length of the multiplication circuit (5) is (i + 2j-k)
The number of bits can be smaller than the number of bits. Therefore, the multiplication circuit (5) can also be downsized, power consumption and heat generation can be reduced, and the overall calculation speed can be improved.
第2図は、浮動小数点の逆数を求める場合に、NR法が
1回で収束するとき、すなわち、n=0で必要な精度が
得られるときの一例を示す。FIG. 2 shows an example of the case where the NR method converges in one time, that is, the required accuracy is obtained when n = 0, when obtaining the reciprocal of the floating point.
ただし、この例においては、入力値は、符号Sが1ビ
ット、指数部EXPが2の補数表現による7ビット、仮数
部MANTが24ビット(i=24)で、1MANT<2に正規化
されてそのMSBは“1"とする。また、ROM(1)による初
期値Y(0)は13ビット(j=13)で、そのMSBが“1"であ
り、|ε(0)|<2-12(k=12)とする。However, in this example, the input value is 1 bit for the sign S, 7 bits for the exponent part EXP in 2's complement representation, 24 bits for the mantissa part MANT (i = 24), and is normalized to 1MANT <2. Its MSB shall be "1". The initial value Y (0 ) by the ROM (1) is 13 bits (j = 13), its MSB is "1", and | ε (0) | <2 -12 (k = 12).
まず、符号Sは、逆数演算しても変化しないので、そ
のまま取り出される。First, since the code S does not change even if the reciprocal operation is performed, it is taken out as it is.
また、指数部EXPは、2の補数による演算なので、入
力値EXPを−1部すればよく、これには、入力値EXPのす
べてのビットを反転してLSBに“1"を加算すればよい。
しかし、仮数部MANTを正規化するとき、指数部EXPから
“1"を減算する必要があるので、結局、入力値EXPは、
インバータ(9)によりすべてのビットが反転されて取
り出される。Further, since the exponent part EXP is an operation based on 2's complement, it is sufficient to add -1 part to the input value EXP, and all bits of the input value EXP are inverted and “1” is added to LSB. .
However, when normalizing the mantissa part MANT, it is necessary to subtract “1” from the exponent part EXP, so the input value EXP is
All bits are inverted and taken out by the inverter (9).
さらに、仮数部MANT(=X)であるが、その逆数を求
める過程を、第3図に図解しながら説明する。なお、同
図中、横長の枠は、各回路の演算途中ないし演算結果の
値を示すものであり、空欄は演算にしたがって“0"また
は“1"となる。Further, the process of obtaining the reciprocal of the mantissa MANT (= X) will be described with reference to FIG. In the figure, a horizontally long frame indicates a value in the middle of calculation or a calculation result of each circuit, and blanks are “0” or “1” according to the calculation.
すなわち、入力値Xは24ビット(i=24)であり、1
X<2に正規化されてMSBは“1"である(同図A)。
そして、この値Xの上位13ビットが取り出され(同図
B)、この13ビットがROM(1)に供給されて初期値Y
(0)に変換される(同図C)。That is, the input value X is 24 bits (i = 24), and 1
Normalized to X <2, the MSB is "1" (A in the figure).
Then, the upper 13 bits of this value X are taken out (B in the same figure), and these 13 bits are supplied to the ROM (1) to generate the initial value Y.
It is converted to (0) (C in the same figure).
この場合、1X<2であるから、値Y(0)のMSBは
“0"、小数点以下第1位は“1"になるので、ROM(1)
に入力される13ビットのうちのMSB(=“1")がそのま
ま値Y(0)の小数点以下第1位として使用され、値Y(0)の
MSBは“0"にセットされる。また、これによりROM(1)
は12ビットを入力して12ビットを出力すればよいので、
ROM(1)の容量は、12ビット×212番地となり、値Y(0)
は13ビット長(小数点以下についてj=13)となる。In this case, since 1X <2, the MSB of the value Y (0) is "0", and the first decimal place is "1", so ROM (1)
MSB of the 13 bits input (= "1") is directly used as the first decimal place of the value Y (0), the value Y (0)
MSB is set to “0”. In addition, this allows ROM (1)
Needs to input 12 bits and output 12 bits,
The capacity of ROM (1) is 12 bits x 2 12 addresses, and the value Y (0)
Has a length of 13 bits (j = 13 below the decimal point).
そして、n=0で必要な精度が得られる場合なので、
この値Y(0)が乗算回路(3)に供給されるとともに、値
Xが乗算回路(3)に供給されてこれらの積Y(0)・Xが
取り出される。And, since the required accuracy is obtained with n = 0,
The value Y (0) is supplied to the multiplication circuit (3), and the value X is supplied to the multiplication circuit (3) to extract the product Y (0) · X thereof.
第3図Dは、この乗算の様子を示すもので、この図に
おいて、Ym(m=1〜13)は、値Y(0)の小数点以下第m
位のビットを示し、X・YmはそのビットYmと値Xとの積
を示す。したがって、値Y(0)の下位ビットとの乗算にな
るにつれて値X・Ymは1ビットずつ下位方向へずれてい
く。そして、値Y(0)の各ビットY1〜Y13と値Xとの各積
が加算されて値Y(0)とXとの積Y(0)・Xが取り出される
(同図E)。FIG. 3D shows the state of this multiplication. In this figure, Ym (m = 1 to 13) is the number m after the decimal point of the value Y (0) .
The position bit is shown, and X · Ym shows the product of the bit Ym and the value X. Therefore, as the value Y (0) is multiplied by the lower bits, the value X · Ym shifts downward by one bit. Then, the products of the respective bits Y 1 to Y 13 of the value Y (0) and the value X are added to obtain the product Y (0) · X of the value Y (0) and X (E in the figure). .
ただし、この場合、(v)式で述べたように、積Y(0)
・Xの上位からkビットは演算の必要がなく、小数点以
下第k位から下位のビット、この例においては、斜線を
つけた第12位から下位の25ビット(=i+j−k)が乗
算出力Uとして取り出される(同図E)。However, in this case, as described in equation (v), the product Y (0)
The upper k bits of X do not need to be calculated, and the kth to the lower bits below the decimal point, in this example, the 25th bits from the 12th to the lower bits (= i + j-k), which are shaded, are multiplied and output. It is taken out as U (E in the figure).
そして、この値Uが加算回路(7)に供給されるとと
もに、定数「−1」が加算回路(7)に供給されて両入
力の和、すなわち、(vii)式で示される値Vが算出さ
れる(同図F)。なお、この差も、この例においては、
25ビット長であるが、乗算回路(3)において上位kビ
ットの演算を省略しているので、加算回路(7)の出力
は、小数点の位置がkビット、すなわち、12ビットずれ
ている。Then, this value U is supplied to the adder circuit (7), and a constant “−1” is supplied to the adder circuit (7) to calculate the sum of both inputs, that is, the value V represented by the equation (vii). (FIG. F). Note that this difference is also in this example,
Although the length is 25 bits, the multiplication circuit (3) omits the calculation of the upper k bits, so that the output of the addition circuit (7) has a decimal point position of k bits, that is, 12 bits.
そして、この加算値Vが、乗算回路(5)に供給され
るとともに、値Y(0)(同図C)が乗算回路(5)に供給
されてこれらの積Y(0)・Vが取り出される。Then, the added value V is supplied to the multiplication circuit (5) and the value Y (0) (Fig. C) is supplied to the multiplication circuit (5) to extract the product Y (0) · V. Be done.
第3図Gは、その乗算の様子を示すもので、値Y1〜Y
13は、同図Dと同じであり、V・YmはビットYmと値Vと
の積を示す。そして、これらビットY1〜Y13と値Vとの
各積が加算されて積Y(0)・Vが取り出される(同図
H)。FIG. 3G shows the state of the multiplication, and the values Y 1 to Y
13 is the same as D in the same figure, and V · Ym represents the product of the bit Ym and the value V. Then, the products of these bits Y 1 to Y 13 and the value V are added to obtain the product Y (0) · V (H in the same figure).
この場合、値Y(0)は13ビットであるから、積Y(0)・V
は、上位13ビットまでが有効であり、したがって、積Y
(0)・Vは、例えば、上位17ビットまでが計算されて14
ビット目で丸められ、斜線をつけた上位13ビットが乗算
出力W(=Y(0)・V)として取り出される(同図H)。In this case, the value Y (0) is 13 bits, so the product Y (0) · V
Up to the upper 13 bits are valid, so the product Y
For (0) · V, for example, the upper 17 bits are calculated and 14
The upper 13 bits rounded at the bit and shaded are taken out as the multiplication output W (= Y (0) · V) (H in the figure).
そして、この値Wが減算回路(4)に供給されるとと
もに、値Y(0)が減算回路(4)に供給されて両者の差、
すなわち、逆数Yが24ビット長で取り出される(同図
I)。Then, the value W (0) is supplied to the subtraction circuit (4) while the value W is supplied to the subtraction circuit (4), and the difference between the two,
That is, the reciprocal Y is extracted with a length of 24 bits (I in the same figure).
第4図は乗算回路(3)の一例を示し、アンド回路群
(31)によりX・Ymの乗算が行われ、その乗算結果が加
算回路(32)により加算されて積Uが取り出される。FIG. 4 shows an example of the multiplication circuit (3). The AND circuit group (31) multiplies X.Ym, and the multiplication result is added by the addition circuit (32) to obtain the product U.
また、第5図は、乗算回路(5)および加算回路
(4)の一例を示し、やはり、アンド回路群(51)によ
りYm・Vの乗算が行われ、その乗算結果およびYmが加算
回路(52)により加算されて逆数Yが取り出される。FIG. 5 shows an example of the multiplication circuit (5) and the addition circuit (4). Again, the AND circuit group (51) multiplies Ym · V, and the multiplication result and Ym are added to the addition circuit ( 52) is added and the reciprocal Y is taken out.
なお、上述において、除算Z/Xを行う場合には、減算
回路(4)の出力値Y(n+1)と、値Zとの乗算を行えばよ
い。In the above description, when the division Z / X is performed, the output value Y (n + 1) of the subtraction circuit (4) may be multiplied by the value Z.
この発明によれば、(iii)式に基づいて逆数Yを求
めるとともに、このとき、(iii)式の右辺の第2項
は、(v),(vii)式に示すように、小数点以下第k
位から下位だけを求めればよく、上位のkビットを求め
る必要がないので、乗算回路(3)は、その入力のビッ
ト数i,Jに対して(i+j−k)ビットだけを出力すれ
ばよく、したがって、乗算回路(3)の規模を小さくで
きるとともに、消費電力や発熱を小さくできる。According to the present invention, the reciprocal number Y is obtained based on the equation (iii), and at this time, the second term on the right side of the equation (iii) is calculated as shown in the equations (v) and (vii). k
Since it is only necessary to obtain the lower bits from the order and it is not necessary to obtain the upper k bits, the multiplication circuit (3) needs to output only (i + j−k) bits for the number of input bits i, J. Therefore, the scale of the multiplication circuit (3) can be reduced, and power consumption and heat generation can be reduced.
また、乗算回路(3)において乗算を行うとき、上位
ビットへのキャリビットの伝播時間を節約できるので、
乗算の処理速度を速くでき、結果として逆数回路全体の
演算速度を速くできる。Further, when carrying out multiplication in the multiplication circuit (3), it is possible to save the propagation time of the carry bit to the upper bits,
The processing speed of multiplication can be increased, and as a result, the operation speed of the entire reciprocal circuit can be increased.
さらに、乗算回路(3)の出力語長が(i+j−k)
ビットになるので、乗算回路(5)の出力語長もkビッ
ト少ない(i+2j−k)ビットとなる。しかも、この場
合、入力値Xがiビットであるから出力値Y(n+1)の有効
ビット数もiビットであり、したがって、実際には、乗
算回路(5)の下位ビットの乗算はある程度省略でき、
すなわち、乗算回路(5)の出力語長は(i+2j−k)
ビットよりもさらに少ないビット数にできる。したがっ
て、乗算回路(5)も規模を小さくでき、消費点力や発
熱を小さくできるとともに、全体の演算速度を向上させ
ることができる。Furthermore, the output word length of the multiplication circuit (3) is (i + j−k)
Since it becomes bits, the output word length of the multiplication circuit (5) is also reduced by k bits to (i + 2j-k) bits. Moreover, in this case, since the input value X is i bits, the number of effective bits of the output value Y (n + 1) is also i bits. Therefore, in practice, the multiplication of the lower bits of the multiplication circuit (5) is to some extent. Can be omitted,
That is, the output word length of the multiplication circuit (5) is (i + 2j-k)
The number of bits can be smaller than the number of bits. Therefore, the multiplication circuit (5) can be reduced in scale, consumption power and heat generation can be reduced, and the overall calculation speed can be improved.
第1図,第2図はこの発明の一例の系統図、第3図〜第
6図はその説明のための図である。 (1)はROM、(3),(5)は乗算回路である。1 and 2 are system diagrams of an example of the present invention, and FIGS. 3 to 6 are diagrams for explaining the same. (1) is a ROM, and (3) and (5) are multiplication circuits.
Claims (1)
・ラフソン法により算出する逆数演算回路において、 iビットの上記入力値Xをjビットの初期値Y(0)に変換
するROMと、 上記iビットの入力値Xとjビットの値Y(n)との乗算を
行い、下位の(i+j−k)ビットの乗算値を出力し、
この(i+j−k)ビットの乗算値と−1との加算を行
い、(i+j−k)ビットの加算値を出力する積和回路
と、 上記(i+j−k)ビットの加算値と上記jビットの値
Y(n)との乗算を行い、(i+2j−k)ビット以下の乗算
値を出力する乗算回路と、 上記(i+2j−k)ビット以下の乗算値と上記jビット
の値Y(n)との減算を行い、iビットの上記逆数Yを出力
する減算回路と、 からなることを特徴とする逆数演算回路。1. A reciprocal arithmetic circuit for calculating the reciprocal Y (= 1 / X) of an input value X by the Newton-Raphson method, wherein the i-bit input value X is converted into a j-bit initial value Y (0) . The ROM is multiplied by the i-bit input value X and the j-bit value Y (n), and the lower (i + j−k) -bit multiplication value is output.
A product-sum circuit that adds the (i + j-k) -bit multiplication value and -1 and outputs the (i + j-k) -bit addition value, and the (i + j-k) -bit addition value and the j-bit value. The value of the
A multiplication circuit that multiplies Y (n) and outputs a multiplication value of (i + 2j-k) bits or less, and a multiplication value of (i + 2j-k) bits or less and the j-bit value Y (n) And a subtraction circuit for performing subtraction and outputting the above-mentioned reciprocal Y of i bits.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP62266019A JP2551037B2 (en) | 1987-10-21 | 1987-10-21 | Inverse arithmetic circuit |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP62266019A JP2551037B2 (en) | 1987-10-21 | 1987-10-21 | Inverse arithmetic circuit |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH01108633A JPH01108633A (en) | 1989-04-25 |
| JP2551037B2 true JP2551037B2 (en) | 1996-11-06 |
Family
ID=17425246
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP62266019A Expired - Fee Related JP2551037B2 (en) | 1987-10-21 | 1987-10-21 | Inverse arithmetic circuit |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2551037B2 (en) |
-
1987
- 1987-10-21 JP JP62266019A patent/JP2551037B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPH01108633A (en) | 1989-04-25 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US6763368B2 (en) | Method and apparatus for performing single-cycle addition or subtraction and comparison in redundant form arithmetic | |
| Kanhe et al. | Design and implementation of floating point multiplier based on vedic multiplication technique | |
| JPH0375901B2 (en) | ||
| JPH0368416B2 (en) | ||
| JP3345894B2 (en) | Floating point multiplier | |
| JP2608165B2 (en) | Method and apparatus for multiplying a real-time two's complement code in a digital signal processing system | |
| US4590584A (en) | Method and system for processing exponents in floating-point multiplication | |
| JP2551037B2 (en) | Inverse arithmetic circuit | |
| Bharghava Ram Dinesh et al. | Design and implementation of high speed 32-bit mac unit | |
| JP2000347835A (en) | Square calculation method and square calculation device | |
| US5012439A (en) | Method and apparatus for performing division | |
| Hosseinzadeh et al. | An improved reverse converter for the moduli set {2n-1, 2n, 2n+ 1, 2n+ 1-1} | |
| US4563749A (en) | Floating point digital differential analyzer | |
| JP2645422B2 (en) | Floating point processor | |
| JP2737933B2 (en) | Division device | |
| US5416733A (en) | Apparatus for finding quotient in a digital system | |
| JP2606339B2 (en) | Multiplier | |
| JPH0251732A (en) | Floating point computing element | |
| JP2705162B2 (en) | Arithmetic processing unit | |
| JP2820701B2 (en) | Conversion method to binary | |
| JP3461252B2 (en) | Multiplication method | |
| RU2449354C1 (en) | Vector normalising apparatus | |
| JPH029366B2 (en) | ||
| JPH0455936A (en) | Reciprocal calculation circuit | |
| JPS6359170B2 (en) |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| LAPS | Cancellation because of no payment of annual fees |