[go: up one dir, main page]

JPH01211026A - Shift number for normalization deciding device - Google Patents

Shift number for normalization deciding device

Info

Publication number
JPH01211026A
JPH01211026A JP63035718A JP3571888A JPH01211026A JP H01211026 A JPH01211026 A JP H01211026A JP 63035718 A JP63035718 A JP 63035718A JP 3571888 A JP3571888 A JP 3571888A JP H01211026 A JPH01211026 A JP H01211026A
Authority
JP
Japan
Prior art keywords
mantissa
normalization
bits
output
subtraction
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.)
Pending
Application number
JP63035718A
Other languages
Japanese (ja)
Inventor
Katsuhiko Ueda
勝彦 上田
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP63035718A priority Critical patent/JPH01211026A/en
Publication of JPH01211026A publication Critical patent/JPH01211026A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To shorten the time needed for operations by obtaining the shift number necessary for normalization for addition/subtraction of a floating point mantissa part from the higher two bits of a mantissa and the exponent difference obtained through the digit matching of the mantissa or from all other bits except the most significant bit. CONSTITUTION:A normalization control circuit 106 consists of a combination circuit supplies the outputs Ez and SM2 of an exponent computing element 102, the bits 2' and 2'' of the output of a mantissa computing element 104, and an addition/subtraction instruction signal 108 received from outside and mentioned later and outputs a normalized number of shifts designating signal and a selection signal SEL. With application of the circuit 106, the bit number needed for normalization of the output of the element 104 is calculated by a decoder 105 or based on the five bits including the higher two bits of the output of the element 104. Then the output of the decoder 105 is used only when the circuit 106 is unable to logically decide the bit number necessary for normalization. As a result, the overall time necessary for obtaining the number of shifts for normalization can be shortened on an average in case the addition/subtraction are carried out for the large number of floating points.

Description

【発明の詳細な説明】 産業上の利用分野 本発明は、浮動小数点数の加減算結果の正規化に必要な
シフト数を求める装置に関するものである。
DETAILED DESCRIPTION OF THE INVENTION Field of Industrial Application The present invention relates to an apparatus for determining the number of shifts necessary for normalizing the results of addition and subtraction of floating point numbers.

従来の技術 仮数部が符号と絶対値で示される浮動小数点数の加減算
は、一般に次に示す手順に従う。
BACKGROUND ART Addition and subtraction of floating point numbers whose mantissas are represented by sign and absolute value generally follow the following procedure.

ステップl:桁合わせ処理 ステップ2:加減算処理 ステップ3:仮数部絶対値化処理 ステップ4:正規化処理 ステップ5:丸め処理 ここで、ステップ4の正規化処理では l)仮数部の最上位ビットを1にするのに必要なシフト
数の算出 2)求めたシフト数分の仮数部シフト 3)求めたシフト数分の指数部補正 を行なわねばならない。
Step 1: Digit alignment processing Step 2: Addition/subtraction processing Step 3: Mantissa part absolute value processing Step 4: Normalization processing Step 5: Rounding processing Here, in the normalization processing of step 4, l) the most significant bit of the mantissa part Calculation of the number of shifts required to make the value 1.2) Shifting of the mantissa part by the number of shifts determined.3) Correction of the exponent part by the number of shifts determined.

この正規化処理の高速化、特に指数補正の高速化を実現
する従来の処理装置としては例えば、特開昭58−18
6840号公報に示されている。
As a conventional processing device for realizing high-speed normalization processing, especially high-speed index correction, for example,
This is shown in Japanese Patent No. 6840.

第4図は、この従来の演算処理装置のブロック図を示す
のでありであり、l、2は人力データを保持するレジス
タ、3は人力データの指数部の大小判定を行ない大なる
方の指数部の選択と、仮数部桁合わせを行なうブリシフ
タ、4.5はブリシフタ3の出力の仮数部を保持するレ
ジスタ、6はブリシフタ3の出力の指数部を保持するレ
ジスタ、7は並列加算器、8は並列加算器7の出力を保
持するレジスタ、9はレジスタ8の内容の最上位ビ・ソ
トからの連続するOの数をカウントするデコーダ、10
はレジスタ8の内容をデコーダ9が示すビット数だけシ
フトを行し仮数部正規化を行なうボストシフタ、11か
ら26はレジスタ6の出力にそれぞれ+1から−14の
値を加算する加算器、27から42は加算器11〜26
の出力を保持するレジスタ、43はデコーダ9の出力に
応じてレジスタ27〜42の何れか一つを選択するセレ
クタである。
FIG. 4 shows a block diagram of this conventional arithmetic processing device, where 1 and 2 are registers that hold human data, and 3 is a register that determines the magnitude of the exponent part of the human data and selects the larger exponent part. 4.5 is a register that holds the mantissa part of the output of the preshifter 3, 6 is a register that holds the exponent part of the output of the preshifter 3, 7 is a parallel adder, and 8 is a register that holds the exponent part of the output of the preshifter 3. A register 9 holds the output of the parallel adder 7, a decoder 9 counts the number of consecutive O's from the most significant bit in the contents of the register 8, 10
is a boss shifter that shifts the contents of register 8 by the number of bits indicated by decoder 9 and normalizes the mantissa; 11 to 26 are adders that add values from +1 to -14 to the output of register 6, respectively; 27 to 42 are adders 11 to 26
A register 43 that holds the output of the decoder 9 is a selector that selects one of the registers 27 to 42 according to the output of the decoder 9.

