JP2752564B2 - Leading one prediction device and floating point addition / subtraction device - Google Patents

Leading one prediction device and floating point addition / subtraction device

Info

Publication number
JP2752564B2
JP2752564B2 JP5158234A JP15823493A JP2752564B2 JP 2752564 B2 JP2752564 B2 JP 2752564B2 JP 5158234 A JP5158234 A JP 5158234A JP 15823493 A JP15823493 A JP 15823493A JP 2752564 B2 JP2752564 B2 JP 2752564B2
Authority
JP
Japan
Prior art keywords
subtraction
bit
value
mantissa
digit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP5158234A
Other languages
Japanese (ja)
Other versions
JPH0675752A (en
Inventor
源一郎 井上
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

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

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

【0002】[0002]

【従来の技術】浮動小数点演算の加減算は、2つのオペ
ランドの符号と加減算の処理の組み合わせによって、仮
数値を減算する場合が発生する。この仮数値の減算によ
って、2つのオペランドの指数値の差の絶対値が1以下
である場合には、仮数値の桁落ちが2桁以上発生する場
合がある。前記桁落ちが発生した場合は、仮数値減算結
果を正規化するために桁落ち量を算出する過程と、前記
桁落ち量をもとに減算結果を正規化する過程が必要とな
る。ところが、前記仮数値減算結果の出力を待ってから
桁落ち量を算出し正規化していると加算正規化の実行時
間が長くなる。よって加算演算と独立した手段によっ
て、仮数値の減算の実行に先んじてまたは並列に、正規
化する際の桁落ち量を予測すれば、加算正規化の実行時
間が削減されることが知られていた。
2. Description of the Related Art In addition / subtraction of a floating-point operation, a significand value is sometimes subtracted by a combination of the sign of two operands and the addition / subtraction processing. If 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, two or more digits may be lost in the mantissa value. When the digit loss occurs, a process of calculating the digit loss amount to normalize the result of the mantissa value subtraction and a process of normalizing the subtraction result based on the digit loss amount are required. However, if the digit loss amount is calculated and normalized after waiting for the output of the mantissa value subtraction result, the execution time of addition normalization becomes longer. Therefore, it is known that the execution time of the addition normalization can be reduced by predicting the amount of cancellation at the time of normalization prior to or in parallel with the execution of the subtraction of the mantissa value by means independent of the addition operation. 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 Japanese Patent Application Laid-Open No. 2-144624. Hereinafter, this conventional example (conventional example 1) will be described with reference to the drawings. FIG. 8 is a diagram illustrating an algorithm for predicting the amount of cancellation in conventional example 1 using a state transition diagram. XOR (P, Propagate = propagation), AND (G, Generate = generate), NOR (Z, Zero =) resulting from a bit comparison of corresponding bit positions of two operands in two's complement representation
Zero) The amount of cancellation is predicted by looking at the combination of networks that process the state signal from the most significant bit side. First, the state of the most significant bit (GMS
B, ZMSB, PMSB), and if the status is G or Z
If so, a signal representing the number of shifts is generated. This number is a count of each successive state signal determined, 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 generation of the shift signal is false if the third state is false. 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, by means different from the addition / subtraction circuit, the number of consecutive 0 or 1 bits counted from the most significant bit generated by addition / subtraction of the mantissa value, that is, if the result of addition / subtraction of the mantissa value becomes positive, When the result of subtraction of the number of zeros and the mantissa value becomes negative, the number of consecutive ones in the two's complement representation can be obtained.

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

【0007】図9は従来例2の先行1検出回路のブロッ
ク図である。同図中の804は、先行1検出回路の1桁
要素を表わす。
FIG. 9 is a block diagram of a leading one detection circuit of the second conventional example. Reference numeral 804 in the figure denotes a one-digit element of the leading one 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 subtrahend Y are input to a redundant binary value generation circuit 901 for each bit, and a redundant binary value Zsd is generated. Explaining by focusing on the k-th bit, this redundant 2
The binary circuit executes the minuend Xk-subtraction Yk, and outputs the redundant binary value Zsdk = 1, 0, -1. Next, Zsdk is input to the intermediate sum intermediate carry generation circuit 902, and the intermediate sum S
k, generate an intermediate carry Ck.

