JPH0675752A - Leading one predicting device and floating point addition/ subtraction device - Google Patents

Leading one predicting device and floating point addition/ subtraction device

Info

Publication number
JPH0675752A
JPH0675752A JP5158234A JP15823493A JPH0675752A JP H0675752 A JPH0675752 A JP H0675752A JP 5158234 A JP5158234 A JP 5158234A JP 15823493 A JP15823493 A JP 15823493A JP H0675752 A JPH0675752 A JP H0675752A
Authority
JP
Japan
Prior art keywords
subtraction
digit
bit
value
output
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
JP5158234A
Other languages
Japanese (ja)
Other versions
JP2752564B2 (en
Inventor
Genichiro Inoue
源一郎 井上
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 JP5158234A priority Critical patent/JP2752564B2/en
Publication of JPH0675752A publication Critical patent/JPH0675752A/en
Application granted granted Critical
Publication of JP2752564B2 publication Critical patent/JP2752564B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PURPOSE:To omit the normalizing process by calculating accurately the bit shift extent for normalization when the cancellation occurs in subtraction of the mantissa value in a floating point calculation mode. CONSTITUTION:A cancellation value predicting device 21 predicts the cancellation value within a 1-bit error range, and a borrow transmitting device 22 transmits the borrow given from the side of the least significant bit. Then a selector 23 corrects the output of the device 21 into an accurate bit shift extent based on the information on the device 22 and then the result is outputted for normalization.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、浮動小数点演算の加算
正規化の実行装置に関するものであり、更に詳しくは、
浮動小数点演算の加減算によって生じる桁落ち量を予測
する先行1予測装置、及びこの先行1予測装置を用いた
浮動小数点加減算装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a device for performing addition normalization of floating point arithmetic, and more specifically,
The present invention relates to a preceding 1 prediction device that predicts a precision loss caused by addition and subtraction of floating point arithmetic, and a floating point addition and subtraction device that uses the preceding 1 prediction device.

【0002】[0002]

【従来の技術】浮動小数点演算の加減算は、2つのオペ
ランドの符号と加減算の処理の組み合わせによって、仮
数値を減算する場合が発生する。この仮数値の減算によ
って、2つのオペランドの指数値の差の絶対値が1以下
である場合には、仮数値の桁落ちが2桁以上発生する場
合がある。前記桁落ちが発生した場合は、仮数値減算結
果を正規化するために桁落ち量を算出する過程と、前記
桁落ち量をもとに減算結果を正規化する過程が必要とな
る。ところが、前記仮数値減算結果の出力を待ってから
桁落ち量を算出し正規化していると加算正規化の実行時
間が長くなる。よって加算演算と独立した手段によっ
て、仮数値の減算の実行に先んじてまたは並列に、正規
化する際の桁落ち量を予測すれば、加算正規化の実行時
間が削減されることが知られていた。
2. Description of the Related Art In addition and subtraction of a floating point operation, a mantissa value may be subtracted depending on a combination of signs of two operands and addition and subtraction processing. When the absolute value of the difference between the exponent values of the two operands is 1 or less due to the subtraction of the mantissa value, there may be two or more digits missing in the mantissa value. When the digit loss occurs, a step of calculating the digit loss amount to normalize the mantissa value subtraction result and a step of normalizing the subtraction result based on the digit loss amount are necessary. However, if the digit cancellation amount is calculated and normalized after waiting for the output of the mantissa value subtraction result, the execution time of addition normalization becomes long. Therefore, it is known that the execution time of addition normalization can be reduced by predicting the amount of precision loss during normalization prior to execution of subtraction of the mantissa value or in parallel by means independent of addition operation. It was

【0003】従来例として、特開平2−144624号
公報がある。以下、この従来例(従来例1)について図
を用いて説明する。図8は、従来例1での桁落ち量予測
のアルゴリズムを、状態遷移図を用いて表した図であ
る。2の補数表現の2つのオペランドの対応ビット位置
のビット比較から生じるXOR(P,Propagate =伝
搬)、AND(G,Generate=発生)、NOR(Z,Zero=
ゼロ)状態信号を処理するネットワークの組み合わせを
最上位ビットの側から見ていくことによって、桁落ち量
を予測するものである。まず最上位ビットの状態(GMS
B,ZMSB,PMSB )が判別され、もし状態がGあるいはZ
であればシフト数を表す信号が発生される。この数は判
別された各連続状態信号のカウントであり、状態が真で
ある限りにおいて発生される。状態が偽になるとシフト
量信号の発生は停止され調整信号が発せられる。調整信
号は偽ビット位置における下位ビットからのキャリーに
基づいており、偽ビット位置の状態が加算結果の正負を
決定するのに使用される。
As a conventional example, there is JP-A-2-144624. The conventional example (conventional example 1) will be described below with reference to the drawings. FIG. 8 is a diagram showing an algorithm for predicting a digit loss amount in Conventional Example 1 using a state transition diagram. XOR (P, Propagate = propagation), AND (G, Generate = occurrence), NOR (Z, Zero =) resulting from bit comparison of corresponding bit positions of two operands of two's complement representation
The amount of cancellation is predicted by looking at the combination of networks that process the (zero) state signal from the most significant bit side. First, the state of the most significant bit (GMS
B, ZMSB, PMSB) is discriminated, and if the state is G or Z
If so, a signal representing the number of shifts is generated. This number is a count of each determined continuous state signal and is generated as long as the state is true. When the state becomes false, the generation of the shift amount signal is stopped and the adjustment signal is issued. The adjustment signal is based on the carry from the lower bit at the false bit position and the state of the false bit position is used to determine the sign of the addition result.

【0004】最上位ビットの状態がP(PMSB )である
と、シフト数信号の停止は偽ビット位置に続くビット位
置における状態信号の状態によることとなる。偽ビット
位置における第2状態(Gj またはZj )が第3状態の
状態信号(P→GならZ、P→ZならG)を伴うもので
ある場合にはシフト信号の発生は第3状態が偽となるま
で続く、あるいは、シフト信号は偽ビット位置に続くビ
ット位置で停止される。これらの場合において調整信号
はシフト信号が停止されたビット位置における下位ビッ
トからのキャリーに基づくこととなり、この位置におけ
る状態が加算結果の正負を決定することとなる。
When the state of the most significant bit is P (PMSB), the stop of the shift number signal depends on the state of the state signal at the bit position following the false bit position. If the second state (Gj or Zj) at the false bit position is accompanied by a state signal of the third state (Z if P → G, G if P → Z), the third state is false when the shift signal is generated. Or the shift signal is stopped at the bit position following the false bit position. In these cases, the adjustment signal will be based on the carry from the lower bit at the bit position where the shift signal was stopped, and the state at this position will determine the sign of the addition result.

【0005】この機構によって加減算回路とは別の手段
で、仮数値の加減算によって生じる最上位ビットから数
えて連続する0または1のビット数を、すなわち仮数値
の加減算結果が正になる時は連続する0の数、仮数値の
減算結果が負になる時は2の補数表現での連続する1の
数を求めることができる。
By this mechanism, the number of consecutive 0s or 1s counted from the most significant bit generated by the addition / subtraction of the mantissa value, that is, when the addition / subtraction result of the mantissa value becomes positive, is continuous by means different from the addition / subtraction circuit. When the result of subtracting the mantissa value is negative, the number of consecutive 1's in the two's complement representation can be obtained.

【0006】また、従来例として特開平5−53765
号公報がある。以下この従来例(従来例2)について図
を用いて説明する。
As a conventional example, Japanese Patent Laid-Open No. 5-53765.
There is a gazette. The conventional example (conventional example 2) will be described below with reference to the drawings.

【0007】図9は従来例2の先行1検出回路のブロッ
ク図である。同図中の804は、先行1検出回路の1桁
要素を表わす。
FIG. 9 is a block diagram of the leading 1 detection circuit of the second conventional example. Reference numeral 804 in the figure represents a one-digit element of the leading 1 detection circuit.

【0008】被減数Xと減数Yを各ビット毎に冗長2進
数値生成回路901に入力し、冗長2進数値Zsdが生成
される。kビット目に注目して説明すると、この冗長2
進回路では被減数Xk −減数Yk を実行し、冗長2進数
値Zsdk =1、0、−1が出力される。次にZsdk は中
間和中間桁上げ生成回路902に入力され、1ビット上
位のZsdk+1 を参照にして表1の規則に従って中間和S
k 、中間桁上げCk を生成する。
The minuend X and the subtraction Y are input to the redundant binary value generation circuit 901 for each bit, and the redundant binary value Zsd is generated. Explaining the kth bit, this redundancy 2
The decimal circuit executes the subtraction Xk-reduction Yk and outputs redundant binary values Zsdk = 1, 0, -1. Next, Zsdk is input to the intermediate sum intermediate carry generation circuit 902, and the intermediate sum S is added according to the rule of Table 1 by referring to Zsdk + 1 of 1 bit higher.
k, generate intermediate carry Ck.

【0009】[0009]

【表1】 [Table 1]

【0010】次に中間和Sk と1ビット下位ビットから
の中間桁上げCk-1 を用いてスキャン値生成回路903
において表2の規則に従ってスキャン値Zk を生成す
る。
Next, the scan value generation circuit 903 is performed by using the intermediate sum Sk and the intermediate carry Ck-1 from the lower bit of 1 bit.
At, the scan value Zk is generated according to the rules of Table 2.

【0011】[0011]

【表2】 [Table 2]

【0012】この時、Zの最上位ビットから数えて初め
て1が現われるまでの0の数は、正規化の際のビットシ
フト量か、それよりも1ビット少ない値を示しているの
で、このZをプライオリティエンコーダに入力すれば、
正規化の際のビットシフト量か1ビット少ない数を求め
ることができた。さらにはこの機構によって、加減算回
路と独立に、仮数値の減算結果の正負に関わらず、正規
化の際のビットシフト量か1ビット少ない数を求めるこ
とができる。
At this time, since the number of 0s from the most significant bit of Z until the first 1 appears is a bit shift amount at the time of normalization or a value 1 bit smaller than that, this Z Is input to the priority encoder,
It was possible to obtain the bit shift amount at the time of normalization or a number smaller by 1 bit. Further, by this mechanism, a bit shift amount for normalization or a number smaller by 1 bit can be obtained independently of the addition / subtraction circuit regardless of the sign of the subtraction result of the mantissa value.

【0013】次に、従来例2の先行1検出回路を用いた
浮動小数点加減算装置の仮数演算部のブロック図を図1
0に示す。仮数部、指数部、符号部からなる2つの浮動
小数点データX,Yに於て減算を実行する場合、桁合わ
せ処理、仮数部加減算処理、正規化処理の順で実行され
る。以下に図10に示す従来例2の先行1検出回路を使
用した浮動小数点加減算装置を例にして説明する。
Next, FIG. 1 is a block diagram of a mantissa arithmetic unit of a floating point addition / subtraction apparatus using the leading 1 detection circuit of the conventional example 2.
It shows in 0. When the subtraction is performed on the two floating-point data X and Y consisting of the mantissa part, exponent part, and sign part, digit alignment processing, mantissa part addition / subtraction processing, and normalization processing are executed in this order. The floating point addition / subtraction device using the leading 1 detection circuit of the conventional example 2 shown in FIG. 10 will be described below as an example.

【0014】まず第1に桁合わせ処理は以下のように実
行される。2つの入力オペランド指数部(Xe 、Ye )
は減算回路305、シフト信号生成回路304、セレク
タ回路306に入力される。また、同時に、オペランド
仮数部(1.Xf または0.Xf 、1.Yf または0.
Yf )も、左右1桁シフト回路301に入力される。こ
のとき、減算回路305では、オペランド指数値Xe 、
Ye を減算し、絶対値(Xe −Ye )と符号値(Xe −
Ye )とを生成する。また同時に、シフト信号生成回路
304では、それぞれの入力オペランドが、正規化数で
あるか否かを検出し、オペランドの符号値(Xs 、Ys
)と、減算実行信号SUBを使用し、2つの入力オペ
ランド仮数値を左右にシフトする制御信号をつくる。左
右シフト回路301では、シフト信号生成回路304か
らの制御信号を基に、2つの入力オペランド仮数値を右
または左にシフトする。左右シフト回路301の出力
は、スワップ回路302に入力され、ここで減算回路3
05から出力される符号値(Xe −Ye )に基づいて、
入力データがスワップされ、指数値の小さいオペランド
の仮数値は右バレルシフト回路303に入力され、もう
一方の指数値の小さくないオペランド仮数値は加減算回
路307に入力される。右バレルシフト回路303で
は、減算回路305から出力されるオペランド指数値の
差の絶対値(Xe −Ye )だけ入力値が右にシフトされ
る。このようにして、桁合わせ処理が実行される。
First, the digit alignment process is executed as follows. Two input operand exponents (Xe, Ye)
Is input to the subtraction circuit 305, the shift signal generation circuit 304, and the selector circuit 306. At the same time, the operand mantissas (1.Xf or 0.Xf, 1.Yf or 0.
Yf) is also input to the left / right one-digit shift circuit 301. At this time, in the subtraction circuit 305, the operand exponent value Xe,
Subtracting Ye, the absolute value (Xe-Ye) and the sign value (Xe-
Ye) and. At the same time, the shift signal generation circuit 304 detects whether or not each input operand is a normalized number, and the code values (Xs, Ys) of the operands are detected.
) And the subtraction execution signal SUB are used to create a control signal that shifts the two input operand mantissa values to the left or right. The left / right shift circuit 301 shifts the two input operand mantissa values to the right or left based on the control signal from the shift signal generation circuit 304. The output of the left / right shift circuit 301 is input to the swap circuit 302, where the subtraction circuit 3
Based on the code value (Xe-Ye) output from 05,
The input data is swapped, the mantissa value of the operand with a small exponent value is input to the right barrel shift circuit 303, and the other mantissa value of the operand with a small exponent value is input to the adder / subtractor circuit 307. In the right barrel shift circuit 303, the input value is shifted to the right by the absolute value (Xe-Ye) of the difference between the operand exponent values output from the subtraction circuit 305. In this way, the digit alignment process is executed.