以上のように構成された従来の処理装置の動作について
次に説明する。レジスタ1.2に格納されたデータがブ
リシフタ3に人力され、先ず指数部が比較される。そし
て、大なる方の指数はレジスタ6に格納され、大なる方
の指数をもつデータの仮数部はそのまま、小なる方の指
数部を持つデータの仮数部は指数差分だけ右シフトされ
、レジスタ4.5に格納される。レジスタ4.5の出力
は並列加算器7で処理され結果はレジスタ8に格納され
る。また仮数部の演算と並行してレジスタ6の内容が加
算器11〜26でそれぞれ+1〜−14が加算され、レ
ジスタ27〜42に格納される。デコーダ9はレジスタ
8の内容の最上位ビットか゛らの連続する0の数をカウ
ントする。そして、カウント結果により、レジスタ8の
出力をボストシフタ10でシフトし仮数の正規化を行な
う。また指数は、≠ニーダ9の全ての出カバターンに対
して予め計算した結果がレジスタ27〜42に存在する
ので、デコーダ9の出力に対応するレジスタの一つをセ
レクタ43で選択することで得られる。
The operation of the conventional processing device configured as described above will be described next. The data stored in the register 1.2 is input to the pre-shifter 3, and first, the exponent parts are compared. Then, the larger exponent is stored in register 6, the mantissa part of the data with the larger exponent remains unchanged, and the mantissa part of the data with the smaller exponent part is shifted to the right by the exponent difference. .5. The output of register 4.5 is processed by parallel adder 7 and the result is stored in register 8. Further, in parallel with the calculation of the mantissa part, the contents of register 6 are added with +1 to -14 by adders 11 to 26, respectively, and stored in registers 27 to 42. Decoder 9 counts the number of consecutive 0s starting from the most significant bit of the contents of register 8. Then, based on the count result, the output of the register 8 is shifted by the boss shifter 10 to normalize the mantissa. Also, the exponent can be obtained by selecting one of the registers corresponding to the output of the decoder 9 with the selector 43, since the results calculated in advance for all output patterns of the kneader 9 exist in the registers 27 to 42. .

発明が解決しようとする課題 しかしながら上記のような構成では、指数補正は高速に
出来るが、その実現に要する加算器11〜26、レジス
タ27〜42、セレクタ43の回路規模が膨大なものと
なる。また、演算精度を高めるために仮数部のビット数
を増加させた場合はそれに比例してこれら資源が大幅に
増加するという問題点も有している。
Problems to be Solved by the Invention However, although the above configuration can perform exponent correction at high speed, the circuit scale of the adders 11 to 26, registers 27 to 42, and selector 43 required to realize it becomes enormous. Another problem is that when the number of bits of the mantissa is increased in order to improve calculation accuracy, these resources increase significantly in proportion.

本発明はかかる点に鑑み、正規化を高速に処理しかつ少
ない回路規模で実現できる正規化シフト数決定装置を提
供することを目的とする。
In view of these points, it is an object of the present invention to provide a normalization shift number determination device that can process normalization at high speed and realize it with a small circuit scale.

課題を解決するための手段 外部から与えられる加減算指示信号、加減算された仮数
の上位2ビット、仮数桁合わせ処理で得られる指数差に
関する情報により、浮動小数点加減算結果の正規化に要
するシフト数が求まるか否かの判断と求まる場合はその
シフト数を求める第1の手段と、加減算された仮数の最
上位ビットを除く全ての他のビットから浮動小数点加減
算結果の正規化に要するシフト数を求める第2の手段と
、前記第1の手段の判断結果により、前記第1の手段で
求めたシフト数、前記第2の手段で求めたシフト数の何
れか一方を出力する選択手段とを備えた浮動小数点演算
装置である。
Means for Solving the Problem The number of shifts required to normalize the floating-point addition/subtraction results is determined by the addition/subtraction instruction signal given from the outside, the upper two bits of the added/subtracted mantissa, and information about the exponent difference obtained in the mantissa digit alignment process. The first method is to determine whether or not the number of shifts is determined, and the second method is to determine the number of shifts required to normalize the result of floating-point addition and subtraction from all other bits except the most significant bit of the added and subtracted mantissas. 2, and selection means for outputting either the shift number obtained by the first means or the shift number obtained by the second means according to the determination result of the first means. It is a decimal point calculation device.