【0009】[0009]

【表1】 [Table 1]

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

【0011】[0011]

【表2】 [Table 2]

【0012】この時、Zの最上位ビットから数えて初め
て1が現われるまでの0の数は、正規化の際のビットシ
フト量か、それよりも1ビット少ない値を示しているの
で、このZをプライオリティエンコーダに入力すれば、
正規化の際のビットシフト量か1ビット少ない数を求め
ることができた。さらにはこの機構によって、加減算回
路と独立に、仮数値の減算結果の正負に関わらず、正規
化の際のビットシフト量か1ビット少ない数を求めるこ
とができる。
At this time, the number of 0s until the 1 appears for the first time from the most significant bit of Z indicates the bit shift amount during normalization or a value smaller by 1 bit than this. Is input to the priority encoder,
The bit shift amount at the time of normalization or a number smaller by one bit could be obtained. Further, by this mechanism, independently of the addition / subtraction circuit, it is possible to obtain the bit shift amount at the time of normalization or a number smaller by one bit regardless of the sign of the result of the subtraction 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 operation unit of a floating point addition / subtraction apparatus using a leading one detection circuit according to Conventional Example 2.
0 is shown. 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. Hereinafter, a floating point addition / subtraction apparatus using the leading one detection circuit of the second conventional example shown in FIG. 10 will be described 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 processing is executed as follows. Exponent part of two input operands (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 mantissa (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 values Xe,
Ye is subtracted, and the absolute value (Xe−Ye) and the sign value (Xe−
Ye). At the same time, the shift signal generation circuit 304 detects whether or not each input operand is a normalized number and determines the sign value (Xs, Ys) of the operand.
) And a subtraction execution signal SUB to create a control signal for shifting the two input operand mantissa values left and right. The left / right shift circuit 301 shifts two input operand mantissa values 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
05 based on the code value (Xe-Ye) output from
The input data is swapped, the mantissa value of the operand having a small exponent value is input to the right barrel shift circuit 303, and the other operand mantissa value having a small exponent value is input to the addition / subtraction 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 matching process is executed.

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

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

【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 addition / subtraction circuit 307 to the left using the predicted cancellation amount Zae output from the priority encoder 308 and outputs the result. 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 the value is normalized. If L1 is "0", it means that the predicted cancellation amount Zae was smaller by one, so that it is necessary to shift left by one digit. This is performed 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 digit loss Zae
Is also input to the subtraction circuit 310, where the two subtractions Ze'-Zae and Ze'-Zae-1 are simultaneously performed 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 the value of the signal line L1 is "1", the subtraction result of Ze'-Zae-1 is output, and the normalization process is realized.

【0019】[0019]

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

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

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

【0022】[0022]

【課題を解決するための手段】上記問題点を解決するた
めに本発明の先行1予測装置は、1ビットの誤差範囲で
前記桁落ち予測量を生成する手段と、下位ビット側から
のボロウの伝搬の情報を生成する手段とを備え、前記ボ
ロウの有無により、前記桁落ち予測量から正規化する際
に必要な正確なビットシフト量をセレクタで出力する構
成を備えたものである。
In order to solve the above-mentioned problems, a leading one prediction apparatus according to the present invention comprises: means for generating the cancellation loss prediction amount within a one-bit error range; Means for generating propagation information, wherein a selector outputs an accurate bit shift amount necessary for normalization from the cancellation loss prediction 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 mantissa value of the floating point operation, the two mantissa operands after the digit alignment processing are simultaneously input to the addition / subtraction circuit and the preceding one prediction device. The addition / subtraction circuit performs a subtraction, inputs the subtraction result to a barrel shifter, and shifts the subtraction result input to the barrel shifter using the bit shift amount output from the preceding one prediction device. Things.

【0024】[0024]

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

【0025】[0025]

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

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

【0027】例えば入力ビット数が被減数、減数共に8
ビットの場合について考える。被減数X(7:0)−減
数Y(7:0)を実行して、X>Yの場合で、最下位ビ
ットを0ビットとして第3ビットに初めてスキャン値Zk
=1が現われる状況を考えると、 Z=00001ααα :α=0または1 となる。
For example, if the number of input bits is 8 for both the minuend and the subtrahend,
Consider the case of bits. The subtrahend X (7: 0) -subtract Y (7: 0) is executed, and if X> Y, the scan value Zk is first set to the third bit with the least significant bit as 0 bit.
Considering the situation where = 1 appears, Z = 000000αα: α = 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) =
Assuming that the difference S is (7: 0), and the maximum value of the difference S is maxS1 and the minimum value is minS1, maxS1 = 00001111 minS1 = 000000101. Furthermore, the maximum value when indicating a correct bit shift amount is maxS2, the minimum value is minS2, and the maximum value when indicating a bit shift amount smaller by one bit is maxS3, and the minimum value is minS3.
Then, maxS2 = 00000011 minS2 = 0000001000 maxS3 = 000000111 minS3 = 000000101.