【0015】第2に、加減算処理と丸め処理を加減算回
路307で実行する。
Secondly, addition / subtraction processing and rounding processing are executed by the addition / subtraction circuit 307.

【0016】第3に、正規化処理について説明する。前
記第2の加算処理、丸め処理と並行して、桁落ち量の予
測が先行1検出回路311、プライオリティエンコーダ
308を使用し実行される。そして予測された桁落ち量
は、プライオリティエンコーダ308よりZaeとして出
力される。
Thirdly, the normalization process will be described. In parallel with the second addition process and the rounding process, the prediction of the digit cancellation amount is executed by using the leading 1 detection circuit 311 and the priority encoder 308. The predicted digit cancellation amount is output as Zae from the priority encoder 308.

【0017】左バレルシフト回路309では、プライオ
リティエンコーダ308より出力される予測された桁落
ち量Zaeを使用し、加減算回路307の出力値を左シフ
トし出力する。また、同時に小数点より上位1桁目の値
を信号線L1 に出力する。L1 は、左シフトした後の値
が正規化されていなければ“0”であり、正規化されて
いれば“1”になる。もしL1 が“0”であれば、予測
された桁落ち量Zaeは1だけ小さかったということであ
るから1桁左シフトする必要がある。これはアライメン
ト回路312で実行される。
The left barrel shift circuit 309 shifts the output value of the adder / subtractor circuit 307 to the left by using the predicted digit cancellation amount Zae output from the priority encoder 308. At the same time, the value of the first digit higher than the decimal point is output to the signal line L1. L1 is "0" if the value after left shift is not normalized, and becomes "1" if it is normalized. If L1 is "0", it means that the predicted digit cancellation amount Zae was smaller by 1, so it is necessary to shift the digit to the left by one digit. This is executed by the alignment circuit 312.

【0018】また、同時に、予測された桁落ち量Zae
は、減算回路310にも入力され、減算回路310にお
いてZe ’−ZaeとZe ’−Zae−1の2つの減算が同
時に実行され、データ線L2 、L3 に出力される。そし
て、セレクタ回路313では、信号線L1 の値が“0”
であればZe ’−Zaeの減算結果を、信号線L1 の値が
“1”であればZe ’−Zae−1の減算結果Ze を出力
し、正規化処理が実現されていた。
At the same time, the predicted amount of cancellation Zae
Is also input to the subtraction circuit 310, and two subtractions Ze'-Zae and Ze'-Zae-1 are simultaneously executed in the subtraction circuit 310 and output to the data lines L2 and L3. Then, in the selector circuit 313, the value of the signal line L1 is "0".
If so, the subtraction result of Ze'-Zae is output, and if the value of the signal line L1 is "1", the subtraction result Ze of Ze'-Zae-1 is output, and the normalization processing is realized.

【0019】[0019]

