JPH0327938B2 - - Google Patents
Info
- Publication number
- JPH0327938B2 JPH0327938B2 JP63069513A JP6951388A JPH0327938B2 JP H0327938 B2 JPH0327938 B2 JP H0327938B2 JP 63069513 A JP63069513 A JP 63069513A JP 6951388 A JP6951388 A JP 6951388A JP H0327938 B2 JPH0327938 B2 JP H0327938B2
- Authority
- JP
- Japan
- Prior art keywords
- circuit
- exponent
- mantissa
- output
- overflow
- 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 - Lifetime
Links
Description
【発明の詳細な説明】
本発明は浮動小数点乗算回路、特にダイナミツ
クレンジ(データの取り得る最大振幅)の広いデ
ータの実時間処理を目的とする高速デイジタル信
号処理プロセツサに使用する浮動小数点乗算回路
に関するものである。DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a floating-point multiplication circuit, particularly a floating-point multiplication circuit used in a high-speed digital signal processing processor for real-time processing of data with a wide dynamic range (maximum possible amplitude of data). It is related to.
浮動小数点乗算回路は仮数部演算専用の固定小
数点乗算器と指数部演算専用の加算器とから構成
される。すなわち、乗算される2数をA1=M1・
2e1とA2=M2・2e2とするとその乗算結果はA=
A1・A2=M1・M2・2e1+e2となり、M1・M2の乗
算とe1+e2の加算が行なわれる。ここでM1,M2
が仮数でe1,e2が指数である。浮動小数点乗算に
おいては、有効桁数が最大に保たれるように2入
力の仮数部は正規化されている。これらの乗算回
路を2進数のデイジタル回路で構成する場合、回
路構成上の便によつて、仮数部ならび指数部のビ
ツト数は指定されていため、乗算結果すなわち積
も一定のビツト数で表わさなければならないた
め、桁あふれ(オーバーフローやアンダーフロ
ー)の問題が生じる。 The floating-point multiplication circuit is composed of a fixed-point multiplier dedicated to mantissa operations and an adder dedicated to exponent operations. In other words, the two numbers to be multiplied are A 1 = M 1・
2 e1 and A 2 = M 2・2 e2 , then the multiplication result is A =
A 1 ·A 2 =M 1 ·M 2 ·2 e1+e2 , and multiplication of M 1 ·M 2 and addition of e 1 +e 2 are performed. Here M 1 , M 2
is the mantissa and e 1 and e 2 are the exponents. In floating point multiplication, the mantissa parts of the two inputs are normalized to maintain the maximum number of significant digits. When these multiplication circuits are constructed with binary digital circuits, the number of bits in the mantissa and exponent parts is specified for convenience in circuit configuration, so the multiplication result, that is, the product, must also be expressed with a fixed number of bits. As a result, overflow and underflow problems occur.
又、乗算結果を正規化を行なう場合、仮数部を
桁移動し、その分だけ指数部を加減算する場合に
も、指数部が正規のビツト数で表わされる範囲に
入らないときも、桁あふれの問題が生じる。 Also, when normalizing the multiplication result, moving the mantissa and adding or subtracting the exponent by that amount, overflow may occur even when the exponent does not fall within the range represented by the normal number of bits. A problem arises.
従来、このように仮数部および指数部で桁あふ
れ(オーバーフロー、アンダーフロー)が生じた
ときはフラグで検出し、その補正をプログラムで
処理する方法がとられていた。そとため、オーバ
ーフローの処理を行なうためのプログラムを実行
するためにかなりの時間を要し、高速の演算を行
なうことができない欠点がある。特に通信装置の
ように実時間処理、すなわち入力、出力を同じ時
間関係で行なう必要がある装置においては、更に
高速の信号処理装置が必要となり、特に時間を要
する乗算器の高速化が要求される。 Conventionally, when overflow (overflow, underflow) occurs in the mantissa and exponent parts, a flag has been used to detect the occurrence, and the correction has been processed using a program. Therefore, it takes a considerable amount of time to execute a program for handling overflow, and there is a drawback that high-speed calculation cannot be performed. In particular, in devices such as communication devices that require real-time processing, that is, input and output must be performed in the same time relationship, even higher-speed signal processing devices are required, and in particular, multipliers that require time are required to be faster. .
したがつて、本発明の目的は浮動小数点乗算の
桁あふれをプログラム処理することなく高速処理
する浮動小数点乗算回路を実現することである。 Therefore, an object of the present invention is to realize a floating point multiplication circuit that can process overflow in floating point multiplication at high speed without performing program processing.
本発明の他の目的は、浮動小数点乗算において
生ずる桁あふれを迅速に処理する回路を実現する
ことである。 Another object of the present invention is to realize a circuit that quickly handles overflow that occurs in floating point multiplication.
本発明は上記目的を達成するため、一定ビツト
数の仮数部と指数部からなる浮動小数点の2数の
乗算回路において、入力又は出力の仮数部又は指
数部に桁あふれ検出部を設け、その検出信号によ
つて演算出力の桁あふれ補正回路を駆動するよう
に構成したことを特徴とする。 In order to achieve the above object, the present invention provides a multiplication circuit for two floating point numbers consisting of a mantissa and an exponent of a fixed number of bits, and provides an overflow detection section for the input or output mantissa or exponent. The present invention is characterized in that the overflow correction circuit for the calculation output is driven by the signal.
以上図面を用いて本発明を詳細に説明する。ま
ず、実施例の説明をする前に、本発明の原理につ
いて説明する。第1図は、乗算される2数A1,
A2およびその積A=A1・A2のビツト構成を示す
もので、各数の仮数をM、指数をeで表わすと
A1=M1・2e1、A2=M2・2e2、A=M・2e(真の
値)で表わされる。各記号のサフイツクスは各数
を区別する。浮動小数点乗算においては2数A1,
A2の仮数M1,M2は有効数を最大とするため正規
化されており、2進数が2の補数表示で表わされ
るときは−2°≦M1、又はM2<−2-1又は2-1≦
M1、又はM2<2°又、乗算装置の構造上、仮数
M、指数eを表わすビツト数はそれぞれ一定ビツ
ト数mおよびn(第1図のA1,A2の場合m=12
n=4)で構成される。したがつて、2数A1,
A2図示の如くなる。これらの2数A1,A2の積は
ビツト構成に制限を付けない場合23ビツトの仮数
と4又は5ビツトの指数で表わされる。しかし、
回路、装置の構成上の都合から第1図のA0=
M0・2e0のように実際の装置では数A1,A2と同
じビツト構成(仮数mビツト、指数nビツト)と
される。そのため、以下に述べる桁あふれが生じ
る。 The present invention will be described in detail using the drawings. First, before explaining embodiments, the principle of the present invention will be explained. Figure 1 shows two numbers A 1 to be multiplied,
This shows the bit structure of A 2 and its product A = A 1 · A 2 , where the mantissa of each number is M and the exponent is e.
It is expressed as A 1 =M 1 ·2 e1 , A 2 =M 2 ·2 e2 , and A=M·2 e (true value). The suffix on each symbol distinguishes each number. In floating point multiplication, two numbers A 1 ,
The mantissas M 1 and M 2 of A 2 are normalized to maximize the effective number, and when the binary number is expressed in two's complement representation, −2°≦M 1 or M 2 <−2 −1 or 2 -1 ≦
M 1 or M 2 <2° Also, due to the structure of the multiplication device, the number of bits representing the mantissa M and the exponent e are constant bit numbers m and n, respectively (in the case of A 1 and A 2 in Fig. 1, m = 12
n=4). Therefore, two numbers A 1 ,
A2 It will look like the illustration. The product of these two numbers A 1 and A 2 is expressed by a 23-bit mantissa and a 4- or 5-bit exponent if no restrictions are placed on the bit configuration. but,
Due to the configuration of the circuit and equipment, A 0 =
In an actual device, it has the same bit configuration as the numbers A 1 and A 2 (m bits for the mantissa, n bits for the exponent), such as M 0 ·2 e0 . Therefore, overflow occurs as described below.
(1) 指数上位桁あふれ 正規化された2数A1,A2の積A0の仮数M0は (a) 正規化されていない状態すなわち −2-1≦M0≦−2-2 (1) 又は 2-2<M0<2-1 (b) 正規化されている状態すなわち −2°≦M0<−2-1 (2) 又は 2-1≦M0<2° の2つの状態がある。(1) Overflow of high-order digits of the exponent The mantissa M 0 of the product A 0 of two normalized numbers A 1 and A 2 is (a) in an unnormalized state, that is, −2 -1 ≦M 0 ≦−2 -2 ( 1) or 2 -2 <M 0 <2 -1 (b) Normalized state, i.e. −2°≦M 0 <−2 -1 (2) or 2 -1 ≦M 0 <2° There is a condition.
したがつて、指数eが2n-1となつたとき、次
のような問題が生じる。一般的に仮数が正規化
されていない状態(a)では仮数M0を1ビツト左
シフトし、指定e0から1を減算すれば正規化さ
れ、又指数e0が2n-1以上のときは仮数M0の状
態に係らず、積A0の絶対値を最大とする補数
を行うことが考えられるが、仮数M0が正規化
されていない状態(a)で、かつ指数e0が2n-1の場
合、上記補正を行なつたら補正によつて大きな
誤差を生じる。仮えば指数がn=4ビツトでe0
=24-1=8、仮数M0=−2-2(正規化されてい
ない例)、のとき真の積A0はA0=(−2-2)×28
=−26であり、上述の補正を行なつた場合の積
A0′はA0′=(−2°)×27=−27となり真の値A0の
2倍と誤つた値となる。 Therefore, when the index e becomes 2 n-1 , the following problem occurs. Generally, in the state (a) where the mantissa is not normalized, it can be normalized by shifting the mantissa M 0 to the left by 1 bit and subtracting 1 from the specified e 0 , and when the exponent e 0 is 2 n-1 or more. It is possible to perform complementation that maximizes the absolute value of the product A 0 regardless of the state of the mantissa M 0 , but if the mantissa M 0 is not normalized (a) and the exponent e 0 is 2 In the case of n-1 , if the above correction is performed, a large error will occur due to the correction. For example, if the exponent is n = 4 bits, e 0
= 2 4-1 = 8, mantissa M 0 = -2 -2 (non-normalized example), then the true product A 0 is A 0 = (-2 -2 ) x 2 8
= −2 6 , and the product after the above correction is
A 0 ′ becomes A 0 ′=(−2°)×2 7 =−2 7 , which is an erroneous value that is twice the true value A 0 .
(2) 指数下位桁あふれ
積の指数の真の値が−2n-1未満のとき、下位
桁あふれとして、補正はシフトを行なわず指数
を−2n-1と近似する方法が考えられるが、仮数
部のダイナミツクレンジを有効に利用すること
ができない。(2) Overflow of lower digits of the exponent When the true value of the exponent of the product is less than −2 n-1 , one possible method of correction is to approximate the exponent to −2 n-1 without performing a shift, as overflowing the lower digits. , it is not possible to effectively utilize the dynamic range of the mantissa.
(3) 仮数桁あふれ
2数A1,A2が共に−1のときその積の真の
値は1であるに係らず、2の補数表示の演算を
行なつた場合、積は1.0000…の2進数となり、
MSBが“1”となるため、値は−1と誤る。(3) Overflow of mantissa digits When two numbers A 1 and A 2 are both -1, regardless of whether the true value of the product is 1, if the calculation is performed using two's complement representation, the product will be 1.0000... It becomes a binary number,
Since the MSB is "1", the value is incorrectly determined as -1.
本発明の浮動小数点乗算器は上記桁あふれの問
題を、上記各桁あふれを検出する回路と、桁あふ
れが検出されたとき、プログラム処理することな
く、次のような機能を持つ補正回路で補正するよ
うにしたものである。 The floating-point multiplier of the present invention corrects the above-mentioned overflow problem using a circuit that detects each overflow, and a correction circuit that has the following functions when an overflow is detected, without any program processing. It was designed to do so.
仮数部Mが正規化されず指数部が2n-1となる場
合仮数部Mを左シフト(桁あげ)し、指数部を表
示し得る最大の値2n-1−1にセツトし、指数e0=
2n-1かつ仮数部が正規化されている場合、又は指
数e0>2n-1のときは、仮数部の符号を変えずに絶
対値が最大とようにセツトする。 If the mantissa part M is not normalized and the exponent part becomes 2 n-1 , shift the mantissa part M to the left (carry up), set the exponent part to the maximum value that can be displayed, 2 n-1 -1, and e 0 =
2 n-1 and the mantissa is normalized, or when the exponent e 0 > 2 n-1 , the sign of the mantissa is not changed and the absolute value is set to the maximum.
指数部が−2n-1未満(指数下位桁あふれ)のと
きは指数部の表示し得る最小値−2n-1から真の指
数値eを差引いた(e0−e)ビツト分だけ仮数部
を右シフト(桁下げ)を行う。この補正によつ
て、仮数部の有効ビツト長mビツト分だけダイナ
ミツクスレンジが拡大される。 If the exponent part is less than -2 n-1 (lower digits of the exponent overflow), the mantissa is equal to the bits obtained by subtracting the true exponent value e from the minimum displayable value of the exponent part -2 n-1 (e 0 - e). Shift the part to the right (lower the digit). By this correction, the dynamic range is expanded by the effective bit length m bits of the mantissa.
仮数部の桁あふれを生じるとき、すなわち2数
A1,A2が共に−1のとき、第1の方法は仮数部
を1ビツト右シフトし、指数部に1を加算する。
又、第2の方法は仮数部を2°−2-(m-1)とし、指数
部は補正を行なわない。第2の方法は2-15の誤差
を含むが、他の演算回路として使用される指数上
位桁あふれ補正回路と共用できるため、回路構成
において第1の方法に比べ有利である。 When overflow occurs in the mantissa, that is, 2 numbers
When A 1 and A 2 are both -1, the first method shifts the mantissa to the right by 1 bit and adds 1 to the exponent.
Further, in the second method, the mantissa part is set to 2°-2 -(m-1) , and the exponent part is not corrected. Although the second method includes an error of 2-15 , it is more advantageous than the first method in circuit configuration because it can be shared with the exponent overflow correction circuit used as another arithmetic circuit.
第2図は上記原理に基いて構成された本発明の
浮動小数点乗算回路の一実施例の構成を示すブロ
ツク図である。本実施例は第1および第2の演算
回路およびで構成されている。第1の演算回
路は浮動小数点乗算および桁あふれを検出し、
指数上位桁あふれによる指数補正ならび仮数の補
正を行う回路である。第2の演算回路は指数下
位桁あふれによる指数および仮数の補正を行なう
回路である。なお、本実施例は指数下位桁あふれ
による補正の回路すなわち第2の演算回路は上
記第1の演算回路の出力と他の入力A3(仮数l9、
指数l10からなる)との演算を行なう演算回路を
兼用したもので、又浮動小数点乗算ならび固定小
数点演算を行うことができるようにしたものであ
る。以下各部回路構成の動作について説明する。 FIG. 2 is a block diagram showing the structure of an embodiment of a floating point multiplication circuit according to the present invention, which is constructed based on the above principle. This embodiment is composed of a first and a second arithmetic circuit. The first arithmetic circuit detects floating point multiplication and overflow;
This circuit performs exponent correction due to overflow of upper digits of the exponent and correction of the mantissa. The second arithmetic circuit is a circuit that corrects the exponent and mantissa due to overflow of lower digits of the exponent. In this embodiment, the circuit for correcting the overflow of the lower digits of the exponent, that is, the second arithmetic circuit has the output of the first arithmetic circuit and other inputs A 3 (mantissa l 9 ,
It also serves as an arithmetic circuit that performs arithmetic operations with an exponent l (consisting of 10 ), and is also capable of performing floating-point multiplication and fixed-point arithmetic operations. The operation of each circuit configuration will be explained below.
演算回路はは第1図の仮数M1およびM2に対
応する12ビツトの仮数がそれぞれ入力信号l1およ
びl2として乗算回路1に加えられ、乗算結果l5を
出力する。一方、指数e1およびe2に対応する4ビ
ツトの指数それぞれ入力信号l3,l4として加算回
路2に加えられ、加算結果のl6を出力する。これ
らの入力信号は4ビツトの2の補数表示で表わさ
れているから−8≦l3、l4、l6≦7という制限が
ある。 In the arithmetic circuit, 12-bit mantissas corresponding to mantissas M1 and M2 in FIG. 1 are applied to a multiplication circuit 1 as input signals l1 and l2 , respectively, and output a multiplication result l5 . On the other hand, 4-bit exponents corresponding to exponents e 1 and e 2 are respectively applied as input signals l 3 and l 4 to the adder circuit 2, and the addition result l 6 is output. Since these input signals are expressed in 4-bit two's complement representation, there are restrictions such that -8≦l 3 , l 4 , l 6 ≦7.
4は指数桁あふれ検出および指数上位桁あふれ
時の指数を補正する回路で、指数が8である場合
を検出する検出信号C8、指数上位桁あふれを表
わす信号CMO、指数下位桁あふれを表す信号CMu
を出力する。 4 is a circuit for detecting overflow of exponent digits and correcting the exponent when the upper digits of the index are overflowed, including a detection signal C 8 for detecting when the exponent is 8, a signal C MO representing overflow of the upper digits of the index, and a signal C MO representing overflow of the lower digits of the index. Signal C Mu
Output.
14は制御信号Bによつて浮動小数点乗算と固
定小数点乗算の切換を行なうもので、これは本実
施例の回路を固定小数点演算回路としても使用す
るために設けられたものである。 Reference numeral 14 switches between floating-point multiplication and fixed-point multiplication in response to control signal B, and is provided so that the circuit of this embodiment can also be used as a fixed-point arithmetic circuit.
第3図は上記加算回路2、指数桁あふれ検出回
路4、切換回路14の回路構成を示す。同図にお
いて、l3−23,l3−22,l3−21およびl3−2°は入力
A1と指数e1の4ビツトの信号、l4−23,l4−22,l4
−21およびl4−2°は入力A2の指数e2の4ビツト信
号を表わし、l6−23,l6−22,l6−21およびl6−20
は加算器2の出力、C3はl6−22からl6−23への桁
上げ信号を表す。オア回路16およびアンド回路
17は積の指数eが8以上となるこを検出する回
路でl3−23とl4−23が“0”で桁上信号C3が“1”
のとき(すなわちCMO=(3−23)+(4−23)・C3
)
出力CMOが“1”となる。アンド回路18とアン
ド回路19は指数eが−8以下となることを検出
する回路で、l3−23とl4−23が“1”でC3が“0”
のとき出力CMuが“1”となる。アンド回路20
は指数eが8となることを検出する回路で、CMO
が“1”で、l6−22、l6−21、l6−20が全て“0”
のとき(すなわちCMO・(6−22)・(6−21)・6
−
20が“1”のとき)“1”を出力する。アンド回
路21、オア回路22,23,24は指数eが8
以上のとき、指数をe0=“0111”に補正する。浮
動小数点乗算と固定小数点演算切換回路14は、
演算様式を変えるときに使用されるもので、制御
信号Bは浮動小数点乗算のとき、“1”となり、
アンド回路25,26,27をオン状態にし、
CMu,CMO,C8の信号を通す。 FIG. 3 shows the circuit configuration of the adder circuit 2, the exponent overflow detection circuit 4, and the switching circuit 14. In the figure, l 3 −2 3 , l 3 −2 2 , l 3 −2 1 and l 3 −2° are input
4-bit signal with A 1 and exponent e 1 , l 4 -2 3 , l 4 -2 2 , l 4
−2 1 and l 4 −2° represent the 4-bit signal of index e 2 of input A 2 , l 6 −2 3 , l 6 −2 2 , l 6 −2 1 and l 6 −2 0
is the output of adder 2, and C3 represents a carry signal from l6-22 to l6-23 . The OR circuit 16 and the AND circuit 17 are circuits that detect that the exponent e of the product is 8 or more, and when l 3 -2 3 and l 4 -2 3 are "0", the carry signal C 3 is "1".
When (that is, C MO = ( 3 − 2 3 ) + ( 4 − 2 3 )・C 3
)
Output C MO becomes “1”. AND circuit 18 and AND circuit 19 are circuits that detect when the exponent e is less than -8, and when l 3 -2 3 and l 4 -2 3 are "1" and C 3 is "0"
When , the output C Mu becomes “1”. AND circuit 20
is a circuit that detects that the index e is 8, and C MO
is “1” and l 6 −2 2 , l 6 −2 1 , l 6 −2 0 are all “0”
(i.e. C MO・( 6 −2 2 )・( 6 −2 1 )・6
−
2 When 0 is “1”) Outputs “1”. The AND circuit 21 and the OR circuits 22, 23, and 24 have an exponent e of 8.
In the above case, the index is corrected to e 0 =“0111”. The floating point multiplication and fixed point arithmetic switching circuit 14 is
It is used when changing the calculation style, and the control signal B becomes "1" during floating point multiplication.
Turn on the AND circuits 25, 26, and 27,
Passes the signals of C Mu , C MO , and C 8 .
第4図は第2図の仮数補正回路3の回路図で入
力として、第3図に示した信号CMO,C8、乗算さ
れる2入力データの仮数のMSBl1−20およびl2−
20、仮数の乗算回路1の出力である16ビツトの信
号l5−20,l5−2-1……l5−2-15が加えられる。論
理回路29はインバータ30,33,35、排他
論理和31,39、ナンド回路32,37、ノア
回路34,38、オア回路36からなり、乗算結
果の種々の状態を判定し、アンドゲート41,4
2,…44をオン、オフする。オア回路51…5
4は上記アンドゲートの出力をとり出し、補正さ
れた仮数l7−2-1、l7−2-2…l7−2-15とする。イン
バータ40の出力l7−20は仮数の
MSB信号となる。 FIG. 4 is a circuit diagram of the mantissa correction circuit 3 shown in FIG . 2. As inputs, the signals C MO and C 8 shown in FIG .
2 0 , 16-bit signals l 5 -2 0 , l 5 -2 -1 . . . l 5 -2 -15 , which are the outputs of the mantissa multiplication circuit 1, are added. The logic circuit 29 includes inverters 30, 33, 35, exclusive ORs 31, 39, NAND circuits 32, 37, NOR circuits 34, 38, and an OR circuit 36, and determines various states of the multiplication results, AND gates 41, 4
2,...Turn 44 on and off. OR circuit 51...5
4 takes out the output of the AND gate and sets it as corrected mantissas l 7 -2 -1 , l 7 -2 -2 . . . l 7 -2 -15 . The output l 7 −2 0 of the inverter 40 becomes the MSB signal of the mantissa.
以上の回路によつて、指数下位桁あふれ以外の
乗算出力が得られる。以下各場合に分けて説明す
る。指数eが8以上のときは第3図オア回路17
の出力CMOが“1”となるための指数部のe0(l8−
23、l8−22、l8−21、l8−20)は“0111”(+7)
となる。仮数部は第4図においてCMOが“1”で
あるためナンド回路37が“1”となり、アンド
ゲート41−1,42−1,44−1をオンと
し、MSBl5−20が“0”又は“1”のときはそれ
ぞ0.11111…1又は1.000…0のように絶対値が最
大となる値となる。 With the above circuit, multiplication output other than overflowing of the lower digits of the exponent can be obtained. Each case will be explained separately below. When the exponent e is 8 or more, OR circuit 17 in Figure 3
e 0 ( l 8 −
2 3 , l 8 −2 2 , l 8 −2 1 , l 8 −2 0 ) is “0111” (+7)
becomes. As for the mantissa part, since C MO is "1" in FIG. 4, the NAND circuit 37 becomes "1", turning on the AND gates 41-1, 42-1, and 44-1, and MSBl 5 -2 0 becomes "0". ” or “1”, the value has the maximum absolute value, such as 0.11111...1 or 1.000...0, respectively.
しかし、指数eが8で仮数が正規化されていな
い場合すなわちCMO,C8、が“1”でl5−20とl5−
2-1の符号が同一のときは論理回路29によつて、
アンドゲート41−3,42−3…がオンとな
り、仮数部を1ビツトだけ左にシフトすることに
なる。 However, if the exponent e is 8 and the mantissa is not normalized, that is, C MO , C 8 are “1” and l 5 −2 0 and l 5 −
When the signs of 2 -1 are the same, the logic circuit 29
AND gates 41-3, 42-3, . . . are turned on, and the mantissa is shifted to the left by one bit.
指数eが−8≦e<7ときはオーバーフローを
生ぜず、指数部の加算器2の出力l6が出力l8(l8−
23,l8−22……l8−20)として取出され、仮数部
は正規化されていないときは正規化の処理を行な
う。 When the exponent e is −8≦e<7, no overflow occurs, and the output l 6 of the adder 2 of the exponent part becomes the output l 8 (l 8 −
2 3 , l 8 -2 2 ... l 8 -2 0 ), and if the mantissa part is not normalized, normalization processing is performed.
さて、以上の各場合でも、2入力データが共に
“1.000…0”(−1)、であるとき、仮数部の桁あ
ふれが生じるが、この検出は、第4図のナンド回
路32によつて行なわれ、(l1−20)・(l2−20)・
(l5−20)が“1”となることが検出されると、
仮数の補正出力l7−20,l7−2-2,……l7−2-15は
“0.1111…1”(=20−215)となる。次に指数下位
桁あふれの場合について説明する。指数下位桁あ
ふれの補正は第2図の第2の演算回路で他の入
力A3との演算の途中で行なわれる。第3図にお
いて、指数下位桁あふれが生じた場合CMuが
“1”となり、第2図の指数下位桁あふれ指数補
正回路6.指数下位桁あふれ時の指数比較補正回
路12、指数下位桁あふれ発生時の演算前右シフ
ト補正回路8および指数部演算入力バスの切換回
路13に加えられる。 Now, in each of the above cases, when the two input data are both "1.000...0" (-1), an overflow occurs in the mantissa, but this detection is done by the NAND circuit 32 in FIG. (l 1 −2 0 )・(l 2 −2 0 )・
When it is detected that (l 5 −2 0 ) becomes “1”,
The corrected mantissa outputs l7-20, l7-2-2,...l7-2-15 become " 0.1111 ... 1 " (= 20-215 ). Next, the case of overflowing the lower digits of the exponent will be explained. Correction of the overflow of the lower digits of the exponent is performed in the second arithmetic circuit shown in FIG. 2 during the arithmetic operation with another input A3 . In FIG. 3, when an overflow of the lower digits of the exponent occurs, C Mu becomes "1", and the overflow of the lower digits of the exponent of FIG. It is added to the exponent comparison correction circuit 12 when the exponent lower digits overflow, the pre-calculation right shift correction circuit 8 when the exponent lower digit overflow occurs, and the switching circuit 13 for the exponent part calculation input bus.
他の入力A3の仮数l9は仮数部演算入力バス切換
回路5に指数l10は切換回路13、指数比較回路
11、指数補正回路6にそれぞれ加えられ、更
に、演算回路の指数出力l8(=e0)が指数補正
回路6に加えられる。切換回路13は2つの指数
の大きな方の指数を他の演算回路又は出力端子
(図示ぜす)に供給するものである。比較器11
は2つの指数の大小を比較する。指数下位桁あふ
れ時の指数比較回路12は上記比較回路11の出
力l17を補正し、指数下位桁あふれが生じたとき
の制御信号l18を発生し、入力バス切換回路5の
入力信号(仮数)l7を出力信号l14として演算前右
シフト回路9に加え、入力バス切換回路13の出
力として入力信号l10を出力するように制御し、
減算回路7を制御する。指数補正回路6、減算回
路7、右シフト補正回路8は第5図で詳細に説明
する如く仮数部の右シフト量を決定する。15は
浮動小数点演算と固定小数点演算の切換回路で、
10固定小数点減算回路である。 The mantissa l9 of the other input A3 is applied to the mantissa calculation input bus switching circuit 5, and the exponent l10 is added to the switching circuit 13, the exponent comparison circuit 11, and the exponent correction circuit 6, respectively, and furthermore, the exponent output l8 of the calculation circuit (=e 0 ) is applied to the exponent correction circuit 6. The switching circuit 13 supplies the larger of the two exponents to another arithmetic circuit or an output terminal (not shown). Comparator 11
compares the magnitude of two indices. The exponent comparator circuit 12 corrects the output l17 of the comparator circuit 11 when the exponent lower digits overflow, generates a control signal l18 when the exponent lower digit overflow occurs, and outputs the input signal (mantissa) of the input bus switching circuit 5. ) l7 as an output signal l14 to the pre-computation right shift circuit 9, and controls the input bus switching circuit 13 to output the input signal l10 as an output,
Controls the subtraction circuit 7. The exponent correction circuit 6, the subtraction circuit 7, and the right shift correction circuit 8 determine the amount of right shift of the mantissa part, as will be explained in detail in FIG. 15 is a switching circuit between floating point arithmetic and fixed point arithmetic;
This is a 10 fixed point subtraction circuit.
いま演算回路の出力の指数をβ={β3β2β1β0}
とし、指数部の真の値をeとする。なおβは下位
桁あふれの場合の出力である。又、他の入力の指
数をα={α3、α2、α1、α0}(この信号をl10で表
わす)とする。 Now let the exponent of the output of the arithmetic circuit be β = {β 3 β 2 β 1 β 0 }
Let the true value of the exponent part be e. Note that β is the output in the case of overflow of lower digits. Also, let the exponents of other inputs be α={α 3 , α 2 , α 1 , α 0 } (this signal is represented by l 10 ).
指数下位桁あふれは3・CMu=“1”となると
きに生じる。このとき、4ビツトの2に補数表示
ではe<−8、β≧0であるから、e<βとな
る。従つてCMuが1のときはβがeより小さいの
で指数比較補正回路で補数を行なう。2入力の指
数をそろえるために(α−e)を求める必要があ
るが、α−eは
α−e=α−(−16+β)
=(α+8)−(−8+β) ……(3)
で表わせる。ここでα、βには
−8≦α≦7 ……(4)
0≦β≦7 ……(5)
0≦α+8≦15 ……(6)
−8≦−8+β≦−1 ……(7)
の条件があるので次の不等式が成立する
α+8>−8+β ……(8)
1≦α−e≦23 ……(9)
一方、仮数部右シフト回路9への入力データ1
3は0≦l13≦15で制限されなければならないの
で、次の補正が必要である。 Overflow of lower exponent digits occurs when 3 ·C Mu = “1”. At this time, since e<-8 and β≧0 in 4-bit two's complement representation, e<β. Therefore, when C Mu is 1, β is smaller than e, so the exponent comparison and correction circuit performs complementation. In order to align the exponents of the two inputs, it is necessary to find (α-e), but α-e can be expressed as α-e=α-(-16+β) =(α+8)-(-8+β)...(3) Ru. Here, for α and β, −8≦α≦7 …(4) 0≦β≦7 …(5) 0≦α+8≦15 …(6) −8≦−8+β≦−1 …(7 ), so the following inequality holds true: α+8>-8+β ……(8) 1≦α−e≦23 ……(9) On the other hand, input data 1 to the mantissa right shift circuit 9
3 must be limited by 0≦l 13 ≦15, so the following correction is necessary.
α−e<16のとき
l13=α−e ……(10)
α−e<16のとき
l13=15 ……(11)
上記式を回路構成のため論理記号で表わすと(3)
式の(α+8)、(−8+β)は
(α+8)={(α31)α2α1α0}
={(α3CMu)α2α1α0} ……(12)
(−8+β)={(1+0)β2β1β0}
={(β3+CMu)β2β1β0} ……(13)
又、(10)、(11)式に対する条件Cを求めると
x=(CMu+α3)=3 ……(14)
y=(Mu+3)=0 ……(15)
とすると
C={x・y+(xy)・C2}・CMu ……(16)
=x・C2・CMu ……(17)
となる。 When α-e<16, l 13 = α-e...(10) When α-e<16, l 13 = 15...(11) Expressing the above equation in logical symbols for the circuit configuration, (3)
The formulas (α+8) and (-8+β) are (α+8) = {(α 3 1) α 2 α 1 α 0 } = {(α 3 C Mu ) α 2 α 1 α 0 } ...(12) (- 8 + β) = {(1 + 0) β 2 β 1 β 0 } = {(β 3 +C Mu ) β 2 β 1 β 0 } ...(13) Also, if we find the condition C for equations (10) and (11), x = (C Mu + α 3 ) = 3 ... (14) y = ( Mu + 3 ) = 0 ... (15) Then C = {x・y+(xy)・C 2 }・C Mu ...( 16) =x・C 2・C Mu ...(17)
第5図は上記原理に基いて構成された浮動小数
点乗算における指数下位桁あふれ回路の一実施例
で各ブロツク6、7、8、12、15は第2図の同一
番号を付す部分に対応する。同図において、信号
l8−23,l8−22,l8−21,l8−20は上記β3,β2,β1
,
β0に又l10−23,l10−22,l10−21,l10−20は上記
α3,α2,α1,α0に対応する。排他論理和55は
(12)式のα3CMuを実行し、オア回路56は
(14)式のβ3+CMuを実行する。比較補正回路12
はCMuが“1”のときはスイツチS1をオンとし、
S2をオフとし信号l18を“0”とする。CMuが
“0”のときはこの逆となりl18はl17となる。減算
回路7はα−eを出力するが、右シフト補正回路
8において、アンド回路57によつて上記(17)
式の条件Cを判断し、シフトが16より大きいと
きは“1”を出力する。したがつてα−eが≧16
のときはシフト信号l13として15を設定、又α−
e<16のときはl3としてα−eを設定する。 FIG. 5 shows an example of an exponent overflow circuit for floating-point multiplication constructed based on the above principle, and blocks 6, 7, 8, 12, and 15 correspond to the parts with the same numbers in FIG. 2. . In the figure, the signal
l 8 −2 3 , l 8 −2 2 , l 8 −2 1 , l 8 −2 0 are the above β 3 , β 2 , β 1
,
In addition to β 0 , l 10 −2 3 , l 10 −2 2 , l 10 −2 1 , and l 10 −2 0 correspond to the above α 3 , α 2 , α 1 , and α 0 . The exclusive OR circuit 55 executes α 3 C Mu in equation (12), and the OR circuit 56 executes β 3 +C Mu in equation (14). Comparison correction circuit 12
When C Mu is “1”, turn on switch S 1 ,
S2 is turned off and the signal l18 is set to "0". When C Mu is "0", this is reversed and l 18 becomes l 17 . The subtraction circuit 7 outputs α−e, but in the right shift correction circuit 8, the AND circuit 57 outputs the above (17).
Condition C of the expression is judged, and if the shift is greater than 16, "1" is output. Therefore α−e is ≧16
In this case, set 15 as shift signal l 13 , and set α−
When e<16, α-e is set as l3 .
以下の説明は指数下位桁あふれの補正を他の入
力A3との加減算の中で行なつた場合について述
べたが、2入力データA1,A2の乗算結果を第2
の演算回路の出力として、直接取出したい場合
には他の入力信号A3の仮数部l9のデータを0、指
数部のデータl10を−8にすればよい。すなわち
(00…0)×2-8=0となり0を加算した出力とな
り、2入力A1,A2の積A0が求まる。 The following explanation deals with the case where the correction of the overflow of the lower digits of the exponent is performed during addition and subtraction with other input data A3 , but the multiplication result of two input data A1 and A2 is
If it is desired to directly take out the output of the arithmetic circuit, the data of the mantissa part l9 of the other input signal A3 should be set to 0, and the data of the exponent part l10 should be set to -8. That is, (00...0)×2 -8 = 0, which is the output obtained by adding 0, and the product A 0 of the two inputs A 1 and A 2 is found.
第1図は浮動小数点乗算における入力データの
ビツト構成図、第2図は本発明による浮動小数点
乗算回路の一実施例の構成を示すブロツク図、第
3図は上記実施例における加算回路2、指数桁あ
ふれ検出回路4、切換回路14の回路図、第4図
は第1図の仮数補正回路3の回路図、第5図は第
1図のブロツク6、7、8、15部の回路図であ
る。
1……乗算回路、2……加算回路、3……仮数
補正回路、4……指数部桁あふれ検出回路、5…
…仮数部演算入力バス切換回路、6……指数補正
回路、7……減算回路、8……右シフト補正回
路、9……右シフト回路、10……固定小数点加
減算回路、11……指数比較回路、12……比較
補正回路、13……指数演算入力バス切換回路、
14,15……浮動小数点演算と固定小数点演算
切換回路。
FIG. 1 is a bit configuration diagram of input data in floating point multiplication, FIG. 2 is a block diagram showing the configuration of an embodiment of a floating point multiplication circuit according to the present invention, and FIG. 3 is an adder circuit 2 and an exponent in the above embodiment. Figure 4 is a circuit diagram of the overflow detection circuit 4 and switching circuit 14, Figure 4 is a circuit diagram of the mantissa correction circuit 3 in Figure 1, and Figure 5 is a circuit diagram of blocks 6, 7, 8, and 15 in Figure 1. be. 1... Multiplication circuit, 2... Addition circuit, 3... Mantissa correction circuit, 4... Exponent overflow detection circuit, 5...
...Mantissa calculation input bus switching circuit, 6...Exponent correction circuit, 7...Subtraction circuit, 8...Right shift correction circuit, 9...Right shift circuit, 10...Fixed point addition/subtraction circuit, 11...Exponent comparison circuit, 12...comparison correction circuit, 13...exponential calculation input bus switching circuit,
14, 15...Floating point arithmetic and fixed point arithmetic switching circuit.
Claims (1)
の入力データの仮数部を乗算する仮数部乗算回路
と、該第1と第2の入力データの指数部を加算す
る指数部加算回路とを有する第1の回路と、 2の補数表示された浮動点表示の第3の入力デ
ータと上記仮数部乗算回路および上記指数部加算
回路の出力とを加算する第2の回路を具備してな
る浮動小数点乗算回路であつて、 上記第1の回路は、上記指数部加算回路の出力
の桁あふれを検出する第1の検出回路と、上記指
数部加算回路に接続され検出された桁あふれ状態
の上記指数部加算回路の出力を上記第2の回路へ
の供給前に補正する第1の補正回路と、上記仮数
部乗算回路に出力の桁あふれを検出する第2の検
出回路と、上記仮数部乗算回路に接続され検出さ
れた桁あふれ状態の上記仮数部乗算回路の出力を
上記第2の回路への供給前に補正する第2の補正
回路とを有してなり、 上記第1と第2の入力データの指数部を表わす
ビツト数がnビツトである場合、 上記指数部加算回路の出力が2n-1となつたこと
を上記第1の検出回路が検出した際に、上記第1
の補正回路は上記指数部加算回路の出力を2n-1−
1にセツトし、 上記仮数部乗算回路の出力が正規化されず、上
記指数部加算回路の出力が2n-1となつたことを上
記第1の検出回路が検出した際に、上記第2の補
正回路は上記仮数部乗算回路の出力を1ビツト左
シフトすることを特徴とする浮動小数点乗算回
路。 2 上記第1の検出回路の出力に応答して検出さ
れた桁あふれの上記指数部加算回路の出力を補正
する動作を上記第2の回路の加算動作の一部とし
て実行する第3の補正回路を上記第2の回路が有
してなることを特徴とする特許請求の範囲第1項
記載の浮動小数点乗算回路。[Claims] 1. First and second floating point representations expressed in two's complement
a first circuit having a mantissa multiplier circuit that multiplies the mantissa parts of input data; and an exponent adder circuit that adds the exponent parts of the first and second input data; A floating point multiplication circuit comprising a second circuit that adds third input data in point representation and outputs of the mantissa multiplication circuit and the exponent addition circuit, the first circuit comprising: a first detection circuit that detects overflow in the output of the exponent addition circuit; and a first detection circuit that is connected to the exponent addition circuit and transmits the output of the exponent addition circuit in the detected overflow state to the second circuit. a first correction circuit that corrects the output before supply; a second detection circuit that detects overflow of the output to the mantissa multiplication circuit; and a second detection circuit that is connected to the mantissa multiplication circuit and detects the overflow of the mantissa. and a second correction circuit that corrects the output of the multiplication circuit before supplying it to the second circuit, and the number of bits representing the exponent part of the first and second input data is n bits. In this case, when the first detection circuit detects that the output of the exponent addition circuit becomes 2 n-1 ,
The correction circuit converts the output of the exponent addition circuit into 2 n-1 −
1, and when the first detection circuit detects that the output of the mantissa multiplication circuit is not normalized and the output of the exponent addition circuit is 2n -1 , the second A floating point multiplication circuit characterized in that the correction circuit shifts the output of the mantissa multiplication circuit to the left by one bit. 2. A third correction circuit that performs, as part of the addition operation of the second circuit, an operation of correcting the output of the exponent part addition circuit with overflow detected in response to the output of the first detection circuit. 2. The floating point multiplication circuit according to claim 1, wherein said second circuit comprises:
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP63069513A JPS63259720A (en) | 1988-03-25 | 1988-03-25 | floating point multiplication circuit |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP63069513A JPS63259720A (en) | 1988-03-25 | 1988-03-25 | floating point multiplication circuit |
Related Parent Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP55152053A Division JPS5776635A (en) | 1980-10-31 | 1980-10-31 | Floating multiplying circuit |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS63259720A JPS63259720A (en) | 1988-10-26 |
| JPH0327938B2 true JPH0327938B2 (en) | 1991-04-17 |
Family
ID=13404888
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP63069513A Granted JPS63259720A (en) | 1988-03-25 | 1988-03-25 | floating point multiplication circuit |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS63259720A (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2020059074A1 (en) * | 2018-09-20 | 2020-03-26 | 株式会社Pfu | Data construct, information processing device, method, and program |
| CN111930342B (en) * | 2020-09-15 | 2021-01-19 | 浙江大学 | Error unbiased approximate multiplier aiming at normalized floating point number and implementation method thereof |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS5330241A (en) * | 1976-09-01 | 1978-03-22 | Hitachi Ltd | Arithmetic unit |
-
1988
- 1988-03-25 JP JP63069513A patent/JPS63259720A/en active Granted
Also Published As
| Publication number | Publication date |
|---|---|
| JPS63259720A (en) | 1988-10-26 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JPS6360417B2 (en) | ||
| US4758972A (en) | Precision rounding in a floating point arithmetic unit | |
| US4999801A (en) | Floating point operation unit in division and square root operations | |
| JP3178746B2 (en) | Format converter for floating point numbers | |
| US20080215660A1 (en) | Three-Term Input Floating-Point Adder-Subtractor | |
| EP0381403A2 (en) | Pipelined floating point adder for digital computer | |
| US8214416B2 (en) | Floating-point addition acceleration | |
| KR100465371B1 (en) | apparatus and method for design of the floating point ALU performing addition and round operations in parallel | |
| EP0529101A1 (en) | Floating-point dividing circuit | |
| US4941119A (en) | Method and apparatus for predicting an overflow in an integer multiply | |
| EP0366155A2 (en) | Logarithmic function arithmetic unit including means for separately processing pseudo division and multiplication | |
| EP0332215B1 (en) | Operation circuit based on floating-point representation | |
| JPH0327938B2 (en) | ||
| US4823300A (en) | Performing binary multiplication using minimal path algorithm | |
| CN113377334B (en) | Floating point data processing method and device and storage medium | |
| JP2517064B2 (en) | Denormalized number processing method | |
| JPH03102519A (en) | Divider | |
| JP2558799B2 (en) | Floating point normalized rounding device | |
| JP2622012B2 (en) | Shift circuit | |
| JPH05204606A (en) | Floating point arithmetic system and unit | |
| JPH07120265B2 (en) | Rounding method in binary floating point multiplication | |
| JP3124286B2 (en) | Floating point arithmetic unit | |
| JP3109080B2 (en) | Word length limiting circuit | |
| JPS5960637A (en) | Arithmetic device for floating decimal point | |
| JPH0814790B2 (en) | Processor |