作   用 本発明は前記した構成により、浮動小数点仮数部加減算
結果の正規化に要するビット数を、前記第1の手段で求
まる場合は前記第1の手段で求め、前記第1の手段で求
まらない場合は前記第2の手段で求めるものである。
According to the above-described configuration, the present invention calculates the number of bits required for normalizing the floating point mantissa addition/subtraction results by the first means when the number of bits is determined by the first means; If not, it is determined by the second method.

実施例 第、1図は本発明の一実施例の正規化シフト数決定装置
のブロック図を示すものである。
Embodiment FIG. 1 shows a block diagram of a normalized shift number determination device according to an embodiment of the present invention.

第1図において 100は N1=(−1)”−2”−fl   ・  (1)で表
現される浮動小数点数Nlを保持するレジスタである。
In FIG. 1, 100 is a register that holds a floating point number Nl expressed as N1=(-1)"-2"-fl.(1).

ここで、elは指数、flは 絶対値表現の仮数、slは仮数flの符号であり、fl
は正規化されており、 l≦f1〈2          ・・・ (2)を満
たす。
Here, el is the exponent, fl is the mantissa in absolute value representation, sl is the sign of the mantissa fl, and fl
has been normalized and satisfies l≦f1<2 (2).

101は N2=  (−1) 92・2°2・ [2・・・  
(3)で表現される浮動小数点数N2を保持するレジス
タである。ここで、e2は指数、 f2は絶対値表現の
仮数、S2は仮数f2の符号であり、f2は正規化され
ており、 l≦f2〈2         ・・・ (4)を満た
す。
101 is N2= (-1) 92・2°2・[2...
This is a register that holds the floating point number N2 expressed in (3). Here, e2 is an exponent, f2 is a mantissa expressed as an absolute value, S2 is a sign of the mantissa f2, and f2 is normalized, and satisfies l≦f2<2 (4).

102はレジスタ100内の指数elからレジスタ10
1内の指数e2を減じその結果から、指数差信号Ed 
(= e t−e2)、指数差が0であること(el=
e2)を表す信号Ez、指数差信号Edの絶対値が2以
上であることを示す信号SM2、大なる方の指数etを
出力する指数演算器、103は指数演算器102の出力
Edをもとに、Ed≧0ならレジスタ100内の仮数f
tはそのまま、レジスタ101内の仮数f2は右にEd
ビットシフトして出力し、Ed<0ならレジスタ101
内の仮数f2はそのまま、レジスタ100内の仮数fl
は右にEdビットシフトして出力する桁合わせ回路、1
04は桁合わせ回路103の出力である仮数の加減算を
行ないその絶対値を出力する仮数演算器、105は仮数
演算器104の出力の21ビットを除く全てのビットを
人力とし、正規化に要するシフト数を求めるデコーダ、
106は組合せ回路で構成され、指数演算器102の出
力E2.5M2、仮数演算器104出力の21.211
ビット、外部から与えられる後述の加減算指示信号10
Bを人力とし、表に示すように正規化シフト数指定信号
と選択信号S E Lを出力する正規化制御回路、10
7は正規化制御回路106の出力である選択信号SEL
で制御され、デコーダ105の出力、正規化制御回路1
06の出力である正規化シフト数指定信号の何れかを仮
数部正規化シフト数として出力するセレクタ、108は
仮数演算器104、正規化制御回路106に演算モード
を与える加減算指示信号、109は仮数演算器104の
出力をセレクタ107の出力によって正規化シフトを行
ない最終結果としての仮数fを出力するバレルシフタ、
110は指数演算器102で選択された指数etをセレ
クタ107の出力で補正し最終結果とじての指数eを出
力する加算器である。
102 is from index el in register 100 to register 10
1, and from the result, the index difference signal Ed
(= e t-e2), and the index difference is 0 (el=
e2), a signal SM2 indicating that the absolute value of the exponent difference signal Ed is 2 or more, an exponent operator that outputs the larger exponent et, and 103 is based on the output Ed of the exponent operator 102. If Ed≧0, the mantissa f in register 100
t remains as is, and the mantissa f2 in register 101 is moved to the right.
Bit shift and output, if Ed<0, register 101
The mantissa f2 in the register 100 is the mantissa fl
is a digit alignment circuit that shifts Ed bits to the right and outputs it, 1
04 is a mantissa calculator that performs addition and subtraction on the mantissa output from the digit adjustment circuit 103 and outputs its absolute value. 105 is a mantissa calculator that manually inputs all bits except 21 bits of the output of the mantissa calculator 104 and shifts required for normalization. Decoder that calculates numbers,
106 is composed of a combinational circuit, the output E2.5M2 of the exponent operator 102, and the output 21.211 of the mantissa operator 104.
bit, an addition/subtraction instruction signal 10 (described later) given from the outside.
A normalization control circuit 10 in which B is operated manually and outputs a normalization shift number designation signal and a selection signal SEL as shown in the table.
7 is the selection signal SEL which is the output of the normalization control circuit 106.
The output of the decoder 105, the normalization control circuit 1
108 is an addition/subtraction instruction signal that gives the operation mode to the mantissa calculator 104 and the normalization control circuit 106; 109 is the mantissa; a barrel shifter that normalizes and shifts the output of the arithmetic unit 104 using the output of the selector 107 and outputs a mantissa f as a final result;
Reference numeral 110 denotes an adder that corrects the exponent et selected by the exponent operator 102 using the output of the selector 107 and outputs an exponent e as the final result.

以上のように構成された本実施例の浮動小数点演算処理
装置についてその動作を説明する。
The operation of the floating point arithmetic processing device of this embodiment configured as described above will be explained.

先ず、指数演算器102で、レジスタ100内の指数e
lからレジスタ100内の指数e2を減算し、et、 
 Ez、  Ed、、5M2の信号を出力する。桁合わ
せrEi回路103は信号Edに基づきレジスタ100
内の仮数flとレジスタ101内の仮数f2の桁合わせ
を行なう。桁合わせ結果は仮数演算器104に入力され
演算指示信号108で指示される加算もしくは減算が行
われ、その絶対値が出力される。仮数演算器104の出
力は正規化する必要があるが、ここで仮数演算器104
の出力について考察すると次のようになる。
First, the exponent operator 102 calculates the exponent e in the register 100.
Subtract the index e2 in the register 100 from l, et,
Outputs Ez, Ed, 5M2 signals. The digit alignment rEi circuit 103 adjusts the register 100 based on the signal Ed.
The digits of the mantissa fl in the register 101 and the mantissa f2 in the register 101 are aligned. The digit alignment result is input to the mantissa calculator 104, where addition or subtraction is performed as instructed by the calculation instruction signal 108, and its absolute value is output. The output of the mantissa calculator 104 needs to be normalized, but here the output of the mantissa calculator 104
Considering the output of , we get the following.

a)仮数演算器104で加算を行なう場合・el=e2
の場合(ケース1)(Ez=1.Ed=0) 仮数ft、f2の桁合わせは必要ないので加算後の仮数
は、(3)(4)式より、 2≦fl+f2<4          ・・・  (
5)となる。 (5)式の各辺を2で割ると、1≦(f
l+f2)/2<2     ・・・ (6)となり正
規化される。ここで、2での除算は右1ビットシフトで
実現される。
a) When performing addition in the mantissa calculator 104・el=e2
(Case 1) (Ez=1.Ed=0) Since there is no need to align the digits of the mantissas ft and f2, the mantissa after addition is as follows from equations (3) and (4): 2≦fl+f2<4... (
5). Dividing each side of equation (5) by 2, we get 1≦(f
l+f2)/2<2 (6) and is normalized. Here, division by 2 is realized by shifting one bit to the right.