【発明が解決しようとする課題】しかしながら上記従来
例1のような構成では、仮数値の減算結果が負になる場
合には2の補数表現での最上位ビットから連続する1の
数を求めることになるが、一般に浮動小数点フォーマッ
トでは仮数値は絶対値表現で表わすことになっているの
で、その変換を実行する際に、連続する1の数と正規化
の際のビットシフト量で1ビット誤差を生じる可能性が
あった。
However, in the configuration like the above-mentioned conventional example 1, when the subtraction result of the mantissa value is negative, the number of consecutive 1's is calculated from the most significant bit in the 2's complement representation. However, in the floating-point format, the mantissa value is generally expressed as an absolute value. Therefore, when performing the conversion, the number of consecutive 1s and the bit shift amount during normalization cause a 1-bit error. Could occur.

【0020】また、上記従来例2のような構成では、出
力するビットシフト量が正規化の際のビットシフト量か
正規化の際のビットシフト量よりも1ビット少ないビッ
トシフト量を出力するので、求まったビットシフト量で
仮数値減算結果を桁合わせする過程に加えてさらに1ビ
ットの誤差を修正するという過程が必要であった。
Further, in the configuration of the above-mentioned conventional example 2, the bit shift amount to be output is the bit shift amount at the time of normalization or the bit shift amount 1 bit less than the bit shift amount at the time of normalization. In addition to the process of digit-matching the mantissa value subtraction result with the obtained bit shift amount, a process of further correcting an error of 1 bit is necessary.

【0021】従って、本発明は上記問題点に鑑み、仮数
値の減算と並行して、または先んじて正規化の際のビッ
トシフト量を減算結果の正負にかかわらず正確に予測す
る先行1予測装置を提供すると同時に、この先行1予測
装置を使用して、仮数値の減算と正規化の際の正確なビ
ットシフト量の予測とを同時に実行することにより、高
速に演算処理ができる浮動小数点加減算器を提供するこ
とを目的とするものである。
Therefore, in view of the above problems, the present invention accurately predicts the bit shift amount at the time of normalization in parallel with or prior to the subtraction of the mantissa value, regardless of whether the subtraction result is positive or negative. And a floating point adder / subtractor capable of high-speed arithmetic processing by simultaneously performing subtraction of a mantissa value and prediction of an accurate bit shift amount at the time of normalization by using the preceding one predictor. It is intended to provide.

【0022】[0022]

【課題を解決するための手段】上記問題点を解決するた
めに本発明の先行1予測装置は、1ビットの誤差範囲で
前記桁落ち予測量を生成する手段と、下位ビット側から
のボロウの伝搬の情報を生成する手段とを備え、前記ボ
ロウの有無により、前記桁落ち予測量から正規化する際
に必要な正確なビットシフト量をセレクタで出力する構
成を備えたものである。
In order to solve the above-mentioned problems, the preceding one predictor of the present invention has a means for generating the above-mentioned precision loss amount within an error range of 1 bit, and a borrow from the lower bit side. A means for generating propagation information is provided, and the selector outputs an accurate bit shift amount necessary for normalizing the precision cancellation amount depending on the presence or absence of the borrow.

【0023】さらに、本発明の浮動小数点加減算装置
は、浮動小数点演算の仮数値の加減算回路において、桁
合わせ処理された後の2つの仮数値オペランドを加減算
回路と前記先行1予測装置とに同時に入力し、前記加減
算回路では減算を実行してその減算結果をバレルシフタ
に入力し、前記先行1予測装置から出力されるビットシ
フト量を用い、前記バレルシフタに入力された減算結果
をシフトする構成を備えたものである。
Further, in the floating-point addition / subtraction device of the present invention, in the addition / subtraction circuit of the floating-point operation mantissa value, the two mantissa value operands after the digit alignment processing are simultaneously input to the addition / subtraction circuit and the preceding one prediction device. Then, the addition / subtraction circuit executes subtraction, inputs the subtraction result to the barrel shifter, and shifts the subtraction result input to the barrel shifter using the bit shift amount output from the preceding one prediction device. It is a thing.

【0024】[0024]

【作用】本発明は上述した構成の先行1予測装置を用い
ることにより、仮数値減算時に生じる桁落ち量を、仮数
値の減算と並行してまたは先んじて減算結果の正負にか
かわらず正確に予測することができる。また、この先行
1予測装置を仮数値減算と同時に動作させることで、仮
数値減算結果が求められると同時に桁落ち量予測値を使
用し仮数値減算結果を正規化するため、高速な浮動小数
点加減算装置が実現できる。
According to the present invention, by using the preceding one predictor having the above-mentioned configuration, the amount of precision loss during mantissa value subtraction can be accurately predicted in parallel with or prior to the mantissa value subtraction, regardless of whether the subtraction result is positive or negative. can do. In addition, by operating this preceding 1 prediction device at the same time as the mantissa value subtraction, the mantissa value subtraction result is obtained, and at the same time, the digit cancellation amount prediction value is used to normalize the mantissa value subtraction result. The device can be realized.

【0025】[0025]

【実施例】以下、本発明の一実施例の先行1予測装置及
び浮動小数点加減算装置について、まず従来例2と本発
明との比較を行いながら概略を説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An outline of a preceding one predicting device and a floating point addition / subtraction device according to an embodiment of the present invention will be described below by first comparing a conventional example 2 with the present invention.

【0026】従来例2では正規化の際のビットシフト量
を正しく示す場合と、1ビット少ない値を示す場合があ
ったが、これらの場合についてさらに詳しく例を用いて
説明する。
In the conventional example 2, the bit shift amount at the time of normalization may be indicated correctly and the value may be indicated by one bit less. These cases will be described in more detail using examples.

【0027】例えば入力ビット数が被減数、減数共に8
ビットの場合について考える。被減数X(7:0)−減
数Y(7:0)を実行して、X>Yの場合で、最下位ビ
ットを0ビットとして第3ビットに初めてスキャン値Zk
=1が現われる状況を考えると、 Z=00001ααα :α=0または1 となる。
For example, the number of input bits is 8 for both the subtracted number and the reduced number.
Consider the case of bits. Subtracting X (7: 0) -reduction Y (7: 0) is executed, and when X> Y, the scan value Zk is set to the third bit for the first time with the least significant bit as 0 bit.
Considering the situation where = 1 appears, Z = 00001ααα: α = 0 or 1.

【0028】この場合、X(7:0)−Y(7:0)=
差S(7:0)とし、この差Sの最大値をmaxS1 、最小
値をminS1 とすると、 maxS1 =00001111 minS1 =00000101 となる。さらに、正しいビットシフト量を示す場合の最
大値をmaxS2 、最小値をminS2 、1ビット少ないビット
シフト量を示す場合の最大値をmaxS3 、最小値をminS3
とすると、 maxS2 =00001111 minS2 =00001000 maxS3 =00000111 minS3 =00000101 となる。
In this case, X (7: 0) -Y (7: 0) =
If the difference S (7: 0) is set, the maximum value of this difference S is maxS1, and the minimum value is minS1, then maxS1 = 000011111 minS1 = 00000101. Further, when the correct bit shift amount is indicated, the maximum value is maxS2, the minimum value is minS2, the maximum value when the bit shift amount is 1 bit less is maxS3, and the minimum value is minS3.
Then, maxS2 = 00001111 minS2 = 00001000 maxS3 = 00000111 minS3 = 00000101.

【0029】1ビット少ないビットシフト量を示す場合
は初めてZk =1となったビット(最下位ビットをk=
0とし、この例の場合はk=3)の1つ下位のビット
(この例の場合はk=2)以下のビットによる減算X
(2:0)−Y(2:0)が負になった場合に対応して
いることがわかる。
When the bit shift amount is reduced by one bit, the first Zk = 1 bit (the least significant bit is k =
0, and in the case of this example, subtraction X by bits less than or equal to the bit one lower than k = 3) (k = 2 in this example)
It can be seen that this corresponds to the case where (2: 0) -Y (2: 0) becomes negative.

【0030】同様にY>Xの場合にはX(2:0)−Y
(2:0)が正になった場合に対応していることがわか
る。
Similarly, when Y> X, X (2: 0) -Y
It can be seen that this corresponds to the case where (2: 0) becomes positive.

【0031】この例では入力が8ビットの場合について
説明したが、一般の任意の入力ビット数についても、従
来例2では初めてZk =1となったビットの1つ下位の
ビット以下の減算結果が、 X>Yの場合:X(k-1 :0)−Y(k-1 :0)<0 Y>Xの場合:X(k-1 :0)−Y(k-1 :0)>0 の場合に1ビット少ないビットシフト量を示すことがわ
かる。
In this example, the case where the input is 8 bits has been described. However, even in the case of a general arbitrary input bit number, in the conventional example 2, a subtraction result less than or equal to the bit one lower than the bit for which Zk = 1 is first obtained. , X> Y: X (k-1: 0) -Y (k-1: 0) <0 Y> X: X (k-1: 0) -Y (k-1: 0)> It can be seen that when 0, the bit shift amount is one bit smaller.