【0029】1ビット少ないビットシフト量を示す場合
は初めてZk =1となったビット(最下位ビットをk=
0とし、この例の場合はk=3)の1つ下位のビット
(この例の場合はk=2)以下のビットによる減算X
(2:0)−Y(2:0)が負になった場合に対応して
いることがわかる。
When a bit shift amount smaller by one bit is indicated, the bit for which Zk = 1 for the first time (the least significant bit is k =
0, and in this example, subtraction X by bits less than the next lower bit (k = 2) of k = 3)
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, with respect to a general arbitrary number of input bits, in the second conventional example, the subtraction result of the first bit lower than the bit of Zk = 1 for the first time is 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 0 indicates a bit shift amount smaller by one bit.

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

【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 that first appears from the most significant bit of the second conventional example, regardless of whether the subtraction result is positive or negative. In this case, an accurate bit shift amount can be output.

【0034】上記した4つの情報をどのようにして得て
いるかというと、まず1)X>Yと、2)Y>Xとを区
別するために、従来例2で作成する2進数値であるスキ
ャン値Zk を作成する代わりに、冗長2進数値ZZk を
表3に従って作成する。
The manner in which the above four pieces of information are obtained is as follows. First, in order to distinguish 1) X> Y and 2) Y> X, a binary value created in Conventional Example 2 is used. Instead of creating a scan value Zk, a 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
1) When kY0 is ZZk = 1, 1) X> Y, ZZk = −1
2) Y> X. Note that ZZk =
0 corresponds to Zk = 0 in Conventional Example 2, and ZZKK0 is Zk
= 1.

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

【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 ≧
When k) is executed, X (k-1: 0) -Y (k-1: 0)
In order to be <0, the digit of X (k) is borrowed (borrow B
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
: 0) <0, so that a borrow (borrow By (k)) occurs in the digit of Y (k). Therefore, in this embodiment, a borrow propagation device is introduced, and Bx (k) and Bx (k)
By creating y (k), X (k-1: 0) and Y
(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) and 2) Y> X and 3) the most significant bit in the case of X (k-1: 0)> Y (k-1: 0) And a selector for increasing the number of consecutive ZZk = 0 by one up to ZZk ≠ 0, which appears for the first time after counting from the above, and according to these operations, the embodiment of the present invention can operate regardless of whether the subtraction result is positive or negative. The bit shift amount at the time of accurate normalization is obtained. In this way, if the output is input to the priority encoder, a bit shift number for normalizing the subtraction result can be obtained.

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

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