・el>elの場合(Ez=0、Ed>O)桁合わせの
ため、桁合わせ回路103で仮数f2を指数差el−e
2=nビット 右シフトし、 1/m≦f2/m < 2/m  ・・・(7)(ここ
で、m=2’) を得る。そこで加算後の仮数は、 (3)、(7)式よ
り、 1<  1+1/m ≦ fl+f2/m< 2+2/
m <3   ・・・ (8)となる。そこで加算結果
、f 1 + f 2/rnを数直線上で示すと第2図
に示すようになる。
・If el>el (Ez=0, Ed>O), the digit matching circuit 103 converts the mantissa f2 to the exponent difference el−e for digit matching.
Shift to the right by 2=n bits to obtain 1/m≦f2/m<2/m (7) (here, m=2'). Therefore, from equations (3) and (7), the mantissa after addition is 1< 1+1/m ≦ fl+f2/m< 2+2/
m < 3... (8). Therefore, when the addition result, f 1 + f 2/rn, is shown on a number line, it becomes as shown in FIG.

第2図から明らかなように、21 ビット=1なら(ケ
ース2)加算結果は 2 ≦ fl  +f2/m  <  2+2/m・・
・  (9) の範囲にある。そして(9)式の各辺を2で割ると l≦(fl +f2/m)/2 < 1+1/mく2 
 ・・・(lO) なり正規化される。すなわち加算結果の右1ビットシフ
トで正規化が行なわれる。また、21ビット=0なら(
ケース3)加算結果はl ≦ 1+1/m S  fl
 +f2/m <  2・・・(11) の範囲にあり、正規化のための処理は不要となる。
As is clear from Figure 2, if 21 bits = 1 (case 2), the addition result is 2 ≦ fl + f2/m < 2+2/m...
・It is within the range of (9). Then, dividing each side of equation (9) by 2, l≦(fl +f2/m)/2 < 1+1/m×2
...(lO) and is normalized. That is, normalization is performed by shifting the addition result by one bit to the right. Also, if 21 bit = 0 (
Case 3) The addition result is l ≦ 1+1/m S fl
+f2/m<2 (11), and no normalization process is required.

・elくelの場合(Ez=0、Ed<0)el>el
の場合と同様の議論から、桁合わせ回路103で仮数f
lを指数差el−e2=nビット右シフトして加算を行
ない、加算結果を 2Iピツ)=1なら加算結果の右lビットシフト(ケー
ス2) 21ビット=0なら加算結果はシフトしない(ケース3
) と処理することで、正規化が行なわれる。
・In the case of el less el (Ez=0, Ed<0) el>el
From the same argument as in the case of , the mantissa f
Addition is performed by shifting l to the right by exponent difference el - e2 = n bits, and the addition result is 2I bits) = 1, the addition result is shifted to the right l bit (case 2). If 21 bit = 0, the addition result is not shifted (case 3
), normalization is performed.