【0032】本発明は、上で説明したような1ビット少
ないビットシフト量を示す場合にも対応して、正規化の
際の正しいビットシフト量に修正して出力するようにし
たものである。
The present invention corrects and outputs the correct bit shift amount at the time of normalization, corresponding to the case where the bit shift amount is reduced by one bit as described above.

【0033】すなわち、 1) X>Y、 2) Y>X、 3) X(k−1:0)>Y(k−1:0)、 4) Y(k−1:0)>X(k−1:0) の4つの情報を用いて従来例2の最上位ビットから数え
て初めて現われるスキャン値Zk =1の位置を修正して
出力することによって、減算結果が正負にかかわらず正
規化の際の正確なビットシフト量を出力することができ
るようにしたものである。
That is, 1) X> Y, 2) Y> X, 3) X (k-1: 0)> Y (k-1: 0), 4) Y (k-1: 0)> X ( k-1: 0) is used to correct and output the position of the scan value Zk = 1 which appears for the first time from the most significant bit of Conventional Example 2 and is then normalized regardless of whether the subtraction result is positive or negative. In this case, it is possible to output an accurate bit shift amount.

【0034】上記した4つの情報をどのようにして得て
いるかというと、まず1)X>Yと、2)Y>Xとを区
別するために、従来例2で作成する2進数値であるスキ
ャン値Zk を作成する代わりに、冗長2進数値ZZk を
表3に従って作成する。
How to obtain the above four pieces of information is the binary value created in the conventional example 2 in order to distinguish 1) X> Y and 2) Y> X. Instead of creating the scan value Zk, the redundant binary value ZZk is created according to Table 3.

【0035】[0035]

【表3】 [Table 3]

【0036】こうすることにより、初めて現われるZZ
k ≠0がZZk =1の場合は1)X>Y、ZZk =−1
の場合は2)Y>Xとなることになる。なお、ZZk =
0は従来例2でのZk =0に対応し、ZZK ≠0はZk
=1に対応している。
By doing so, ZZ which appears for the first time
When k ≠ 0 is ZZk = 1, 1) X> Y, ZZk = -1
In the case of, 2) Y> X. ZZk =
0 corresponds to Zk = 0 in the conventional example 2, and ZZK ≠ 0 corresponds to Zk.
Corresponds to = 1.

【0037】次に、X(k-1 :0)とY(k-1 :0)と
の大小関係の情報をどのようにして得ているかを説明す
る。
Next, how to obtain information on the magnitude relationship between X (k-1: 0) and Y (k-1: 0) will be described.

【0038】例えばX(k-1 :0)<Y(k-1 :0)の
場合には、X(n:0)−Y(m:0)(n≧k、m≧
k)を実行した場合にX(k-1 :0)−Y(k-1 :0)
<0となるために、X(k)の桁に、桁借り(ボロウB
x (k))が発生することがわかる。同様にX(k-1 :
0)>Y(k-1 :0)の場合にはY(m:0)−X
(n:0)を実行した場合にY(k-1 :0)−X(k-1
:0)<0となるために、Y(k)の桁に、桁借り
(ボロウBy (k))が発生することがわかる。よって
本実施例ではボロウ伝搬装置を導入し、Bx (k)とB
y (k)を作成することにより、X(k-1 :0)とY
(k-1 :0)の大小関係の情報を得ている。
For example, when X (k-1: 0) <Y (k-1: 0), X (n: 0) -Y (m: 0) (n≥k, m≥
x (k-1: 0) -Y (k-1: 0) when executing k)
Since <0, the borrow (borrow B
It can be seen that x (k)) occurs. Similarly, X (k-1:
0)> Y (k-1: 0), Y (m: 0) -X
When (n: 0) is executed, Y (k-1: 0) -X (k-1
It can be seen that a borrow (borrow By (k)) occurs in the digit of Y (k) because: 0) <0. Therefore, in the present embodiment, a borrow propagation device is introduced, and Bx (k) and Bx
By creating y (k), X (k-1: 0) and Y
Information on the magnitude relation of (k-1: 0) is obtained.

【0039】さらに、1)X>Yと4)Y(k-1 :0)
>X(k-1 :0)との組合せの場合と、2)Y>Xと
3)X(k-1 :0)>Y(k-1 :0)との組合せの場合
に最上位ビットから数えて初めて現われたZZk ≠0ま
でに連続するZZk =0の数を1つ増やす操作をするセ
レクタを備えており、これらの働きにより、本発明の実
施例では、減算結果の正負にかかわらず正確な正規化の
際のビットシフト量を求めている。こうしておいて、前
記出力をプライオリティエンコーダに入力すれば、減算
結果を正規化するためのビットシフト数を得ることがで
きる。
Further, 1) X> Y and 4) Y (k-1: 0)
> X (k-1: 0) in combination, 2) Y> X and 3) X (k-1: 0)> Y (k-1: 0) in combination with the most significant bit It is provided with a selector for increasing the number of consecutive ZZk = 0 until ZZk ≠ 0, which appears for the first time from the above, by these functions. In the embodiment of the present invention, regardless of whether the subtraction result is positive or negative, The bit shift amount for accurate normalization is obtained. By thus inputting the output to the priority encoder, the bit shift number for normalizing the subtraction result can be obtained.

【0040】このビットシフト数を用いて、バレルシフ
タで2進絶対値表現での仮数値減算結果をシフトするこ
とによって、仮数値減算及び正規化が完了する。
The mantissa value subtraction and the normalization are completed by shifting the mantissa value subtraction result in the binary absolute value representation by the barrel shifter using this bit shift number.

【0041】以下、図面を参照して説明する。A description will be given below with reference to the drawings.

【0042】図1は、本発明である先行1予測装置を用
いた仮数値の加算系回路の構成図である。図1におい
て、11は仮数値を加減算し、絶対値を出力をする加減
算回路、12は桁落ち量を予測するための本発明の構成
を有する先行1予測装置、13は正規化するために仮数
値をシフトさせるバレルシフタ、14はプライオリティ
エンコーダである。
FIG. 1 is a block diagram of a mantissa value addition system circuit using the leading one predictor according to the present invention. In FIG. 1, 11 is an adder / subtractor circuit that adds and subtracts a mantissa value and outputs an absolute value, 12 is a preceding 1 prediction device having the configuration of the present invention for predicting a digit cancellation amount, and 13 is a temporary value for normalization. A barrel shifter for shifting a numerical value, and 14 is a priority encoder.

【0043】図2は、本発明の入力オペランドが8ビッ
トの場合の先行1予測装置12のブロック図である。図
2において、21は加減算回路と独立に1ビットの誤差
範囲で桁落ち量を予測する桁落ち量予測装置である。こ
の装置で前述した冗長2進数であるスキャン値ZZk =
1、0、−1の値を出力する。22は加減算回路と独立
に下位ビットからのボロウの伝搬を出力するボロウ伝搬
装置である。この装置で、任意のkに対する前述したボ
ロウBx (k)、By (k)を出力する。23はボロウ
伝搬装置22からの出力によって、桁落ち量予測装置2
1の出力から、正規化に必要なビットシフト量を操作す
るセレクタである。
FIG. 2 is a block diagram of the preceding one predictor 12 when the input operand of the present invention is 8 bits. In FIG. 2, reference numeral 21 denotes a digit loss amount predicting device that estimates the digit loss amount within a 1-bit error range independently of the addition / subtraction circuit. The scan value ZZk = redundant binary number described above in this device
The value of 1, 0, -1 is output. Reference numeral 22 denotes a borrow propagation device that outputs the propagation of borrow from the lower bit independently of the adder / subtractor circuit. This device outputs the above-mentioned borrows Bx (k) and By (k) for an arbitrary k. Reference numeral 23 indicates a digit cancellation amount predicting device 2 based on the output from the borrow propagation device 22.
It is a selector that operates the bit shift amount required for normalization from the output of 1.