【0042】図1は、本発明である先行1予測装置を用
いた仮数値の加算系回路の構成図である。図1におい
て、11は仮数値を加減算し、絶対値を出力をする加減
算回路、12は桁落ち量を予測するための本発明の構成
を有する先行1予測装置、13は正規化するために仮数
値をシフトさせるバレルシフタ、14はプライオリティ
エンコーダである。
FIG. 1 is a configuration diagram of a mantissa value addition circuit using the leading one prediction apparatus according to the present invention. In FIG. 1, reference numeral 11 denotes an addition / subtraction circuit that adds / subtracts a mantissa value and outputs an absolute value, 12 denotes a leading one prediction device having the configuration of the present invention for predicting the amount of cancellation, and 13 denotes a provisional one for normalization. A barrel shifter 14 for shifting a numerical value 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 prediction device 12 according to the present invention when the input operand is 8 bits. In FIG. 2, reference numeral 21 denotes an undercut amount prediction device for predicting the undercut amount within a 1-bit error range independently of the addition / subtraction circuit. The scan value ZZk = redundant binary number described above by this apparatus =
The value of 1, 0, -1 is output. Reference numeral 22 denotes a borrow propagation device that outputs borrow propagation from lower bits independently of the addition / subtraction circuit. This apparatus outputs the above-mentioned borrows Bx (k) and By (k) for an arbitrary k. Numeral 23 denotes an output from the borrow propagation device 22, and the cancellation loss prediction device 2
1 is a selector for operating the bit shift amount necessary 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 undercut amount prediction device 21 written at the gate level. In FIG. 3, 31 and 32 are 8-bit input operands, PLUS33 and MINUS3.
4 is the scan value ZZk, PLUS = 1 and MINUS = 0 when ZZk = 1, PLUS = 0 and MINUS = when ZZk = 0.
0, ZZk = -1 is a signal line for outputting with PLUS = 0 and MINUS = 1. At this time, PLUS = 1 and MINUS
= 1 does not exist. Here, the number of consecutive 0 bits before 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 = PLUS = "0" or MINUS until the one that appears earlier, whichever comes first, appears
The number of “0” corresponds to the amount of cancellation in the case where the borrow from the lower bits is not taken into account. Here, when the number other than ZZk = 0, which appears for the first time, is ZZk = 1, the result of the subtraction of the mantissa value is positive, and when ZZK = -1, the result is negative.

【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.
x 35 is (NOT operand X) AND (operand Y), ie, (Xk, Yk) = (0, 1), and Gy 36 is (operand X) AND (NOT operand Y), ie, (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 n-th bit has generated a borrow.
(N) 36 is a signal that the n-th bit of the operand Y has generated a borrow, and P (n) 37 is a signal that propagates the borrow from the lower bits. Gx (n) 35 and Gy
The reason why the sixth bit is not required in (n) 36 is that the sixth bit has already been considered in the redundant binary subtraction of the seventh 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, reference numeral 41 denotes an external clock input (clock 1) for precharging and discharging the precharge line and outputting the value of the precharge line, and reference numeral 42 denotes a clock for outputting the value of the precharge line. Input (clock 2)
It has a phase inverted from the phase of clock 1. 131
To 144 are precharge lines which are precharged when clock 1 is "0" and discharged when clock 1 is "1" and the path to ground is open. Bx 39 is a signal indicating that the borrow from the operand X has propagated to the n-th bit.
0 is a signal that the borrow from the operand Y has propagated to the n-th bit. The reason why neither the 0th bit nor the 1st bit is required in Bx 39 and By 40 is that
This is because there is no borrow that propagates to the 0th bit, and the borrow that propagates to the 1st bit has already been considered when ZZk is created.

【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, the borrow propagation is as follows: 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)

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

【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 denotes a demultiplexer, which is information on the outputs Bx 39 and By 40 from the borrow propagation device 22, that is, Y, from the outputs PLUS 33 and MINUS 34 of the cancellation amount prediction device 21, that is, ZZk = 1, 0, -1. (K-1
: 0)> X (k-1: 0), X (k-1: 0)> Y (k-1:
0), the bit shift amount at the time of normalization is selected.