b)仮数演算器104で減算を行なう場合・el=e2
の場合(ケース4)(Ez=1.Ed=0) 仮数f1.  f2の桁合わせは必要ないので減算後の
仮数は、(3)、 (4)式より、−1<fl−f2<
1       ・・・(12)もしくは、 −1<f2−fl<1      ・−(13)となる
。そこで、減算結果を正規化するには、減算結果を1ビ
ット以上複数ビット右にシフトする必要がある。
b) When subtracting with the mantissa calculator 104 el=e2
(Case 4) (Ez=1.Ed=0) Mantissa f1. Since there is no need to align the digits of f2, the mantissa after subtraction is -1<fl-f2< from equations (3) and (4).
1...(12) or -1<f2-fl<1.-(13). Therefore, in order to normalize the subtraction result, it is necessary to shift the subtraction result to the right by one or more bits.

”el>22の場合(Ez=O,Ed>O)加算の場合
と同様に桁合わせのため、仮数f2を指数差el−e2
=nビット右シフトしたのちfl−f2/mの減算(こ
こでm=2)を行う。そこで(3)、 (7)式より減
算後の仮数は、 0 ≦ 1−2/m <  fl −f2/m<2−1
/m<2   ・・・(14)となる。 (14)式を
数直線上で示すと第3図に示すようになる。第3図から
明らかなように、28ビット=1なら(ケース5)減算
結果は l ≦ f 1− f2/m <  2−1 /m〈 
2  ・・・(15) の範囲にあり、正規化のための処理は不要となる。また
、2 ビット=0なら 減算結果は、 0 ≦ 1−2/m <  f 1− f 2/rn 
<  1・・・(16) となることから、正規化のためには1ビット以上の複数
ビット左シフトを行う 必要がある。しかし、 m=2’、n=1.2.3、 −(17)であることか
ら、n=1の場合(ケース6)は減算結果の下限値1−
2/mは、 1−2/2  =  0          ・・・(
18)となり、正規化のためには複数ビット右シフトを
行う必要があるが、n≧2の場合(ケース7)、減算結
果の下限値1−2/rnは、1−2/4≦1−2/m 
< 1− (19)となる。すなわち、 (19)式の
各辺に2を乗じると、 l ≦ 2(1−2/m)<  2  − (20)と
なることから、この場合は、左1ビットシフトで減算結
果の正規化が行えることが判る。
``If el>22 (Ez=O, Ed>O), in order to align the digits as in the case of addition, the mantissa f2 is converted to the exponent difference el-e2
= After shifting to the right by n bits, subtraction of fl-f2/m (here m=2) is performed. Therefore, the mantissa after subtraction from equations (3) and (7) is 0 ≦ 1-2/m < fl -f2/m<2-1
/m<2 (14). When equation (14) is shown on a number line, it becomes as shown in FIG. As is clear from Fig. 3, if 28 bits = 1 (case 5), the subtraction result is l ≦ f 1- f2/m < 2-1 /m
2 (15), and no normalization process is required. Also, if 2 bits = 0, the subtraction result is 0 ≦ 1-2/m < f 1- f 2/rn
< 1 (16) Therefore, for normalization, it is necessary to perform a left shift of one or more bits. However, since m = 2', n = 1.2.3, -(17), in the case of n = 1 (case 6), the lower limit of the subtraction result is 1 -
2/m is 1-2/2 = 0...(
18), and it is necessary to perform a multiple-bit right shift for normalization, but if n≧2 (case 7), the lower limit of the subtraction result, 1-2/rn, is 1-2/4≦1. -2/m
< 1- (19). In other words, when each side of equation (19) is multiplied by 2, l ≦ 2 (1-2/m) < 2 - (20), so in this case, normalize the subtraction result by shifting 1 bit to the left. It turns out that it can be done.

拳ケース1:el<e2の場合(Ez=1、Ed<el
>e2の場合と同様の議論から、仮数flを指数差el
−e2=nビット右シフトして減算を行ない、減算結果
を 281ビット=1なら加算結果はシフトしない(ケース
5) 211ビット=Oで n=1なら複数ビット左シフトを行う (ケース6) n≧2なら左1ビットシフト行う (ケース7) と処理することで、正規化が行なわれる。
Fist case 1: When el<e2 (Ez=1, Ed<el
> From the same argument as in the case of e2, we can use the mantissa fl as the exponent difference el
-e2=N bits shifted to the right and subtracted, and if the subtraction result is 281 bits = 1, the addition result is not shifted (Case 5) If 211 bits = O and n = 1, multiple bits are shifted to the left (Case 6) n If ≧2, normalization is performed by performing a 1-bit shift to the left (case 7).

以上の議論に基づき、正規化制御回路10Bを表の人出
力関係を満たす組合せ回路で構成する。
Based on the above discussion, the normalization control circuit 10B is configured with a combinational circuit that satisfies the human output relationship in the table.

表中のケース番号は、上記説明で括弧内で示したケース
番号を意味している。すなわちケース4.6の場合以外
はSEL信号が1となり正規化に必要なシフト数はセレ
クタ107を経由し正規化制御回路10Gから直接与え
る。またケース4.6の場合はSEL信号が0となり正
規化に必要なシフト数はセレクタ107を経由しデコー
ダ107から与える。そしてセレクタ107の出力によ
って仮数演算器104の出力はバレルシフタ109で正
規化され、指数演算器102の出力etは加算器110
で補正され、それぞれ最終的な仮数f、指Wkeが得ら
れる。またデコーダ105では右シフト数を求める必要
はなく左シフト数のみを求めればよいので、仮数演算器
104の出力のうち2′の重みを持つビットは入力する
必要はない。
The case numbers in the table refer to the case numbers shown in parentheses in the above explanation. That is, except for case 4.6, the SEL signal is 1, and the number of shifts necessary for normalization is directly given from the normalization control circuit 10G via the selector 107. In case 4.6, the SEL signal becomes 0 and the number of shifts necessary for normalization is given from the decoder 107 via the selector 107. Then, the output of the mantissa operator 104 is normalized by the barrel shifter 109 according to the output of the selector 107, and the output et of the exponent operator 102 is normalized by the adder 110.
The final mantissa f and finger Wke are respectively obtained. Further, since the decoder 105 does not need to calculate the right shift number but only the left shift number, there is no need to input the bit having a weight of 2' out of the output of the mantissa calculator 104.

また、正規化に必要なシフト数を求めるのに必要な時間
は、ケース4.6では他のケースと比較して長くなる。
Further, the time required to obtain the number of shifts required for normalization is longer in case 4.6 than in other cases.

何故なら、ケース4.6では仮数演算器104の21の
重みをもつビットを除く全ての出力をデコーダ105で
デコードする必要があるが、ケース1では仮数部の加減
算を待たずして、ケース2.3.5.7では仮数演算器
104で加減算が終了した後、正規化制御回路106で
5ビットの入力をデコードすることで正規化に必要なシ
フト数が判定出来るからである。しかし、大量の浮動小
数点加減算を行なう場合、処理全体で評価するとこれら
の処理時間は出現するケースの平均となり、常にデコー
ダを使用する従来の方法と比較して高速になる。特に演
算精度向上のため仮数部のビット数を増加させた場合で
も、正規化制御回路106の人力ビット数は変わらない
ので、正規化に必要なシフト数を求めるのに必要な時間
は、従来例の方法より本実施例の方がより一層短かくな
る。従って本実施例のように正規化に必要なシフト数の
算出後に加算器110で指数補正を行っても、従来例の
場合と同等あるいはより短かい時間での補正が可能にな
り、かつそれに要するハードウェア資源も従来例と比べ
非常に少ないものに出来る。またデコーダ105では左
シフト数のみを出力すればよいので、デコーダ105で
左シフトか、右シフトかを示す信号を出力することが不
要になりデコーダ105が簡単になるという利点も生ま
れる。
This is because in case 4.6, all outputs of the mantissa calculator 104 except for the bits with a weight of 21 must be decoded by the decoder 105, but in case 1, case 2 This is because in .3.5.7, after addition and subtraction are completed in the mantissa calculator 104, the number of shifts required for normalization can be determined by decoding the 5-bit input in the normalization control circuit 106. However, when performing a large number of floating point additions and subtractions, these processing times are averaged over the cases that occur, and are faster than the conventional method that always uses a decoder. In particular, even if the number of bits of the mantissa is increased to improve calculation accuracy, the number of manual bits of the normalization control circuit 106 does not change, so the time required to obtain the number of shifts required for normalization is shorter than that of the conventional case. This embodiment is much shorter than the method described above. Therefore, even if the adder 110 performs the index correction after calculating the number of shifts required for normalization as in this embodiment, the correction can be made in the same or shorter time than in the conventional example, and the necessary Hardware resources can also be significantly reduced compared to conventional examples. Further, since the decoder 105 only needs to output the left shift number, there is an advantage that the decoder 105 does not need to output a signal indicating whether it is a left shift or a right shift, and the decoder 105 becomes simpler.

以上のように本発明によれば正規化制御回路106を設
けることにより、仮数演算器104出力の正規化に必要
なビット数の算出を、デコーダ105で求める方法と、
仮数演算器104出力の上位2ビットを含めた5ビット
で判断する方法の2通りで処理し、正規化制御回路10
6で論理的に゛正規化に必要なビット数が判定出来ない
場合のみ、デコーダ105の出力を使用する。従って、
大量の浮動小数点加減算を行った場合平均的に見ると、
正規化用シフト数を求めるのに要する時間は少なくなる
As described above, according to the present invention, by providing the normalization control circuit 106, the number of bits necessary for normalizing the output of the mantissa calculator 104 is calculated by the decoder 105;
The normalization control circuit 10 performs processing in two ways: one uses 5 bits including the upper 2 bits of the output of the mantissa arithmetic unit 104.
6, the output of the decoder 105 is used only when the number of bits required for normalization cannot be determined logically. Therefore,
On average, when performing a large number of floating point additions and subtractions,
The time required to obtain the normalization shift number is reduced.

発明の詳細 な説明したように本発明によれば仮数部加減算結果の正
規化に必要なシフト数を、桁合わせ処理で得られた指数
大小判定結果、指数差が2以上かの判定結果、仮数部加
減結果の上位2ビット、外部から与えられる加減算指示
信号から論理的に求まるか否かを判断し、求まる場合は
その求めた結果を出力する第1の手段と、仮数部加減算
結果の最上位ビットを除く全ての他のビットから求める
第2の手段とを設け、第1の手段でシフト数が求まらな
い場合のみ第2の手段の出力を使用することで、正規化
用シフト数を求めるのに要する時間を平均的には少なく
することができる。また第1の手段は簡単な紺合せ回路
で実現でき、その実用的効果は大きい。
As described in detail, according to the present invention, the number of shifts necessary for normalizing the mantissa addition/subtraction results is determined by the exponent size determination result obtained in the digit alignment process, the determination result of whether the exponent difference is 2 or more, and the mantissa. A first means for determining whether or not the upper two bits of the result of adding/subtracting the mantissa parts can be determined logically from the addition/subtraction instruction signal given from the outside, and outputting the determined result if the result is determined; The number of shifts for normalization can be determined by providing a second means for determining the number of shifts for normalization from all other bits except for the bit, and using the output of the second means only when the number of shifts cannot be determined by the first means. The time required for the calculation can be reduced on average. Moreover, the first means can be realized with a simple dark-blue matching circuit, and its practical effects are great.

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

第1図は本発明の一実施例における正規化シフト数決定
装慮のブロック図、第2図は加算結果の範囲を示す数直
線図、第3図は減算結果の範囲を示す数直線図、第4図
は従来の処理装置のブロック図を示す。 100.101・・・レジスタ、 102・・・指数演算器、103・・・桁合わせ回路、
104・・・仮数演算器、105・・・デコーダ、10
6・・・正規化制御回路、 107・・・セレクタ、108・・・加減算指示信号、
109・・・バレルシフタ、110・・・加算器。 代理人の氏名 弁理士 中尾敏男 はか1名第1図 第2図 7+ ’/m            2+ 27m第
3図 0    /    2 /−2/rn    2− ’/m
FIG. 1 is a block diagram of a device for determining the number of normalized shifts in an embodiment of the present invention, FIG. 2 is a number line diagram showing the range of addition results, and FIG. 3 is a number line diagram showing the range of subtraction results. FIG. 4 shows a block diagram of a conventional processing device. 100.101...Register, 102...Exponent operator, 103...Digit alignment circuit,
104... Mantissa calculator, 105... Decoder, 10
6... Normalization control circuit, 107... Selector, 108... Addition/subtraction instruction signal,
109... Barrel shifter, 110... Adder. Name of agent Patent attorney Toshio Nakao 1 person Figure 1 Figure 2 7+ '/m 2+ 27m Figure 3 0 / 2 /-2/rn 2- '/m

Claims (1)

【特許請求の範囲】[Claims] 外部から与えられる加減算指示信号、加減算された仮数
の上位2ビット、仮数桁合わせ処理で得られる指数差に
関する情報により、浮動小数点加減算結果の正規化に要
するシフト数が求まるか否かの判断と求まる場合はその
シフト数を求める第1の手段と、加減算された仮数の最
上位ビットを除く全ての他のビットから浮動小数点加減
算結果の正規化に要するシフト数を求める第2の手段と
、前記第1の手段の判断結果により、前記第1の手段で
求めたシフト数、前記第2の手段で求めたシフト数の何
れか一方を出力する選択手段とから構成されたことを特
徴とする正規化シフト数決定装置。
Based on the addition/subtraction instruction signal given from the outside, the upper 2 bits of the added/subtracted mantissa, and the information about the exponent difference obtained in the mantissa digit alignment process, it is determined whether or not the number of shifts required to normalize the floating point addition/subtraction results can be determined. a first means for calculating the number of shifts in the case of the case; a second means for calculating the number of shifts necessary for normalizing the floating point addition/subtraction result from all other bits except the most significant bit of the added and subtracted mantissa; and a selection means for outputting either the shift number obtained by the first means or the shift number obtained by the second means, depending on the determination result of the first means. Shift number determining device.
JP63035718A 1988-02-18 1988-02-18 Shift number for normalization deciding device Pending JPH01211026A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63035718A JPH01211026A (en) 1988-02-18 1988-02-18 Shift number for normalization deciding device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63035718A JPH01211026A (en) 1988-02-18 1988-02-18 Shift number for normalization deciding device

Publications (1)

Publication Number Publication Date
JPH01211026A true JPH01211026A (en) 1989-08-24

Family

ID=12449638

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63035718A Pending JPH01211026A (en) 1988-02-18 1988-02-18 Shift number for normalization deciding device

Country Status (1)

Country Link
JP (1) JPH01211026A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07225671A (en) * 1993-12-06 1995-08-22 Internatl Business Mach Corp <Ibm> Result normalization mechanism and method of operation

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07225671A (en) * 1993-12-06 1995-08-22 Internatl Business Mach Corp <Ibm> Result normalization mechanism and method of operation

Similar Documents

Publication Publication Date Title
US4941120A (en) Floating point normalization and rounding prediction circuit
US8626813B1 (en) Dual-path fused floating-point two-term dot product unit
EP0973089B1 (en) Method and apparatus for computing floating point data
US4926370A (en) Method and apparatus for processing postnormalization and rounding in parallel
KR100232962B1 (en) Fused floating point multiply and accumulate unit with carry correction
JPH02201645A (en) Exception detecting circuit
CN116643718B (en) Floating point fusion multiply-add device and method of pipeline structure and processor
JP3313560B2 (en) Floating point processor
EP0332215B1 (en) Operation circuit based on floating-point representation
JPH01211026A (en) Shift number for normalization deciding device
JP2558669B2 (en) Floating point arithmetic unit
US6654776B1 (en) Method and apparatus for computing parallel leading zero count with offset
JPH01282633A (en) Non-normalized number processing system
JP3233432B2 (en) Multiplier
JP3124286B2 (en) Floating point arithmetic unit
JPS5960637A (en) Arithmetic device for floating decimal point
JPH0498524A (en) Floating point arithmetic unit
JPH0293728A (en) arithmetic processing unit
JP3522387B2 (en) Pipeline arithmetic unit
JPH03171228A (en) Floating point number arithmetic unit
CN116382619A (en) Method, apparatus and system for floating point fused multiply add with merge 2 complement and rounding
JPH03168826A (en) floating point arithmetic unit
JPH04132538U (en) floating point arithmetic circuit
JPS6045844A (en) arithmetic device
JPH04213110A (en) Method and apparatus for floating-point arithmetic operation