【0044】図3は、桁落ち量予測装置21をゲートレ
ベルで書いた詳細図である。図3において31、32は
8ビットの入力オペランドであり、PLUS33、MINUS 3
4はスキャン値ZZk を、ZZk =1の時はPLUS=1か
つMINUS =0、ZZk =0の時はPLUS=0かつMINUS =
0、ZZk =−1の時はPLUS=0かつMINUS =1で出力
するための信号線である。このときPLUS=1かつMINUS
=1になる状態は存在しない。ここで、最上位ビットか
らみて初めてZZk ≠0が現われるまでに連続した0の
ビット数が、すなわち最上位ビットからみて初めてPLUS
=“1”またはMINUS =“1”のどちらか早く現われる
方が現われるまでに連続したPLUS=“0”またはMINUS
=“0”の数が、下位ビットからのボロウを考慮に入れ
なかった場合の桁落ち量に相当する。ここで初めて現わ
れたZZk =0以外の数字がZZk =1の場合は仮数値
の減算結果が正、ZZK =−1の場合は負の場合に対応
している。
FIG. 3 is a detailed diagram of the digit loss amount predicting device 21 written at the gate level. In FIG. 3, 31 and 32 are 8-bit input operands, and PLUS 33 and MINUS 3
4 is the scan value ZZk, when ZZk = 1, PLUS = 1 and MINUS = 0, and when ZZk = 0, PLUS = 0 and MINUS =
When 0 and ZZk = -1, it is a signal line for outputting with PLUS = 0 and MINUS = 1. At this time, PLUS = 1 and MINUS
There is no state where = 1. Here, the number of consecutive 0s until ZZk ≠ 0 appears for the first time from the most significant bit, that is, PLUS for the first time from the most significant bit.
= "1" or MINUS = "1", whichever comes first, PLUS = "0" or MINUS
The number of = “0” corresponds to the digit loss amount when the borrow from the lower bit is not taken into consideration. Here, when the number other than ZZk = 0 that appears for the first time is ZZk = 1, the result of subtraction of the mantissa value is positive, and when ZZk = -1, it corresponds to the negative case.

【0045】Gx 35、Gy 36、P37はボロウ伝搬
装置に出力するための各ビットに対するビット線で、G
x 35は(NOT オペランドX)AND (オペランドY)す
なわち(Xk 、Yk )=(0、1)、Gy 36は(オペ
ランドX)AND (NOT オペランドY)すなわち(Xk 、
Yk )=(1、0)、P37は(オペランドX)XNOR
(オペランドY)すなわち(Xk 、Yk )=(0、0)
or(1、1)を示す。Gx (n)35は、オペランドX
の第nビットがボロウを発生したという信号で、Gy
(n)36はオペランドYの第nビットがボロウを発生
したという信号で、P(n)37は下位ビットからのボ
ロウを伝搬する信号である。Gx (n)35及びGy
(n)36において6ビット目を必要としていないの
は、7ビット目の冗長2進減算に於て、6ビット目を既
に考慮しているためである。
Gx 35, Gy 36, and P37 are bit lines for each bit to be output to the borrow propagation device, and Gx
x 35 is (NOT operand X) AND (operand Y), that is, (Xk, Yk) = (0, 1), and Gy 36 is (operand X) AND (NOT operand Y), that is, (Xk,
Yk) = (1,0), P37 is (operand X) XNOR
(Operand Y), that is, (Xk, Yk) = (0, 0)
Indicates or (1, 1). Gx (n) 35 is the operand X
Gy is a signal that the nth bit of
(N) 36 is a signal that the nth bit of the operand Y has generated a borrow, and P (n) 37 is a signal that propagates the borrow from the lower bit. Gx (n) 35 and Gy
The reason why the 6th bit is not required in (n) 36 is that the 6th bit has already been taken into consideration in the redundant binary subtraction of the 7th bit.

【0046】図4は、ボロウ伝搬装置22をゲートレベ
ルで書いた図である。図4において41はプリチャージ
ラインをプリチャージ、ディスチャージし、プリチャー
ジラインの値を出力するための外部からのクロックの入
力(クロック1)で、42はプリチャージラインの値を
出力するためのクロックの入力(クロック2)であり、
クロック1の位相と反転した位相を持っている。131
から144はプリチャージラインであり、このラインは
クロック1が“0”の時にプリチャージされ、クロック
1が“1”の時でグラウンドへのパスが開いてる場合デ
ィスチャージされる。Bx 39はオペランドXからのボ
ロウがnビット目に伝搬しているという信号で、By 4
0はオペランドYからのボロウがnビット目に伝搬して
いるという信号である。Bx 39及びBy 40において
0ビット目、1ビット目を共に必要としていないのは、
0ビット目に伝播するボロウはないこと、1ビット目に
伝播するボロウはすでにZZk を作成する際に考慮され
ているためである。
FIG. 4 is a diagram in which the borrow propagation device 22 is written at the gate level. In FIG. 4, 41 is an external clock input (clock 1) for precharging and discharging the precharge line and outputting the value of the precharge line, and 42 is a clock for outputting the value of the precharge line. Input (clock 2) of
It has a phase opposite to that of clock 1. 131
Numerals 144 to 144 are precharge lines which are precharged when clock 1 is "0" and discharged when clock 1 is "1" and a path to ground is open. Bx 39 is a signal that the borrow from the operand X is propagated to the nth bit, and By 4
0 is a signal that the borrow from the operand Y is propagated to the nth bit. Bx 39 and By 40 do not require both 0th bit and 1st bit,
This is because there is no borrow propagating to the 0th bit and the borrow propagating to the 1st bit has already been taken into consideration when creating ZZk.

【0047】一般に、ボロウの伝搬は、 B(n)=G(n)+P(n)*G(n-1) =G(n)+P(n)*{P(n-1)*G(n-2)+P(n-1) *P(n-2)*G(n-3)+ …} (1) で表される。In general, borrow propagation is B (n) = G (n) + P (n) * G (n-1) = G (n) + P (n) * {P (n-1) * G ( n-2) + P (n-1) * P (n-2) * G (n-3) + ...} It is represented by (1).

【0048】式(1)が成り立つビットのプリチャージ
ラインは、クロック1が“1”の時にディスチャージさ
れるようになっている。よってこのディスチャージされ
たビットには下位ビットからのボロウがあるので、イン
バータを通して出力すれば、下位ビットからのボロウの
あるビットを立てることができるが、前記インバータを
クロック1が“0”の時にハイインピーダンスになるト
ライステートインバータを用いることにより、配線容量
等の浮遊容量を利用して、クロック信号が“0”の時に
もクロック信号が“1”の時の状態を保持することがで
きるようにしている。
The bit precharge line for which the equation (1) is satisfied is discharged when the clock 1 is "1". Therefore, since the discharged bit has a borrow from the lower bit, it is possible to set a bit having a borrow from the lower bit by outputting it through an inverter. However, when the clock 1 is "0", the inverter is set to high level. By using a tri-state inverter that becomes an impedance, it is possible to maintain the state when the clock signal is "1" even when the clock signal is "0" by using the floating capacitance such as the wiring capacitance. There is.

【0049】図5は、セレクタ23をより詳しく書いた
図である。図5において51はデマルチプレクサで、桁
落ち量予測装置21の出力PLUS33とMINUS 34、すな
わちZZk =1、0、−1から、ボロウ伝搬装置22か
らの出力Bx 39とBy 40の情報、すなわちY(k-1
:0)>X(k-1 :0)、X(k-1 :0)>Y(k-1:
0)により、正規化の際のビットシフト量を選択する。
FIG. 5 is a diagram showing the selector 23 in more detail. In FIG. 5, reference numeral 51 is a demultiplexer, which is information from the outputs PLUS33 and MINUS 34 of the precision cancellation device 21, that is, ZZk = 1, 0, −1, and the information Bx 39 and By 40 from the borrow propagation device 22, that is, Y. (K-1
: 0)> X (k-1: 0), X (k-1: 0)> Y (k-1:
0) selects the bit shift amount for normalization.

【0050】図6は、デマルチプレクサ51をトランジ
スタレベルで書いた図である。出力PLUS(k)33に前
記ボロウ伝搬装置からの出力Bx (k)36が“0”な
らばPLUS(k)の位置をそのままLZA (k)として出力
し、“1”ならばPLUS(k)の位置を1ビット下位ビッ
トに修正してLZA (k-1 )として出力する。同様に、出
力MINUS (k)34にボロウ伝搬装置22からの出力B
y (k)37が“0”ならばMINUS (k)の位置をその
ままLZA (k)として出力し、“1”ならばMINUS
(k)の位置を1ビット下位ビットに修正してLZA (k-
1 )として出力する。これは桁落ち量予測装置21から
の出力に下位ビットからのボロウがあった場合、すなわ
ち1)X>Yかつ4)Y(k-1 :0)>X(k-1 :
0)、または、2)Y>Xかつ3)X(k-1 :0)>Y
(k-1 :0)の場合に桁落ち量が1ビット多くなるよう
に修正することに対応している。この出力LZA (7:
0)をプライオリティエンコーダに入力して、最上位ビ
ットから連続するゼロの数を数えると、その数が正規化
する際のビットシフト量である。
FIG. 6 is a diagram in which the demultiplexer 51 is written at the transistor level. If the output Bx (k) 36 from the borrow propagation device is "0", the position of PLUS (k) is directly output as LZA (k) to the output PLUS (k) 33, and if it is "1", PLUS (k) is output. The position of is corrected to 1 bit lower bit and output as LZA (k-1). Similarly, the output B from the borrow propagation device 22 is output to the output MINUS (k) 34.
If y (k) 37 is "0", the position of MINUS (k) is output as LZA (k), and if "1", MINUS is output.
Correct the position of (k) to 1 bit lower bit and change LZA (k-
Output as 1). This is when there is a borrow from the lower bit in the output from the digit loss amount prediction device 21, that is, 1) X> Y and 4) Y (k-1: 0)> X (k-1:
0) or 2) Y> X and 3) X (k-1: 0)> Y
In case of (k-1: 0), it corresponds to the correction so that the digit cancellation amount is increased by 1 bit. This output LZA (7:
When 0) is input to the priority encoder and the number of consecutive zeros from the most significant bit is counted, the number is the bit shift amount for normalization.

【0051】次に、上記構成による動作を例を使って説
明する。例として、仮数値桁合わせ後の入力として8ビ
ットのオペランドX(7:0)=11010100、Y
(7:0)=11001101がX(7:0)−Y
(7:0)として入力された場合を考える。まず桁落ち
量予測装置21にオペランドX(7:0)=11010
100、Y(7:0)=11001101が入力され
る。実際の2進減算では差SはS(7:0)=0000
0111である。桁落ち量予測装置21では、冗長2進
数であるスキャン値ZZk が生成され、その結果として
PLUS(7:0)33=00001000、MINUS (7:
0)34=00000001、すなわちZZk=000
0100T(T=−1)が出力される。この段階で最上
位から数えて初めて現われるZZk ≠0がZZk =1な
ので、X>Yであることがわかる。
Next, the operation of the above configuration will be described using an example. As an example, an 8-bit operand X (7: 0) = 111010100, Y as an input after digit matching of mantissa values
(7: 0) = 11001101 is X (7: 0) -Y
Consider the case where it is input as (7: 0). First, the operand loss X (7: 0) = 111010 is input to the precision canceller 21.
100, Y (7: 0) = 11001011, is input. In the actual binary subtraction, the difference S is S (7: 0) = 0000
It is 0111. The digit cancellation amount predicting device 21 generates a scan value ZZk which is a redundant binary number, and as a result thereof,
PLUS (7: 0) 33 = 00001000, MINUS (7:
0) 34 = 00000001, that is, ZZk = 000
0100T (T = -1) is output. At this stage, ZZk ≠ 0, which first appears from the highest rank and appears ZZk = 1, shows that X> Y.

【0052】ボロウ伝搬装置22への出力として、オペ
ランドXからボロウが発生する可能性があるビットを示
すGx (5:0)35=001001、オペランドYか
らボロウが発生する可能性があるビットを示すGy
(5:0)36=010000、ボロウの伝搬を示すP
(6:1)37=110011が出力される。
As an output to the borrow propagation device 22, Gx (5: 0) 35 = 001001 which indicates a bit that a borrow may occur from the operand X, and a bit which a borrow may occur from the operand Y are shown. Gy
(5: 0) 36 = 010000, P indicating borrow propagation
(6: 1) 37 = 110011 is output.

【0053】次に、ボロウ伝搬装置22でクロック1が
“0”の時にプリチャージライン131〜144をプリ
チャージしておき、クロック1が“1”の時に前記Gx
(5:0)35=001001、Gy (5:0)36=
010000、P(6:1)37=110011を入力
する。すると、プリチャージライン131、132、1
33、134、142、143、144からグラウンド
へのパスができて、ディスチャージされる。この段階で
クロック2を“0”にすると、ボロウ伝搬装置22の出
力からBx (7:2)39=000111、By (7:
2)40=111000が出力される。すなわち最上位
ビットから数えてZZ(4)で初めてZZk ≠0とな
り、しかもZZk =1なのでX>Yである。この時のボ
ロウBx (4)を見るとBx (4)=1となっており、
この場合には最上位ビットから数えて初めてZZk ≠0
となる所まで連続する0の数を1ビット増やす必要があ
る場合である。
Next, in the borrow propagation device 22, the precharge lines 131 to 144 are precharged when the clock 1 is "0", and when the clock 1 is "1", the Gx
(5: 0) 35 = 001001, Gy (5: 0) 36 =
Input 010000 and P (6: 1) 37 = 110011. Then, the precharge lines 131, 132, 1
A path from 33, 134, 142, 143, 144 to ground is created and discharged. If the clock 2 is set to "0" at this stage, Bx (7: 2) 39 = 000111 and By (7:
2) 40 = 111000 is output. That is, since ZZk ≠ 0 for the first time in ZZ (4) counting from the most significant bit, and ZZk = 1, X> Y. Looking at the borrow Bx (4) at this time, Bx (4) = 1,
In this case, ZZk ≠ 0 for the first time from the most significant bit.
This is the case where it is necessary to increase the number of consecutive 0s by 1 bit until

【0054】次に、セレクタ23にPLUS(7:0)33
=00001000、MINUS (7:0)34=0000
0001(すなわちZZ(7:0)=(0000100
T)(T=−1))、Bx (7:2)39=00011
1、By (7:2)40=111000を入力すると、
LZA (7:0)38=00000101が出力される。
LZA (7:0)=00000101は、最上位ビットか
らみていって初めて1が現われたビットまで0が5ビッ
ト続いているので、正規化の際のビットシフト数は5ビ
ットである。よって、この結果を最上位ビットから見て
いくプライオリティエンコーダ24に入力すれば、バレ
ルシフタに入力するデコードされた正規化の際のビット
シフト信号“101”が求められる。この2進数値“1
01”は10進数表現では5である。
Next, the PLUS (7: 0) 33 is sent to the selector 23.
= 00001000, MINUS (7: 0) 34 = 0000
0001 (that is, ZZ (7: 0) = (0000100
T) (T = -1)), Bx (7: 2) 39 = 000011
If you enter 1, By (7: 2) 40 = 111000,
LZA (7: 0) 38 = 00000101 is output.
In LZA (7: 0) = 00000101, 5 bits of 0 continue until the bit in which 1 appears for the first time from the most significant bit, so the number of bit shifts in normalization is 5 bits. Therefore, if this result is input to the priority encoder 24 which looks at the most significant bit, the bit shift signal "101" for the decoded normalization input to the barrel shifter is obtained. This binary value "1"
01 "is 5 in decimal notation.

【0055】なお、この例ではX(7:0)がY(7:
0)よりも大きい場合について述べたが、X(7:0)
がY(7:0)よりも小さい場合についても同様の効果
が得られる。本実施例では先行1予測装置は仮数値加減
算回路と独立な構成となっているが、例えばボロウ伝搬
装置を仮数値加減算回路と共有する構成にすればボロウ
伝搬装置の部分を省略することもできる。8ビット構成
に限らず、一般に何ビットの構成にしても構わない。
In this example, X (7: 0) is Y (7:
0), but it is X (7: 0).
The same effect can be obtained when is smaller than Y (7: 0). In the present embodiment, the preceding one prediction device has a configuration independent of the mantissa value addition / subtraction circuit, but if the borrow propagation device is shared with the mantissa value addition / subtraction circuit, the borrow propagation device portion can be omitted. . Not limited to the 8-bit configuration, any number of bits may be used in general.

【0056】また、被減数と減数のうち必ずどちらか一
方が他方よりも大きいとわかっているようなシステムに
本発明を使用する場合は、減算結果が必ず正か負のどち
らか一方になるので、符号付き桁落ち量予測装置を単な
る桁落ち量予測装置に置き換えることができ、どちらの
オペランドから発生したボロウであるかという情報を生
成する装置は、被減数と減数のうち小さい方のオペラン
ドから発生したボロウのみを伝搬する装置に置き換える
ことができる。
Further, when the present invention is used in a system in which it is known that one of the dividend and the subtraction is always greater than the other, the subtraction result is always either positive or negative. The signed digit loss predictor can be replaced with a simple digit loss predictor, and the device that generates information about which operand generated a borrow is generated from the smaller operand of the minuend and the subtraction. It can be replaced with a device that propagates only borrow.

【0057】さらに、この実施例では仮数値減算によっ
て発生する最上位ビットから連続するゼロの数を求める
過程において冗長2進数表現を用いて処理したが、冗長
2進数表現を導入せずに2進数のみを用いて処理する構
成にすることもできる。
Further, in this embodiment, the redundant binary number expression is used in the process of obtaining the number of consecutive zeros from the most significant bit generated by the mantissa value subtraction, but the binary number is not introduced. It is also possible to adopt a configuration in which only the processing is performed.

【0058】次に、上記先行1予測回路を用いた浮動小
数点加減算装置の仮数演算部のブロック図を図7に示
す。従来例2と同じように、仮数部、指数部、符号部か
らなる2つの浮動小数点データX,Yに於て減算を実行
する場合、桁合わせ処理、仮数部加減算処理、正規化処
理の順で実行される。
Next, FIG. 7 shows a block diagram of the mantissa operation part of the floating point addition / subtraction device using the preceding one prediction circuit. Similar to the conventional example 2, when subtraction is performed on two floating point data X and Y consisting of a mantissa part, an exponent part, and a sign part, digit alignment processing, mantissa part addition / subtraction processing, and normalization processing are performed in this order. To be executed.

【0059】以下、図7に示す本発明である先行1予測
回路を使用した浮動小数点加減算装置を例にして説明す
る。桁合わせ処理と仮数部加減算処理とは従来例2と同
じ動作が行なわれる。この第1と第2の部分の説明は、
従来の技術の部分で説明済みである。ここまでの処理は
従来例2と同様であるが、正規化処理は、仮数値に関し
ては左バレルシフト回路309で、本発明である先行1
予測装置321の出力に基づいて予測された桁落ち量Z
aeを使用し、加減算回路307の出力を左シフトし出力
することにより完了する。指数値に関しては予測された
桁落ち量Zaeを減算回路310に入力し、減算回路31
0でZe ’−Zae=Ze を実行し、Zeを出力すること
により完了する。
The floating point adder / subtractor using the preceding 1 predictor circuit of the present invention shown in FIG. 7 will be described below as an example. The digit alignment process and the mantissa part addition / subtraction process are the same as those in the conventional example 2. The explanation of the first and second parts is
It has been described in the section of the conventional technique. The processing up to this point is the same as in the second conventional example, but the normalization processing is performed by the left barrel shift circuit 309 with respect to the mantissa value, which is the first embodiment of the present invention.
Digit cancellation amount Z predicted based on the output of the prediction device 321
This is completed by using ae and shifting the output of the adder / subtractor circuit 307 to the left to output it. With respect to the exponent value, the predicted digit cancellation amount Zae is input to the subtraction circuit 310, and the subtraction circuit 31
At 0, Ze'-Zae = Ze is executed, and Ze is output to complete the process.

【0060】[0060]

【発明の効果】本発明によれば、上記した構成によっ
て、加算正規化する際に必要なビットシフト量の正確な
値が求まるので、加算結果を正規化する過程において、
従来の先行1予測装置の出力するビットシフト量で桁合
わせをし、最上位ビットをみて、前記最上位ビットが0
の場合はさらに1ビット多くシフトさせるという過程を
削減することができる。
According to the present invention, since the accurate value of the bit shift amount required for the addition normalization is obtained by the above configuration, in the process of normalizing the addition result,
Digit adjustment is performed by the bit shift amount output by the conventional preceding 1 predictor, and the most significant bit is checked to find that the most significant bit is 0.
In the case of, the process of shifting by one bit more can be eliminated.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の実施例における仮数値加算系回路の構
成図である。
FIG. 1 is a configuration diagram of a mantissa value addition system circuit according to an embodiment of the present invention.

【図2】同実施例における先行1予測装置のブロック図
である。
FIG. 2 is a block diagram of a preceding one prediction device in the embodiment.

【図3】同実施例における桁落ち量予測装置の詳細図で
ある。
FIG. 3 is a detailed diagram of a precision cancellation amount prediction apparatus in the embodiment.

【図4】同実施例におけるボロウ伝搬装置の詳細図であ
る。
FIG. 4 is a detailed view of a borrow propagation device according to the embodiment.

【図5】同実施例におけるセレクタの詳細図である。FIG. 5 is a detailed diagram of a selector in the embodiment.

【図6】同実施例におけるデマルチプレクサの詳細図で
ある。
FIG. 6 is a detailed diagram of a demultiplexer according to the embodiment.

【図7】本発明の実施例における浮動小数点加減算装置
のブロック図である。
FIG. 7 is a block diagram of a floating point addition / subtraction device according to an embodiment of the present invention.

【図8】従来例1の桁落ち量予測の簡単なアルゴリズム
の図である。
FIG. 8 is a diagram of a simple algorithm for predicting a precision loss according to Conventional Example 1.

【図9】従来例2の先行1検出回路のブロック図であ
る。
9 is a block diagram of a leading 1 detection circuit of Conventional Example 2. FIG.

【図10】従来例2の浮動小数点加減算装置のブロック
図である。
FIG. 10 is a block diagram of a floating point addition / subtraction device of Conventional Example 2.

【符号の説明】[Explanation of symbols]

12 先行1予測装置 21 桁落ち量予測装置 22 ボロウ伝搬装置 23 セレクタ 12 Leading 1 Predictor 21 Digit Loss Predictor 22 Borrow Propagator 23 Selector

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 浮動小数点演算の加減算命令において仮
数値の減算結果に桁落ちが発生する場合、前記桁落ち量
を1ビットの誤差範囲内で桁落ち予測量を生成する第1
の手段と、 仮数値減算時に発生する下位ビット側からのボロウの伝
搬の情報を生成する第2の手段と、 前記ボロウの伝搬情報を用いて前記桁落ち予測量を操作
する第3の手段とを備え、 前記ボロウの有無に従い、前記第1の手段によって得ら
れた桁落ち予測量から、前記第3の手段が前記桁落ちの
発生した仮数値を正規化するためのビットシフト量を出
力することを特徴とする先行1予測装置。
1. A first digit for generating a predicted digit loss within the error range of 1 bit when the digit loss occurs in the subtraction result of the mantissa value in the addition / subtraction instruction of the floating point operation.
Means, second means for generating information on the propagation of borrow from the lower bit side that occurs at the time of subtraction of the mantissa value, and third means for operating the precision cancellation amount using the borrow propagation information. According to the presence / absence of the borrow, the third means outputs a bit shift amount for normalizing the mantissa value in which the digit cancellation has occurred, from the digit cancellation prediction amount obtained by the first means. The preceding 1 prediction device characterized by the above.
【請求項2】 浮動小数点演算の加減算命令において仮
数値の減算結果に桁落ちが発生する場合、前記桁落ち量
を1ビットの誤差範囲内で桁落ち予測量を生成しかつ、
加減算命令の結果が正負どちらになるかを出力する第1
の手段と、 仮数値減算時に発生する下位ビット側からのボロウの伝
搬の情報を、前記オペランドの仮数値の減算の際に発生
する、被減数−減数の際に発生するボロウと、減数−被
減数の際に発生するボロウの2種類に区別して生成する
第2の手段と、 前記ボロウの伝搬情報を用いて前記桁落ち予測量を操作
する第3の手段とを備え、 減算結果が正の数になる場合には前記被減数−減数の際
に発生するボロウの有無に従い、減算結果が負の数にな
る場合には前記減数−被減数の際に発生するボロウの有
無に従って、前記第1の手段によって得られた桁落ち予
測量から、前記第3の手段が前記桁落ちの発生した仮数
値を正規化するためのビットシフト量を出力することを
特徴とする先行1予測装置。
2. When a digit loss occurs in the subtraction result of the mantissa value in the addition / subtraction instruction of the floating point arithmetic, the digit loss amount is generated within the error range of 1 bit, and the digit loss predicted amount is generated, and
Outputs whether the result of the add / subtract instruction is positive or negative
And the information of the borrow propagation from the lower bit side that occurs during the mantissa value subtraction, and the borrow that occurs when the mantissa value of the operand is subtracted The subtraction result is a positive number, which is provided with a second means for separately generating two types of borrows that occur at this time and a third means for manipulating the predictive loss amount using the propagation information of the borrow. If the subtraction result is negative, the subtraction result is negative.If the subtraction result is negative, the subtraction result is negative depending on whether there is a borrow or not. The preceding one prediction device, wherein the third means outputs a bit shift amount for normalizing the mantissa value in which the digit cancellation has occurred, from the obtained digit cancellation prediction amount.
【請求項3】 請求項2記載の先行1予測装置におい
て、 i桁の2進数より構成される被減数Xとj桁の2進数よ
り構成される減数Y(i,jは自然数)を、各桁毎に減
算し、各桁が(1、0、−1)より構成される冗長2進
数Zsdを生成する第1の手段と、 前記冗長2進数値Zsdの下位よりk桁目(kは最下位ビ
ットがk=0となる整数)の冗長2進数値Zsdk と下位
よりk+1桁目の冗長2進数値Zsdk+1 を用い、Zsdk+
1 =“1”または“−1”であるときにCk =Zsdk と
なり、Zsdk+1=“0”であるときにCK =0となるよ
うに、式Zsdk =2Ck +Sk に従い、中間桁上げCk
、中間和Sk を生成する第2の手段と、 下位桁からの中間桁上げCk-1 と中間和Sk の各桁毎の
加算結果が0の時に“0”、1の時に“1”、−1の時
に“−1”という冗長2進数ZZk を生成する第3の手
段とを備えた先行1予測装置。
3. The leading one predictor according to claim 2, wherein each of the digits is a minuend X composed of an i-digit binary number and a subtraction Y composed of a j-digit binary number (i and j are natural numbers). And a first means for generating a redundant binary number Zsd each of which is composed of (1, 0, -1) for each digit, and kth digit (k is the least significant digit) from the lower digit of the redundant binary digit Zsd. Zsdk + is used by using the redundant binary value Zsdk of which the bit is k = 0) and the redundant binary value Zsdk + 1 of the k + 1th digit from the lower order.
Intermediate carry Ck according to the formula Zsdk = 2Ck + Sk so that Ck = Zsdk when 1 = “1” or “−1” and CK = 0 when Zsdk + 1 = “0”.
, Second means for generating the intermediate sum Sk, and "0" when the addition result for each digit of the intermediate carry Ck-1 from the lower digit and the intermediate sum Sk is 0, and "1" when the addition result is-, And a third means for generating a redundant binary number ZZk of "-1" when it is "1".
【請求項4】 仮数部オペランド、指数部オペランド、
符号部オペランドを有する浮動小数点形式の2つの被演
算データを加算または減算する浮動小数点加減算装置で
あって、 桁合わせ処理された後の2つの仮数値オペランドがそれ
ぞれ入力される加減算回路及び請求項1記載の先行1予
測装置と、 前記加減算回路の出力が入力されるバレルシフタと、 前記先行1予測装置から出力される数値が入力されて最
上位から連続するゼロの数を求めるプライオリティエン
コーダとを備え、 前記プライオリティエンコーダの出力を用いて、前記バ
レルシフタに入力された前記加減算回路の出力をシフト
して出力することを特徴とする浮動小数点加減算装置。
4. A mantissa part operand, an exponent part operand,
A floating-point addition / subtraction device that adds or subtracts two operand data in a floating-point format having a sign part operand, and an addition / subtraction circuit to which two mantissa operands after digit alignment processing are input, respectively. The preceding 1 prediction device described, a barrel shifter to which the output of the adder / subtractor circuit is input, and a priority encoder that receives the numerical value output from the preceding 1 prediction device and determines the number of consecutive zeros from the highest order, A floating point addition / subtraction device, wherein the output of the addition / subtraction circuit input to the barrel shifter is shifted and output using the output of the priority encoder.
【請求項5】 仮数部オペランド、指数部オペランド、
符号部オペランドを有する浮動小数点形式の2つの被演
算データを加算または減算する浮動小数点加減算装置で
あって、 桁合わせ処理された後の2つの仮数値オペランドがそれ
ぞれ入力される加減算回路及び請求項2記載の先行1予
測装置と、 前記加減算回路の出力が入力されるバレルシフタと、 前記先行1予測装置から出力される数値が入力されて最
上位から連続するゼロの数を求めるプライオリティエン
コーダとを備え、 前記プライオリティエンコーダの出力を用いて、前記バ
レルシフタに入力された前記加減算回路の出力をシフト
して出力することを特徴とする浮動小数点加減算装置。
5. A mantissa part operand, an exponent part operand,
A floating-point addition / subtraction device for adding or subtracting two operand data in a floating-point format having a sign part operand, wherein the addition / subtraction circuit receives two mantissa value operands after digit alignment processing. The preceding 1 prediction device described, a barrel shifter to which the output of the adder / subtractor circuit is input, and a priority encoder that receives the numerical value output from the preceding 1 prediction device and determines the number of consecutive zeros from the highest order, A floating point addition / subtraction device, wherein the output of the addition / subtraction circuit input to the barrel shifter is shifted and output using the output of the priority encoder.
JP5158234A 1992-07-06 1993-06-29 Leading one prediction device and floating point addition / subtraction device Expired - Fee Related JP2752564B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5158234A JP2752564B2 (en) 1992-07-06 1993-06-29 Leading one prediction device and floating point addition / subtraction device

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP17800092 1992-07-06
JP4-178000 1992-07-06
JP5158234A JP2752564B2 (en) 1992-07-06 1993-06-29 Leading one prediction device and floating point addition / subtraction device

Publications (2)

Publication Number Publication Date
JPH0675752A true JPH0675752A (en) 1994-03-18
JP2752564B2 JP2752564B2 (en) 1998-05-18

Family

ID=26485429

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5158234A Expired - Fee Related JP2752564B2 (en) 1992-07-06 1993-06-29 Leading one prediction device and floating point addition / subtraction device

Country Status (1)

Country Link
JP (1) JP2752564B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5831884A (en) * 1994-12-02 1998-11-03 Mitsubishi Denki Kabushiki Kaisha Apparatus for performing arithmetic operation of floating point numbers capable of improving speed of operation by performing canceling prediction operation in parallel
US10579333B2 (en) 2017-05-22 2020-03-03 Fujitsu Limited Arithmetic unit and control method for arithmetic unit

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5831884A (en) * 1994-12-02 1998-11-03 Mitsubishi Denki Kabushiki Kaisha Apparatus for performing arithmetic operation of floating point numbers capable of improving speed of operation by performing canceling prediction operation in parallel
US10579333B2 (en) 2017-05-22 2020-03-03 Fujitsu Limited Arithmetic unit and control method for arithmetic unit

Also Published As

Publication number Publication date
JP2752564B2 (en) 1998-05-18

Similar Documents

Publication Publication Date Title
EP0820005B1 (en) Method and apparatus for computing floating point data
US8601047B2 (en) Decimal floating-point adder with leading zero anticipation
JP4388543B2 (en) 3-input floating-point adder / subtracter
JP3609512B2 (en) Computing unit
US5343413A (en) Leading one anticipator and floating point addition/subtraction apparatus
KR100241076B1 (en) Floating- point multiply-and-accumulate unit with classes for alignment and normalization
KR100948559B1 (en) Arithmetic unit performing division or square root operation of floating point number and operating method
KR100203468B1 (en) Arithmetic apparatus for floating point numbers
US7668892B2 (en) Data processing apparatus and method for normalizing a data value
US6947962B2 (en) Overflow prediction algorithm and logic for high speed arithmetic units
US5408426A (en) Arithmetic unit capable of performing concurrent operations for high speed operation
US5282156A (en) Leading one anticipator and floating point addition/subtraction apparatus employing same
JP3544846B2 (en) Logic circuit and floating point arithmetic unit
US6499044B1 (en) Leading zero/one anticipator for floating point
US5831884A (en) Apparatus for performing arithmetic operation of floating point numbers capable of improving speed of operation by performing canceling prediction operation in parallel
KR100331846B1 (en) floating addition
JP2752564B2 (en) Leading one prediction device and floating point addition / subtraction device
JP2558669B2 (en) Floating point arithmetic unit
EP1282034A2 (en) Elimination of rounding step in the short path of a floating point adder
JPH0553765A (en) Preceding one detecting circuit and floating point adder-subtractor
US20140059104A1 (en) Arithmetic circuit for calculating correction value
JP3512700B2 (en) Floating point arithmetic unit
JP6871513B2 (en) Arithmetic unit and control method of arithmetic unit
JPH1040078A (en) Preceding 0, 1 numeral predicting circuit and floating point arithmetic device and microprocessor and information processor
JPH05265714A (en) Multiplier

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19980210

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080227

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090227

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090227

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100227

Year of fee payment: 12

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100227

Year of fee payment: 12

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110227

Year of fee payment: 13

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120227

Year of fee payment: 14

LAPS Cancellation because of no payment of annual fees