【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 output as LZA (k) as it is to the output PLUS (k) 33, and if it is "1", PLUS (k). Is corrected to one 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 it is as LZA (k). If "1", MINUS (k) is output.
The position of (k) is modified to the lower bit by 1 bit, and LZA (k-
1) Output as This is when there is a borrow from the lower bit in the output from the cancellation 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 the case of (k-1: 0), the correction is made so that the amount of cancellation is increased by one 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 when normalizing.

【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. For example, as an input after mantissa digit alignment, an 8-bit operand X (7: 0) = 111010100, Y
(7: 0) = 1110101101 is X (7: 0) -Y
Consider the case where the input is (7: 0). First, the operand X (7: 0) = 111010 is sent to the undercut amount prediction device 21.
100, Y (7: 0) = 110010110 is input. In the actual binary subtraction, the difference S is S (7: 0) = 0000.
0111. The undercut amount prediction device 21 generates a scan value ZZk which is a redundant binary number, and as a result,
PLUS (7: 0) 33 = 00001000, MINUS (7:
0) 34 = 00000001, that is, ZZk = 000
0100T (T = -1) is output. At this stage, since ZZk ≠ 0, which appears for the first time counting from the highest order, is ZZk = 1, it is understood 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 indicating a bit where a borrow may occur from the operand X, and a bit where a borrow may occur from the operand Y Gy
(5: 0) 36 = 01010000, 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, the precharge lines 131 to 144 are precharged by the borrow propagation device 22 when the clock 1 is "0", and when the clock 1 is "1", the Gx
(5: 0) 35 = 001001, Gy (5: 0) 36 =
010000, P (6: 1) 37 = 110011 is input. Then, the precharge lines 131, 132, 1
A path from 33, 134, 142, 143, 144 to ground is made and discharged. At this stage, when the clock 2 is set to “0”, Bx (7: 2) 39 = 0000111 and By (7:
2) 40 = 111000 is output. That is, ZZk ≠ 0 for the first time in ZZ (4) counting from the most significant bit, and since ZZk = 1, X> Y. Looking at the borrow Bx (4) at this time, Bx (4) = 1, and
In this case, for the first time counting from the most significant bit, ZZk ≠ 0
This is a case where it is necessary to increase the number of consecutive 0s by one bit until the point where.

【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, PLUS (7: 0) 33 is supplied to the selector 23.
= 00001000, MINUS (7: 0) 34 = 0000
0001 (ie, ZZ (7: 0) = (0000100
T) (T = -1)), Bx (7: 2) 39 = 00001
1, By (7: 2) 40 = 111000,
LZA (7: 0) 38 = 000000101 is output.
In LZA (7: 0) = 000000101, the number of bit shifts at the time of normalization is 5 bits because 5 bits of 0 continue from the most significant bit to the bit where 1 appears for the first time. Therefore, if this result is input to the priority encoder 24, which is viewed from the most significant bit, a decoded bit shift signal "101" for 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 replaced by Y (7: 7).
0), but X (7: 0)
Is smaller than Y (7: 0), the same effect can be obtained. In this embodiment, the leading one prediction device has a configuration independent of the mantissa value addition / subtraction circuit. However, if the borrow propagation device is shared with the mantissa value addition / subtraction circuit, the portion of the borrow propagation device can be omitted. . The configuration is not limited to the 8-bit configuration, but may be a general configuration of any number of bits.

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

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

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

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

【0060】[0060]

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

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

【図1】本発明の実施例における仮数値加算系回路の構
成図である。
FIG. 1 is a configuration diagram of a mantissa value addition 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 the undercut amount prediction device in the embodiment.

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

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

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

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

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

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

【図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 One Predictor 21 Digit Loss Predictor 22 Borrow Propagator 23 Selector

Claims (5)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 浮動小数点演算の加減算命令において仮
数値の減算結果に桁落ちが発生する場合、前記桁落ち量
を1ビットの誤差範囲内で桁落ち予測量を生成する第1
の手段と、 仮数値減算時に発生する下位ビット側からのボロウの伝
搬の情報を生成する第2の手段と、 前記ボロウの伝搬情報を用いて前記桁落ち予測量を操作
する第3の手段とを備え、 前記ボロウの有無に従い、前記第1の手段によって得ら
れた桁落ち予測量から、前記第3の手段が前記桁落ちの
発生した仮数値を正規化するためのビットシフト量を出
力することを特徴とする先行1予測装置。
1. A method according to claim 1, wherein when the subtraction of the mantissa value in the addition / subtraction instruction of the floating-point operation causes a cancellation, the cancellation amount is calculated within a 1-bit error range.
Means for generating information on propagation of a borrow from the lower bit side generated at the time of mantissa value subtraction, and third means for operating the predicted canceling amount using the propagation information of the borrow. The third means outputs a bit shift amount for normalizing the mantissa value in which the cancellation has occurred from the cancellation loss prediction amount obtained by the first means according to the presence or absence of the borrow. A preceding one prediction device, characterized in that:
【請求項2】 浮動小数点演算の加減算命令において仮
数値の減算結果に桁落ちが発生する場合、前記桁落ち量
を1ビットの誤差範囲内で桁落ち予測量を生成しかつ、
加減算命令の結果が正負どちらになるかを出力する第1
の手段と、 仮数値減算時に発生する下位ビット側からのボロウの伝
搬の情報を、前記オペランドの仮数値の減算の際に発生
する、被減数−減数の際に発生するボロウと、減数−被
減数の際に発生するボロウの2種類に区別して生成する
第2の手段と、 前記ボロウの伝搬情報を用いて前記桁落ち予測量を操作
する第3の手段とを備え、 減算結果が正の数になる場合には前記被減数−減数の際
に発生するボロウの有無に従い、減算結果が負の数にな
る場合には前記減数−被減数の際に発生するボロウの有
無に従って、前記第1の手段によって得られた桁落ち予
測量から、前記第3の手段が前記桁落ちの発生した仮数
値を正規化するためのビットシフト量を出力することを
特徴とする先行1予測装置。
2. A method according to claim 1, wherein when a subtraction result of the mantissa value in the addition / subtraction instruction of the floating-point operation causes a cancellation, a cancellation cancellation prediction amount is generated within a 1-bit error range;
First to output whether the result of addition / subtraction instruction is positive or negative
Means for transmitting the borrow from the lower bit side generated at the time of the subtraction of the mantissa value, and generating the borrow generated at the time of the subtrahend-subtraction generated at the time of the subtraction of the mantissa of the operand; A second means for generating two types of borrows generated at the same time, and a third means for operating the predicted cancellation amount using propagation information of the borrows, wherein the subtraction result is a positive number. If the subtraction results in the presence or absence of a borrow occurring at the time of the subtrahend-subtraction, and if the subtraction result is a negative number, the first means obtains the result according to the presence or absence of the borrow occurring at the time of the subtrahend-subtraction. The first predicting apparatus according to claim 1, wherein the third means outputs a bit shift amount for normalizing the mantissa value in which the cancellation has occurred from the obtained cancellation 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 prediction device according to claim 2, wherein a minuend X composed of an i-digit binary number and a decrement Y composed of a j-digit binary number (i and j are natural numbers) are each digit. First means for generating a redundant binary number Zsd in which each digit is composed of (1, 0, -1); and k-th digit (k is the least significant digit) from the lower order of the redundant binary value Zsd. Zsdk + using a redundant binary value Zsdk of (an integer where the bit is k = 0) and a redundant binary value Zsdk + 1 of the (k + 1) th digit from the lower order.
According to the equation Zsdk = 2Ck + Sk, the intermediate carry Ck is such that Ck = Zsdk when 1 = "1" or "-1", and CK = 0 when Zsdk + 1 = "0".
A second means for generating an intermediate sum Sk; "0" when the addition result of each digit of the intermediate carry Ck-1 from the lower digit and the intermediate sum Sk is "0"; A third means for generating a redundant binary number ZZk of "-1" at the time of 1.
【請求項4】 仮数部オペランド、指数部オペランド、
符号部オペランドを有する浮動小数点形式の2つの被演
算データを加算または減算する浮動小数点加減算装置で
あって、 桁合わせ処理された後の2つの仮数値オペランドがそれ
ぞれ入力される加減算回路及び請求項1記載の先行1予
測装置と、 前記加減算回路の出力が入力されるバレルシフタと、 前記先行1予測装置から出力される数値が入力されて最
上位から連続するゼロの数を求めるプライオリティエン
コーダとを備え、 前記プライオリティエンコーダの出力を用いて、前記バ
レルシフタに入力された前記加減算回路の出力をシフト
して出力することを特徴とする浮動小数点加減算装置。
4. A mantissa operand, an exponent operand,
2. A floating-point addition / subtraction device for adding or subtracting two operand data in a floating-point format having a sign operand, wherein an adder / subtractor circuit to which two mantissa operands after the digit-alignment processing are input is provided. And a barrel shifter to which an output of the adding / subtracting circuit is inputted, and a priority encoder to which a numerical value outputted from the preceding 1 predicting device is inputted to find the number of consecutive zeros from the top, 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 operand, an exponent operand,
3. A floating-point addition / subtraction apparatus for adding or subtracting two pieces of operand data in a floating-point format having a sign operand, wherein an add / subtract circuit to which two mantissa operands after digit alignment processing are input, respectively. And a barrel shifter to which an output of the adding / subtracting circuit is inputted, and a priority encoder to which a numerical value outputted from the preceding 1 predicting device is inputted to find the number of consecutive zeros from the top, 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 JPH0675752A (en) 1994-03-18
JP2752564B2 true 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)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3313002B2 (en) * 1994-12-02 2002-08-12 三菱電機株式会社 Floating point arithmetic unit
JP6871513B2 (en) 2017-05-22 2021-05-12 富士通株式会社 Arithmetic unit and control method of arithmetic unit

Also Published As

Publication number Publication date
JPH0675752A (en) 1994-03-18

Similar Documents

Publication Publication Date Title
JP2508912B2 (en) Floating point adder
KR100232962B1 (en) Fused floating point multiply and accumulate unit with carry correction
US5343413A (en) Leading one anticipator and floating point addition/subtraction apparatus
US20130282779A1 (en) Decimal floating-point adder with leading zero anticipation
JP4388543B2 (en) 3-input floating-point adder / subtracter
KR100241076B1 (en) Floating- point multiply-and-accumulate unit with classes for alignment and normalization
US20080288571A1 (en) Arithmetic device for performing division or square root operation of floating point number and arithmetic method therefor
US7668892B2 (en) Data processing apparatus and method for normalizing a data value
US5623435A (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
US6947962B2 (en) Overflow prediction algorithm and logic for high speed arithmetic units
JP3544846B2 (en) Logic circuit and floating point arithmetic unit
US7552165B2 (en) Method and system to implement an improved floating point adder with integrated adding and rounding
US5831884A (en) Apparatus for performing arithmetic operation of floating point numbers capable of improving speed of operation by performing canceling prediction operation in parallel
JPH0520028A (en) Mantissa part processing circuit of floating-point arithmetic unit for addition and subtraction
JP2752564B2 (en) Leading one prediction device and floating point addition / subtraction device
KR101007259B1 (en) Parity generation circuit, counter and counting method
JP2558669B2 (en) Floating point arithmetic unit
US7003540B2 (en) Floating point multiplier for delimited operands
JP2000311079A (en) Real number computing element
US20140059104A1 (en) Arithmetic circuit for calculating correction value
US20130238680A1 (en) Decimal absolute value adder
JP3512700B2 (en) Floating point arithmetic unit
JPH0553765A (en) Preceding one detecting circuit and floating point adder-subtractor
JP3257278B2 (en) Normalizer using redundant shift number prediction and shift error correction

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