JPH0251732A - Floating point computing element - Google Patents

Floating point computing element

Info

Publication number
JPH0251732A
JPH0251732A JP63201891A JP20189188A JPH0251732A JP H0251732 A JPH0251732 A JP H0251732A JP 63201891 A JP63201891 A JP 63201891A JP 20189188 A JP20189188 A JP 20189188A JP H0251732 A JPH0251732 A JP H0251732A
Authority
JP
Japan
Prior art keywords
circuit
data
output
division
divisor
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.)
Granted
Application number
JP63201891A
Other languages
Japanese (ja)
Other versions
JP2578482B2 (en
Inventor
Akira Katsuno
昭 勝野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP63201891A priority Critical patent/JP2578482B2/en
Priority to US07/374,299 priority patent/US4999801A/en
Priority to KR1019890010030A priority patent/KR920005226B1/en
Priority to DE68929114T priority patent/DE68929114T2/en
Priority to EP89307180A priority patent/EP0351242B1/en
Publication of JPH0251732A publication Critical patent/JPH0251732A/en
Application granted granted Critical
Publication of JP2578482B2 publication Critical patent/JP2578482B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PURPOSE:To perform the division of floating points at a high speed by calculating 2-BXi necessary for a divisor based on a convergent method in a comparatively short time just with the simple improvement of a floating point multiplier. CONSTITUTION:A multiplication circuit 1, a bit inverting circuit 2 and an addi tion circuit 4 calculates 2-BXi which is necessary when the floating point divi sion of A/B is carried out based on a convergent method. In this case, 0<BXi<=1 (i=0, 1...) is satisfied and X0 and Xi show the initial value of the reciprocal of a divisor and the i-th approximate value of the reciprocal of the divisor. Then the circuit 1 calculates Xi+1=Xi (2-BXi) which points the approximate value of the reciprocal of said divisor. Then the data on Xi+1 obtained by repeating each calculation by the prescribed frequency is applied to the circuit 1 together with the data A on a dividend. In such a way, the division of A/B is carried out. As a result, the division of floating points can be performed at a high speed.

Description

【発明の詳細な説明】 〔概 要〕。[Detailed description of the invention] 〔overview〕.

浮動小数点演算器、特に、浮動小数点表記法の数値につ
いて除算処理を行う技術に関し、収束法に基づき除数の
逆数を求める際に行う反復計算を高速化し、ひいては浮
動小数点除算の高速処理を実現することを目的とし、 浮動小数点表記法による2進の2つのデータに対して該
データの仮数部の乗算を行い、正規化処理を施して出力
する乗算回路と、該乗算回路から出力されたデータの各
ビットを反転させるビット反転回路と、該ビット反転回
路の出力と該乗算回路の出力のいずれか一方を制御信号
に応答して選択する回路と、該選択回路において前記乗
算回路の出力が選択された時は所定の丸めモード信号に
応答して該出力の丸め処理を行い、該選択回路において
前記ビット反転回路の出力が選択された時は前記制御信
号に応答して該出力の最下位ビットに1を加算し、それ
ぞれ得られた値に対し正規化処理を施して出力する加算
回路とを具備し、収束法に基づきA/Bの浮動小数点除
算を行う際に必要な2−BXi、ただし、Q<BX(≦
1 (i=0、l、・・・・・・)、Xoは除数の逆数
の初期値、X、は除数の逆数のi番目の近似値、の計算
を前記乗算回路、ビット反転回路および加算回路によっ
て行い、次いで該除数の逆数の近似値を指示するXi、
、 =Xi (2−BXi ) (7)計算ヲ該乗31
1回路によって行い、それぞれの計算を所定回数だけ繰
り返し実行して得られるX、。1のデータを被除数のデ
ータAと共に該乗算回路に印加することで前記A/Bの
除算を行うように構成する。
To speed up the iterative calculation performed when calculating the reciprocal of a divisor based on a convergence method, and to realize high-speed processing of floating-point division, regarding a floating-point arithmetic unit, in particular, technology for performing division processing on numerical values in floating-point notation. For the purpose of a bit inversion circuit that inverts bits; a circuit that selects either the output of the bit inversion circuit or the output of the multiplication circuit in response to a control signal; and the output of the multiplication circuit is selected in the selection circuit. When the output is rounded in response to a predetermined rounding mode signal, and when the output of the bit inversion circuit is selected in the selection circuit, the least significant bit of the output is set to 1 in response to the control signal. 2-BXi, which is necessary when performing A/B floating point division based on the convergence method, <BX(≦
1 (i=0, l,...), Xo is the initial value of the reciprocal of the divisor, X is the i-th approximation of the reciprocal of the divisor, and the calculation is performed using the multiplication circuit, bit inversion circuit, and addition. Xi, which is performed by a circuit and then indicates an approximation of the reciprocal of the divisor;
, =Xi (2-BXi) (7) Calculate the corresponding power 31
X, which is obtained by performing each calculation a predetermined number of times using one circuit. The multiplication circuit is configured to perform the division of A/B by applying data of 1 together with data A of the dividend to the multiplication circuit.

〔産業上の利用分野〕[Industrial application field]

本発明は、浮動小数点演算器に関し、特に、浮動小数点
表記法の数値について除算処理を行う技術に関する。
The present invention relates to a floating-point arithmetic unit, and particularly to a technique for performing division processing on numerical values in floating-point notation.

浮動小数点演算は、整数演算と比べ、ダイナミック・レ
ンジが広くかつ精度も高い。そのため、最近では各種の
高度な演算要求に沿うようなものが求められる傾向にあ
り、中でも、除算に関する高速処理が重要になってきて
いる。
Floating point arithmetic has a wider dynamic range and higher precision than integer arithmetic. For this reason, there has been a recent trend toward demands for devices that meet various sophisticated calculation requirements, and in particular, high-speed processing regarding division has become important.

[従来の技術〕 従来の除算の方式は、浮動小数点に限らず、大別して2
つの方法、すなわち■減算とシフト演算を用いる方法、
■ニュートン・ラプソン法等の収束法を用いる方法、に
分けられる。■の方法は、シフト操作を行った除数を被
除数から繰り返して滅じていく方法であり、その−例と
して、引き離し法が知られている。また、この引き離し
法を改良した方法としてSRT法が知られているが、こ
れは、より高速に商を得ることができるという利点を有
している。一方、“■の方法は、除数の逆数を収束法に
基づく計算によって求め、それに被除数を乗じることに
よって商を得るものである。この場合、収束までに要す
る繰り返し演算回数は、逆数の初期値が真の値に近いほ
ど少なくなる。
[Prior art] Conventional division methods are not limited to floating point numbers, but can be roughly divided into two types.
Two methods are used: ■ Method using subtraction and shift operations;
■Methods that use convergence methods such as the Newton-Raphson method. Method (2) is a method in which the divisor subjected to the shift operation is repeatedly subtracted from the dividend, and the separation method is known as an example thereof. Furthermore, the SRT method is known as an improved method of this separation method, but this method has the advantage of being able to obtain the quotient faster. On the other hand, the method "■" calculates the reciprocal of the divisor by calculation based on the convergence method, and obtains the quotient by multiplying it by the dividend. In this case, the number of repeated operations required until convergence is determined by the initial value of the reciprocal. The closer it is to the true value, the smaller it will be.

現在発表されている浮動小数点演算器では、ニュートン
・ラブラン法を用いて除算を行っているものが多い。こ
れは以下の理由による。高基数のSRT法でも1回の繰
り返しで求まる商は高々3〜4ビツトであり、最終的な
商を得るには、IEEE規格の単精度で8回程度の繰り
返し計算を必要とする。これに対しニュートン・ラプソ
ン法では、逆数の初期値をある精度内で与えれば、3〜
4回程度の収束計算で商が求まる。従って、ニュートン
・ラプソン法を用いた除算によれば、他の方法に比して
高速に商が得られるという利点がある。
Many of the floating-point arithmetic units currently available use the Newton-Labrun method for division. This is due to the following reasons. Even with the high-radix SRT method, the quotient that can be found in one iteration is at most 3 to 4 bits, and to obtain the final quotient, iterative calculations about 8 times are required in single precision according to the IEEE standard. On the other hand, in the Newton-Raphson method, if the initial value of the reciprocal is given within a certain precision,
The quotient can be found by performing convergence calculations about four times. Therefore, division using the Newton-Raphson method has the advantage that the quotient can be obtained faster than other methods.

以下、ニュートン・ラブラン法を用いた除算について説
明する。
Division using the Newton-Labrun method will be explained below.

除算を実行するにはまず逆数関数を求める。例えば、C
=A/Bという除算は、C=A (1/B)という逆数
の形で表現できるヶニュートン・ラプソン法を使って逆
数関数(1/B)の反復表現を得ることができる。これ
は、 X 8.、   =X 五  (2−BXi  )  
、ただし、i=0、■、2、・・・・・・、と表される
。ここで、X、はi=0に対する最初の除数の逆数(初
期値)、X、は(1/B)のi番目の近似値を表し、初
期値X0が不等式%式% の条件を満たす時、演算は終了する。初期値を得る代表
的な方法は、除数の上位10ビット程度をルック・アッ
プ・テーブル等のメモリ(ROM)のポインタとして使
用するというものである。
To perform division, first find the reciprocal function. For example, C
The division =A/B can be expressed in the reciprocal form of C=A (1/B).Using the Newton-Raphson method, the iterative expression of the reciprocal function (1/B) can be obtained. This is X8. , =X five (2-BXi)
, where i=0, ■, 2, . . . Here, X, is the reciprocal of the first divisor (initial value) for i=0, X, represents the i-th approximation value of (1/B), and when the initial value X0 satisfies the condition of inequality % expression % , the operation ends. A typical method for obtaining the initial value is to use about the upper 10 bits of the divisor as a pointer to a memory (ROM) such as a look-up table.

ROMからは、除数のビットが指示するアドレスの内容
が初期値として出力される。この場合、出カビット数(
初期値X0のビット数)は入力ビツト数(除数の上位1
0ビット程度)とほぼ同じである場合が普通である。浮
動小数点の除算の場合、指数部と仮数部の逆数は別々の
ルック・アップ・テーブル(ROM)から求められる。
The contents of the address indicated by the divisor bits are output from the ROM as an initial value. In this case, the number of output bits (
The number of bits of the initial value X0) is the number of input bits (the upper one of the divisor
Usually, it is almost the same as 0 bit). For floating point division, the exponent and mantissa reciprocals are determined from separate look up tables (ROM).

次に、第3図を参照しながら従来形の除算について説明
する。第3図は従来形の一例としての浮動小数点演算器
の構成を示すもので、図示の例では、正規化数のみを扱
う浮動小数点乗算器の構成が示されている。
Next, conventional division will be explained with reference to FIG. FIG. 3 shows the configuration of a floating point arithmetic unit as an example of a conventional type, and the illustrated example shows the configuration of a floating point multiplier that handles only normalized numbers.

まず、浮動小数点表記法による2進の2つのデータA、
Bを、 A=(−1)”2°−” (1,Fa)、B = (−
1) sb2 ”−” (x、Fb)、とし、該データ
について乗算を行う場合の処理について説明する。
First, two binary data A in floating point notation,
B, A=(-1)"2°-" (1,Fa), B=(-
1) sb2 "-" (x, Fb), and the processing when multiplication is performed on the data will be explained.

(仮数部の演X) 入力データA、Bのそれぞれの仮数部(1,Fa)、(
1,Fb)は、固定小数点乗算回路10を通して、(1
,Fa) X (1,Fb)の演算が実行される。この
結果は、1、 +nrxx・・・・・・、あるいはlx
、□□・・・・・・となる。
(Operation of mantissa part X) Mantissa parts (1, Fa), (
1, Fb) is converted to (1
, Fa) X (1, Fb) is executed. This result is 1, +nrxx... or lx
, □□...

1、XX□・・・・・・の場合は既に正規化されている
が、LX、 XXXX・・・・・・の場合には正規化処
理が必要である。
1, XXX□... have already been normalized, but LX, XXXX...... require normalization processing.

これは、データ(lx、□。・・・・・・)をシフタ1
3によって1ビツト右方向にシフトすると共に、オーバ
ーフロー指示信号F、に応答してインクリメンタ22が
指数部を+1増加することにより、実現される。
This transfers the data (lx, □.....) to shifter 1
This is realized by shifting the exponent part by 1 bit to the right by 3, and by causing the incrementer 22 to increase the exponent part by +1 in response to the overflow instruction signal F.

次いで、正規化された数値に対し、出力データ形式に合
わせるための「丸め」処理が行われる。具体的には、丸
め処理制御回路14において、出力データ形式における
最下位ピッ) (LSB)以下の桁が切り捨てられると
共に、予め設定された丸めモード信号RMとLSB以下
の桁の値とに応じてLSBに1を加算するか否かが決定
される。このLSBに1を加算する演算はインクリメン
タ15によって実行される。この時、データが全部r1
゜であれば、オーバーフローが発生する。この場合は、
シフタ16がオーバーフロー指示信号F2に応答してデ
ータ(LSB +1)を1ビツト右方向にシフトする。
Next, "rounding" processing is performed on the normalized numerical values to match the output data format. Specifically, in the rounding control circuit 14, the digits below the least significant bit (LSB) in the output data format are truncated, and the digits below the LSB are rounded down according to the preset rounding mode signal RM and the values of the digits below the LSB. It is determined whether to add 1 to the LSB. The operation of adding 1 to this LSB is executed by the incrementer 15. At this time, all data is r1
゜, overflow will occur. in this case,
Shifter 16 shifts data (LSB +1) one bit to the right in response to overflow instruction signal F2.

これによって、最終的な出力は正規化数となる。As a result, the final output is a normalized number.

(指数部の演算) 1段目の加算器20では(Ea+Eb)の演算が実行さ
れ、2段目の加算器21ではその結果に負数のバイアス
(−BS)が加算される。つまり、この2つの加算器に
よって(Ea + Eb −BS)の演算が実行される
。次に、3段目のインクリメンタ22では、正規化処理
によるオーバーフローの補正が必要な時+1のインクリ
メント演算が行われる。さらに4段目のインクリメンタ
23では、丸め処理によるオーバーフローの補正のため
に+1のインクリメント演算が前もって行われ、オーバ
ーフロー信号F2に基づきマルチプレクサ24において
いずれか一方の信号が選択される。
(Calculation of exponent part) The first stage adder 20 executes the calculation (Ea+Eb), and the second stage adder 21 adds a negative bias (-BS) to the result. In other words, the operation (Ea + Eb - BS) is executed by these two adders. Next, in the third stage incrementer 22, an increment operation of +1 is performed when it is necessary to correct overflow by normalization processing. Further, in the fourth stage incrementer 23, an increment operation of +1 is performed in advance to correct overflow due to rounding processing, and one of the signals is selected in the multiplexer 24 based on the overflow signal F2.

(符号部の演算) 入力データA、Bのそれぞれの符号部Sa、 Sbに対
して排他的論理和ゲート30が行う排他的論理和によっ
て実行される。
(Operation of the sign part) This is executed by exclusive OR performed by the exclusive OR gate 30 on the code parts Sa and Sb of input data A and B, respectively.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

上述した従来形の浮動小数点乗算器を用いて除算処理を
行う場合、収束法に基づく除算に必要な2−BX、の2
進計算を1ステツプで実行することはできない。つまり
第3図の構成によれば、収束法に基づき除数の逆数を求
める際に行う反復計算、すなわちXl。、=Xi (2
−BXi )の計算を行うためには、乗算iBX、と、
?:fji算;2−BX、と、乗算; Xr (28X
; ) (7)3つ(7)算術演算を必要とし、そのた
め、全体の演算処理時間が長(なって、高速化要求に沿
い難いという不都合が生じる。
When performing division processing using the conventional floating-point multiplier described above, 2-BX, which is necessary for division based on the convergence method, is
It is not possible to perform base calculations in one step. In other words, according to the configuration shown in FIG. 3, the iterative calculation performed when finding the reciprocal of the divisor based on the convergence method, that is, Xl. ,=Xi (2
-BXi), the multiplication iBX, and
? : fji calculation; 2-BX, and multiplication; Xr (28X
) (7) Three (7) arithmetic operations are required, and therefore, the entire operation processing time is long (which results in the inconvenience that it is difficult to meet the demand for speeding up).

また、(2−BX、)の減算については2.第3図の回
路構成のみではその演算を行うことはできず、これを行
うためには、第3図の構成に加減算回路を新たに追加す
る必要がある。仮に、そのような回路を追加して上述の
Xi、、 =Xi (2−BX、)の計算を行うにして
も、依然として、3つの算術演算を繰り返し実行しなけ
ればならず、浮動小数点除算の高速処理という観点から
、改善の余地が残されている。
Also, regarding the subtraction of (2-BX,), see 2. The circuit configuration shown in FIG. 3 cannot perform this calculation alone; in order to perform this operation, it is necessary to newly add an addition/subtraction circuit to the configuration shown in FIG. Even if we were to add such a circuit to calculate Xi, , = Xi (2-BX,) above, we would still have to repeatedly perform three arithmetic operations, which would require a lot of floating point division. There is still room for improvement in terms of high-speed processing.

本発明は、かかる従来技術における課題に鑑み創作され
たもので、収束法に基づき除数の逆数を求める際に行う
反復計算を高速化し、ひいては浮動小数点除算の高速処
理を実現することができる浮動小数点演算器を提供する
ことを目的としている。
The present invention was created in view of the problems in the prior art, and is based on a floating point system that speeds up the iterative calculations performed when calculating the reciprocal of a divisor based on the convergence method, and can also realize high-speed processing of floating point division. The purpose is to provide arithmetic units.

〔課題を解決するための手段] 上述した従来技術における課題を解決するために、本発
明の浮動小数演算器は、第1図の原理ブロック図に示さ
れるように、浮動小数点表記法による2進の2つのデー
タに対して該データの仮数部の乗算を行い、正規化処理
を施して出力する乗算回路lと、該乗算回路から出力さ
れたデータの各ビットを反転させるビット反転回路2と
、該ビット反転回路の出力と該乗算回路の出力のいずれ
か一方を制御信号Sに応答して選択する回路3と、該選
択回路において前記乗算回路の出力が選択された時は所
定の丸めモード信号Rに応答して該出力の丸め処理を行
い、該選択回路において前記ビット反転回路の出力が選
択された時は前記制御信号に応答して該出力の最下位ビ
ットに1を加算し、それぞれ得られた値に対し正規化処
理を施して出力する加算回路4とを具備し、 収束法に基づきA/Bの浮動小数点除算を行う際に必要
な2−BXi、 ただし、0<BXi≦1(i=o、1、・・・・・・)
、Xoは除数の逆数の初期値、 X、は除数の逆数のi番目の近似値、 の計算を前記乗算回路、ビット反転回路および加算回路
によって行い、次いで該除数の逆数の近似値を指示する
X、。+ =Xi (2BX= )の計算を該乗算回路
によって行い、それぞれの計算を所定回数だけ繰り返し
実行して得られるX i * lのデータを被除数のデ
ータAと共に該乗算回路に印加することで前記A/Bの
除算を行うようにしたことを特徴とする。
[Means for Solving the Problems] In order to solve the problems in the prior art described above, the floating point arithmetic unit of the present invention uses a binary system based on floating point notation, as shown in the principle block diagram of FIG. a multiplier circuit 1 that multiplies two data by the mantissa part of the data, performs normalization processing, and outputs the result; a bit inversion circuit 2 that inverts each bit of the data output from the multiplier circuit; a circuit 3 for selecting either the output of the bit inversion circuit or the output of the multiplication circuit in response to a control signal S; and a predetermined rounding mode signal when the output of the multiplication circuit is selected in the selection circuit. Rounding of the output is performed in response to R, and when the output of the bit inverting circuit is selected in the selection circuit, 1 is added to the least significant bit of the output in response to the control signal. 2-BXi, which is necessary when performing A/B floating point division based on the convergence method, provided that 0<BXi≦1( i=o, 1,...)
, Xo is the initial value of the reciprocal of the divisor; X. + = Xi (2BX= ) is calculated by the multiplication circuit, and the data of X i * l obtained by repeatedly performing each calculation a predetermined number of times is applied to the multiplication circuit together with the dividend data A, thereby achieving the above. It is characterized by performing A/B division.

[作 用〕 上述した構成によれば、2−BXi  (ただし、0<
BXi≦1)の2進計算を改良された浮動小数点乗算器
を用いて1ステツプで実行するようにしている。
[Function] According to the configuration described above, 2-BXi (however, 0<
The binary calculation of BXi≦1) is performed in one step using an improved floating point multiplier.

従って、収束法に基づき除数の逆数を求める際に行うX
、、、=Xi (2−BX、)(7)反復計算は、−回
の反復計算につき、2−BXiの演算およびXi (2
−BX、)の演算の2つの算術演算で済み、従来形に比
してlステップ分の演算を省略できる。これは、収束法
に基づき商を求めるために通常3〜4回程度の反復計算
を必要とすることを考慮すると、全体の演算処理時間を
大幅に短縮することに寄与する。従って、浮動小数点除
算を高速に処理することが可能となる。
Therefore, when calculating the reciprocal of the divisor based on the convergence method,
,,,=Xi (2-BX,) (7) The iterative calculation is performed by calculating 2-BXi and Xi (2
Only two arithmetic operations (-BX, ) are required, and one step of operation can be omitted compared to the conventional type. This contributes to significantly shortening the overall calculation processing time, considering that iterative calculations are usually required about three to four times to obtain the quotient based on the convergence method. Therefore, floating point division can be processed at high speed.

なお、本発明の他の構成上の特徴および作用の詳細につ
いては、添付図面を参照しつつ以下に記述される実施例
を用いて説明する。
Note that other structural features and details of the operation of the present invention will be explained using the embodiments described below with reference to the accompanying drawings.

(実施例〕 第2図には本発明の一実施例としての浮動小数点演算器
の主要部の構成が示される。同図の例示は、正規化数の
みを扱う改良された浮動小数点乗算器の構成を示してい
る。
(Embodiment) Fig. 2 shows the configuration of the main parts of a floating-point arithmetic unit as an embodiment of the present invention. It shows the configuration.

本実施例の構成上の特徴は、仮数部演算回路においてシ
フタ13とインクリメンタ15の間に、該シフトレジス
タから出力されたデータの各ビットを反転させるビット
反転回路41と、該ビット反転回路の出力と該シフトレ
ジスタの出力のいずれか一方を除算制御信号DIVに応
答して選択するマルチプレクサ42を設けたことである
。除算処理を行う場合には、除算制御信号DIVを゛H
ルベルにしてビット反転回路41の出力を選択するよう
にし、−方、通常の乗算処理を行う場合には、除算制御
信号oxvを#Lルベルにしてシフトレジスタ16の出
力を選択するようにしている。
The structural features of this embodiment include a bit inversion circuit 41 that inverts each bit of data output from the shift register between the shifter 13 and the incrementer 15 in the mantissa calculation circuit; A multiplexer 42 is provided which selects either the output or the output of the shift register in response to the division control signal DIV. When performing division processing, the division control signal DIV is set to
On the other hand, when performing normal multiplication processing, the division control signal oxv is set to #L level to select the output of the shift register 16. .

今仮に、浮動小数点表記法による2進の2つの入力デー
タD1、D2を、 D+= (1) ”2”−83(1,Fa)、Dt= 
(1) ”2Eト” (1,Fb)、と表す。
Now, suppose that the two binary input data D1 and D2 in floating point notation are D+= (1) "2"-83(1, Fa), Dt=
(1) Expressed as “2Eto” (1, Fb).

まず仮数部演算回路において、10は2つの人力データ
D1、Dtに対し該データのそれぞれの仮数部(1,F
a)、(1,Fb)を固定小数点として乗算処理する固
定小数点乗算回路を示し、該回路は、部分積生成および
加算回路11および加算回路12から構成されている。
First, in the mantissa calculation circuit, 10 calculates the mantissa part (1, F
a) shows a fixed-point multiplication circuit that performs multiplication processing using (1, Fb) as a fixed-point number, and the circuit is composed of a partial product generation and addition circuit 11 and an addition circuit 12.

13はシフタであって、加算回路12から出力されたデ
ータに対して1ビツト右方向(最下位ビット側)にシフ
トしたデータを内部で生成し、この生成されたデータと
加算回路工2から出力されたデータのいずれか一方を、
該回路12により生成されるオーバーフロー指示信号F
1の存無に応答して選択する機能を有している。本実施
例では、オーバーフロー指示信号F、が出力された時に
、シフト処理されたデータが選択出力されるようになっ
ている。
Reference numeral 13 denotes a shifter, which internally generates data that is shifted one bit to the right (toward the least significant bit) with respect to the data output from the adder circuit 12, and outputs this generated data from the adder circuit 2. Either one of the data
Overflow instruction signal F generated by the circuit 12
It has a function of selecting in response to the presence or absence of 1. In this embodiment, the shifted data is selectively output when the overflow instruction signal F is output.

14は丸め処理制御回路であって、通常の乗算処理を行
う場合に機能する回路である。この丸め処理制御回路1
4は、符号のデータSN (後述)と予め設定された丸
めモード信号RMに応じて、シフタ13の出力データに
対し出力データ形式におけるLSB以下の桁を切り捨て
ると共に(丸め処理)、該LSBに1を加算するか否か
を決定してその旨を指示する制御信号RCを出力する機
能を有している。
14 is a rounding processing control circuit, which functions when performing normal multiplication processing. This rounding control circuit 1
4 cuts off the digits below the LSB in the output data format of the output data of the shifter 13 (rounding process) and adds 1 to the LSB according to the code data SN (described later) and the preset rounding mode signal RM. It has a function of determining whether to add or not and outputting a control signal RC instructing to that effect.

15はインクリメンタであって、■通常の乗算処理を行
っている場合には、丸め処理制御回路I4からの制御信
号RCに応答してマルチプレクサ42の出力データ(シ
フタ13の出力データ)のLSBにJを加算し、■除算
処理を行っている場合には、除算制御信号DIνに応答
してマルチプレクサ42の出力データ(ビット反転回路
41の出力データ)のLSBに1を加算する機能を有し
ている。この場合、インクリメンタ15は、加算された
結果のデータが正規化されていない時は、レジスタ15
と同様にオーバーフロー指示信号F2を出力する。
15 is an incrementer which increments the LSB of the output data of the multiplexer 42 (output data of the shifter 13) in response to the control signal RC from the rounding control circuit I4 when performing normal multiplication processing. J and when performing division processing, it has a function of adding 1 to the LSB of the output data of the multiplexer 42 (output data of the bit inversion circuit 41) in response to the division control signal DIν. There is. In this case, the incrementer 15 uses the register 15 when the data resulting from the addition is not normalized.
Similarly, an overflow instruction signal F2 is output.

16はシフタであって、シフタ13と同様、インクリメ
ンタ15から出力されたデータに対し、オーバーフロー
指示信号F2が出力された時は該データを1ビツト右方
向(最下位ビット側)にシフトして出力し、該信号F2
が出力されていない時はシフト処理を行わないでそのま
ま出力する機能を有している。この場合、出力されたデ
ータは、出力データD、の仮数部を構成する。
16 is a shifter which, like the shifter 13, shifts the data output from the incrementer 15 one bit to the right (toward the least significant bit) when the overflow instruction signal F2 is output. Output the signal F2
It has a function to output as is without performing shift processing when it is not being output. In this case, the output data constitutes the mantissa part of the output data D.

次に指数部演算回路を参照すると、20は人力データD
1、D2のそれぞれの指数部のデータEa、 Ebを加
算する加算器、21は加算器20の出力データ、すなわ
ち仮の指数(Ea 十Eb) 、に所定の負数のバイア
ス−BSを加算する加算器、22は加算器21の出力デ
ータ、すなわち真の指数(Ea +Eb−BS) 、に
オーバーフロー指示信号F1の“1′のデータを加算す
るインクリメンタ、23は丸め処理によるオーバーフロ
ー補正のための“1”のデータをインクリメンタ22の
出力データに加算するインクリメンタ、24はインクリ
メンタ22および23の出力のいずれか一方をオーバー
フロー指示信号P!に応答して選択するマルチプレクサ
、をそれぞれ示す。この場合、マルチプレクサ24は、
オーバーフロー指示信号F2が出力された時はインクリ
メンタ23の出力を選択し、オーバーフロー指示信号F
2が出力されていない時はインクリメンタ22の出力を
選択する。この選択されたデータは、出力データD3の
指数部を構成する。
Next, referring to the exponent calculation circuit, 20 is the human data D
An adder 21 adds data Ea and Eb of the exponent parts of 1 and D2, and an adder 21 adds a predetermined negative bias -BS to the output data of the adder 20, that is, the temporary exponent (Ea + Eb). 22 is an incrementer that adds the data of "1" of the overflow instruction signal F1 to the output data of the adder 21, that is, the true exponent (Ea + Eb - BS), and 23 is an incrementer for overflow correction by rounding. 1" is added to the output data of the incrementer 22, and 24 represents a multiplexer that selects one of the outputs of the incrementers 22 and 23 in response to the overflow instruction signal P!. In this case, , the multiplexer 24 is
When the overflow instruction signal F2 is output, the output of the incrementer 23 is selected and the overflow instruction signal F2 is output.
When 2 is not output, the output of the incrementer 22 is selected. This selected data constitutes the exponent part of the output data D3.

符号部演算回路は排他的論理和ゲート30によって構成
され、該ゲートは、入力データD5、D2のそれぞれの
符号部のデータSa、 Sbに応答して符号のデータS
Nを出力する。この符号のデータSNは、人力データD
3、D2が共に同符号の時は“0”となって「正」を指
示し、逆に異符号の時は“l”となって「負」を指示す
る。この符号のデータは、前述の丸め処理制御回路14
に供給されると共に、出力データD、の符号部を構成す
る。
The sign part arithmetic circuit is constituted by an exclusive OR gate 30, and the gate calculates the sign data S in response to the sign part data Sa and Sb of the input data D5 and D2, respectively.
Output N. Data SN of this code is human data D
When D3 and D2 both have the same sign, it becomes "0" to indicate "positive", and conversely, when they have different signs, it becomes "l" to indicate "negative". The data of this code is sent to the rounding control circuit 14 described above.
It also constitutes the code part of the output data D.

次に、第2図の浮動小数点演算器による除算処理につい
て説明する。なお、指数部および符号部の演算について
は従来形(第3図参照)と同様であるので、ここでは仮
数部の演算についてのみ説明する。
Next, division processing by the floating point arithmetic unit shown in FIG. 2 will be explained. Note that since the calculations for the exponent part and the sign part are the same as in the conventional type (see FIG. 3), only the calculations for the mantissa part will be explained here.

I EEE規格の浮動小数点データ・フォーマットのう
ち、正規化数の除算(C=A/B)を考える。すなわち
、 C=A/B=A  (1/B) 、 ただし、A、B、Cはすべて正規化数、とすると、逆数
関数1/Bの(i+1)番目の近似値X 、* Iは、 Xi、、=Xi (2−BX、)、 ただし、O<X、<2/B  (Boo)、0>Xo 
>2/B  (B<O)、 と表される。
Among the floating point data formats of the IEEE standard, division of normalized numbers (C=A/B) will be considered. That is, C=A/B=A (1/B), where A, B, and C are all normalized numbers, then the (i+1)th approximation value X of the reciprocal function 1/B, *I is, Xi,, = Xi (2-BX,), where O<X, <2/B (Boo), 0>Xo
>2/B (B<O), It is expressed as follows.

ここで、初期値X0をルック・アップ・テーブル等のメ
モリ(図示せず)により、 0〈X0≦1/B の範囲に設定すると、 Q<BXo≦11 、.■≦2−BX、<2、 となり、2−BX、も正規化数になる。従って、−1に
2−BX、も正規化数になる。
Here, if the initial value X0 is set in the range of 0<X0≦1/B by a memory such as a look-up table (not shown), then Q<BXo≦11, . ■≦2-BX, <2, and 2-BX also becomes a normalized number. Therefore, -1 and 2-BX are also normalized numbers.

次に、2−BXi  (0<BXi≦1)の計算を考え
る。0<BXi≦1より、BX、のビット反転を■7と
すると、 2−BXi−IJ双、  +LSB(1)、ただし、L
SB(1)はLSB+1を意味する、と変換できる。
Next, consider the calculation of 2-BXi (0<BXi≦1). Since 0<BXi≦1, if the bit inversion of BX is ■7, then 2-BXi-IJ double, +LSB (1), however, L
SB(1) can be converted to mean LSB+1.

具体的には、まず、指数部演算回路および符号部演算回
路をディセーブルにした状態で、除数Bのデータと該除
数の逆数の初期値X0のデータを入力データD0、Dt
  として乗算回路IOに印加し、かつ、除算制御信号
Drνを“H″レベルする。乗算回路lOの出力BX、
はシフタ13を介してピッ1、反転回路4Iに入力され
、そこで各ビットが反転され(TfY; ) 、さらに
マルチプレクサ42で選択されてインクリメンタ15に
入力される。インクリメンタ15は、゛H″レベルの除
算制御信号DIVに応答して入力データ(丁肩)のLS
Bに1を加算する。この加算されたデータ(−BXl+
LSB(1))、すなわち2−BXi、はシフタ16を
通して正規化されデータD、として出力される(ステッ
プl)9次いで、出力されたデータ(2−BX、)を初
期値x0のデータと共に入力データD1、D2として乗
算回路10に印加し、かつ、除算制御信号1)IVを“
L″レベルする。乗算回路10の出力X、(2−BXo
)はシフタ13を介し、さらにマルチプレクサ42で選
択されてインクリメンタ15に入力される。
Specifically, first, with the exponent part calculation circuit and the sign part calculation circuit disabled, the data of the divisor B and the data of the initial value X0 of the reciprocal of the divisor are input data D0, Dt.
is applied to the multiplication circuit IO, and the division control signal Drν is set to the "H" level. Output BX of multiplier circuit lO,
is inputted to the pin 1 and inverting circuit 4I via the shifter 13, where each bit is inverted (TfY; ), further selected by the multiplexer 42, and inputted to the incrementer 15. The incrementer 15 responds to the division control signal DIV at the "H" level to
Add 1 to B. This added data (-BXl+
The LSB (1)), 2-BXi, is normalized through the shifter 16 and output as data D (step l)9.Then, the output data (2-BX,) is input together with the data of the initial value x0. The data D1 and D2 are applied to the multiplication circuit 10, and the division control signal 1) IV is “
The output X of the multiplier circuit 10, (2-BXo
) is further selected by the multiplexer 42 and input to the incrementer 15 via the shifter 13.

この場合、インクリメンタ15は、丸め処理制御回路1
4からの制御信号RCに基づいて丸め処理を実行する。
In this case, the incrementer 15 is the rounding control circuit 1
The rounding process is executed based on the control signal RC from 4.

同様に、インクリメンタ15の出力データはシック16
を通して正規化され、データD3として出力される(ス
テップ2)。
Similarly, the output data of the incrementer 15 is the thick 16
The data is normalized through the process and output as data D3 (step 2).

以降、上述のステップ1およびステップ2を3〜4回繰
り返し実行し、その結果得られたデータXi+l、すな
わち1/Bの(i+1)番目の近似値データ、を被除数
のデータAと共に人力データD1.0□として乗算回路
lOに印加する。この時、除算制御信号DIVを“L″
レベルし、かつ、指数部演算回路および符号部演算回路
をイネーブル状態にする。これによって、A/Bの浮動
小数点除算に基づく結果がデータD、として出力される
。
Thereafter, the above steps 1 and 2 are repeatedly executed 3 to 4 times, and the resulting data Xi+l, that is, the (i+1)th approximate value data of 1/B, is combined with the dividend data A and the human data D1. It is applied to the multiplication circuit lO as 0□. At this time, the division control signal DIV is set to “L”.
level, and enables the exponent part calculation circuit and the sign part calculation circuit. As a result, the result based on the floating point division of A/B is output as data D.

このように、ニュートン・ラプソン法を用いた除算に必
要な2−BX、(0<BXi≦1)の計算を、BX、の
ビットの反転1双1のLSBに1を加算することにより
lステップで実行できる。
In this way, the calculation of 2-BX, (0<BXi≦1) required for division using the Newton-Raphson method can be performed in l steps by adding 1 to the LSB of the bit inversion 1 and 1 of BX. It can be executed with

従って、除数の逆数(1/B)を求める際に行うX、、
、=X、(2−BXi ”)の反復計算は、−回の反復
計算について、2−BX、の演算と、X。
Therefore, when calculating the reciprocal of the divisor (1/B),
, =X, (2-BXi '') is the operation of 2-BX, and X for - times of iterative calculation.

(2−BX、)の演算の2つのステップで済む。It only takes two steps to calculate (2-BX,).

つまり、従来形(3つのステップ)に比してlステップ
分の演算を省略できる。しかも、反復計算は3〜4回繰
り返し実行されるので、浮動小数点除算に要する全体の
演算処理時間は従来形に比して大幅に短縮される。
In other words, compared to the conventional type (three steps), the calculation for l steps can be omitted. Furthermore, since the iterative calculation is repeated three to four times, the overall processing time required for floating-point division is significantly reduced compared to the conventional method.

〔発明の効果〕〔Effect of the invention〕

以上説明したように本発明によれば、浮動小数点乗算器
の簡単な改良のみで、収束法に基づく除数に必要な2−
BX、(0<BXi≦1)の計算を比較的短時間で行う
ことができるので、従来形に比して簡単な方法でありな
がら、浮動小数点除算の高速処理を実現することができ
る。
As explained above, according to the present invention, by simply improving the floating point multiplier, the 2-
Since the calculation of BX, (0<BXi≦1) can be performed in a relatively short time, it is possible to realize high-speed processing of floating point division, although it is a simpler method than the conventional method.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明による浮動小数点演算器の原理ブロック
図、 第2図は本発明の一実施例としての浮動小数点演算器の
主要部の構成を示すブロック図、第3図は従来形の一例
としての浮動小数点演算器の構成を示すブロック図、 である。 (符号の説明) ■・・・乗算回路、    2・・・ビット反転回路、
3・・・選択回路、    4・・・加算回路、A・・
・被除数、     B・・・除数、S・・・制御信号
、     R・・・丸めモード信号、Xo・・・除数
の逆数の初期値、 X、・・・除数の逆数のi番目の近似値。 第 図
Fig. 1 is a block diagram of the principle of a floating-point arithmetic unit according to the present invention, Fig. 2 is a block diagram showing the configuration of the main parts of a floating-point arithmetic unit as an embodiment of the present invention, and Fig. 3 is an example of a conventional type. 1 is a block diagram showing the configuration of a floating point arithmetic unit as shown in FIG. (Explanation of symbols) ■...Multiplication circuit, 2...Bit inversion circuit,
3...Selection circuit, 4...Addition circuit, A...
・Dividend, B...Divisor, S...Control signal, R...Rounding mode signal, Xo...Initial value of the reciprocal of the divisor, X,...I-th approximation of the reciprocal of the divisor. Diagram

Claims (1)

【特許請求の範囲】 浮動小数点表記法による2進の2つのデータに対して該
データの仮数部の乗算を行い、正規化処理を施して出力
する乗算回路(1)と、 該乗算回路から出力されたデータの各ビットを反転させ
るビット反転回路(2)と、 該ビット反転回路の出力と該乗算回路の出力のいずれか
一方を制御信号(S)に応答して選択する回路(3)と
、 該選択回路において前記乗算回路の出力が選択された時
は所定の丸めモード信号(R)に応答して該出力の丸め
処理を行い、該選択回路において前記ビット反転回路の
出力が選択された時は前記制御信号に応答して該出力の
最下位ビットに1を加算し、それぞれ得られた値に対し
正規化処理を施して出力する加算回路(4)とを具備し
、 収束法に基づきA/Bの浮動小数点除算を行う際に必要
な2−BX_i、 ただし、0<BX_i≦1(i=0、1、……)、X_
oは除数の逆数の初期値、 X_iは除数の逆数のi番目の近似値、 の計算を前記乗算回路、ビット反転回路および加算回路
によって行い、次いで該除数の逆数の近似値を指示する
X_i_+_1=X_i(2−BX_i)の計算を該乗
算回路によって行い、それぞれの計算を所定回数だけ繰
り返し実行して得られるX_i_+_1のデータを被除
数のデータAと共に該乗算回路に印加することで前記A
/Bの除算を行うようにしたことを特徴とする浮動小数
点演算器。
[Scope of Claims] A multiplication circuit (1) that multiplies two binary data in floating point notation by the mantissa part of the data, performs normalization processing, and outputs the result, and an output from the multiplication circuit. a bit inversion circuit (2) for inverting each bit of the data, and a circuit (3) for selecting either the output of the bit inversion circuit or the output of the multiplication circuit in response to a control signal (S); , When the output of the multiplication circuit is selected in the selection circuit, rounding processing is performed on the output in response to a predetermined rounding mode signal (R), and the output of the bit inversion circuit is selected in the selection circuit. and an adder circuit (4) that adds 1 to the least significant bit of the output in response to the control signal, performs normalization processing on each obtained value, and outputs the resulting value, based on a convergence method. 2-BX_i required when performing A/B floating point division, where 0<BX_i≦1 (i=0, 1,...), X_
o is the initial value of the reciprocal of the divisor; X_i is the i-th approximation of the reciprocal of the divisor. The calculation of X_i (2-BX_i) is performed by the multiplication circuit, and the data of X_i_+_1 obtained by repeating each calculation a predetermined number of times is applied to the multiplication circuit together with the dividend data A.
A floating point arithmetic unit characterized by performing division by /B.
JP63201891A 1988-07-15 1988-08-15 Floating point arithmetic unit Expired - Fee Related JP2578482B2 (en)

Priority Applications (5)

Application Number Priority Date Filing Date Title
JP63201891A JP2578482B2 (en) 1988-08-15 1988-08-15 Floating point arithmetic unit
US07/374,299 US4999801A (en) 1988-07-15 1989-06-30 Floating point operation unit in division and square root operations
KR1019890010030A KR920005226B1 (en) 1988-07-15 1989-07-14 Floating point arithmetic units
DE68929114T DE68929114T2 (en) 1988-07-15 1989-07-14 Floating point arithmetic units
EP89307180A EP0351242B1 (en) 1988-07-15 1989-07-14 Floating point arithmetic units

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63201891A JP2578482B2 (en) 1988-08-15 1988-08-15 Floating point arithmetic unit

Publications (2)

Publication Number Publication Date
JPH0251732A true JPH0251732A (en) 1990-02-21
JP2578482B2 JP2578482B2 (en) 1997-02-05

Family

ID=16448542

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63201891A Expired - Fee Related JP2578482B2 (en) 1988-07-15 1988-08-15 Floating point arithmetic unit

Country Status (1)

Country Link
JP (1) JP2578482B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100429195B1 (en) * 2000-03-16 2004-04-28 엘지전자 주식회사 method for division using approximate value
KR100480724B1 (en) * 2002-10-31 2005-04-07 엘지전자 주식회사 variable stepsize adaptive inverter
KR100528269B1 (en) * 1996-07-25 2006-02-01 프리스케일 세미컨덕터, 인크. Method and apparatus for performing microprocessor integer division operations using floating-point hardware
US9851947B2 (en) 2014-09-19 2017-12-26 Sanken Electric Co., Ltd. Arithmetic processing method and arithmetic processor having improved fixed-point error

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100528269B1 (en) * 1996-07-25 2006-02-01 프리스케일 세미컨덕터, 인크. Method and apparatus for performing microprocessor integer division operations using floating-point hardware
KR100429195B1 (en) * 2000-03-16 2004-04-28 엘지전자 주식회사 method for division using approximate value
KR100480724B1 (en) * 2002-10-31 2005-04-07 엘지전자 주식회사 variable stepsize adaptive inverter
US9851947B2 (en) 2014-09-19 2017-12-26 Sanken Electric Co., Ltd. Arithmetic processing method and arithmetic processor having improved fixed-point error

Also Published As

Publication number Publication date
JP2578482B2 (en) 1997-02-05

Similar Documents

Publication Publication Date Title
EP0351242B1 (en) Floating point arithmetic units
US6763368B2 (en) Method and apparatus for performing single-cycle addition or subtraction and comparison in redundant form arithmetic
JPH02196328A (en) Floating point computing apparatus
US5157624A (en) Machine method to perform newton iterations for reciprocal square roots
GB2294565A (en) Floating point arithmetic unit
JPH04290122A (en) Numerical expression conversion device
US5260889A (en) Computation of sticky-bit in parallel with partial products in a floating point multiplier unit
JP3436994B2 (en) Shift device
JP2511527B2 (en) Floating point arithmetic unit
JP2578482B2 (en) Floating point arithmetic unit
JP2645422B2 (en) Floating point processor
JPH08504046A (en) Device for converting a floating point binary number to a logarithm in binary form and vice versa
JPH0831024B2 (en) Arithmetic processor
SalehiTabrizi et al. Designing Efficient Two-Level Reverse Converters for Moduli Set {2 2 n+ 1-1, 2 2 n, 2 n-1}
KR20010067226A (en) Interpolation method and apparatus
JP2951685B2 (en) Fixed-point arithmetic unit
JPH0667852A (en) Divider
JPH0285922A (en) Arithmetic circuit
JP2518532B2 (en) Subtractor shift type divider
JP3100868B2 (en) Arithmetic unit for floating point numbers
JPH0383126A (en) Floating-point multiplier
JPS59140560A (en) floating point multiplier
JPS63254525A (en) division device
JPH1185471A (en) Calculation method and calculation device
JPS6175431A (en) Arithmetic device

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees