JPS6280764A - Floating point arithmetic unit for sum of product - Google Patents

Floating point arithmetic unit for sum of product

Info

Publication number
JPS6280764A
JPS6280764A JP22030985A JP22030985A JPS6280764A JP S6280764 A JPS6280764 A JP S6280764A JP 22030985 A JP22030985 A JP 22030985A JP 22030985 A JP22030985 A JP 22030985A JP S6280764 A JPS6280764 A JP S6280764A
Authority
JP
Japan
Prior art keywords
output
precision
double
data
shifter
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
JP22030985A
Other languages
Japanese (ja)
Other versions
JPH0361224B2 (en
Inventor
Ichiro Kuroda
黒田 一朗
Kyosuke Sugishita
杉下 恭輔
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.)
NEC Corp
Original Assignee
NEC Corp
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 NEC Corp filed Critical NEC Corp
Priority to JP22030985A priority Critical patent/JPS6280764A/en
Publication of JPS6280764A publication Critical patent/JPS6280764A/en
Publication of JPH0361224B2 publication Critical patent/JPH0361224B2/ja
Granted legal-status Critical Current

Links

Landscapes

  • Complex Calculations (AREA)

Abstract

PURPOSE:To shorten a time required for the addition of floating point by normalizing only the finally accumulated result. CONSTITUTION:The exponential part data out of an output of an input register 71 to which accumulated output data are inputted from a double precision register 6 are applied to a subtractor 73 and the mantissa part data are applied to a maximum inverted code bit detecting circuit 72 and a shifter 74. The circuit 72 outputs a difference between the succeeding digit of a code bit and the digit of a maximum inverted code bit. The subtractor 73 subtracts the output of the circuit 72 from the exponential part data of the input register 71. The shifter 74 shifts the mantissa part data of the input register 71 left by regarding the output of the circuit 72 as a shifting variable. An output register outputs floating point data consisting of (e+2n-1) bits obtained by assigning an output consisting of (e) bits from the subtractor to the exponential part and an output consisting of (2n-1) bits from the shifter 74 on the basis of the outputs of the subtractor 73 and the shifter 74.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、高精度の積和演算を短時間に行うことのでき
る。浮動小数点積和演算器に関する。
DETAILED DESCRIPTION OF THE INVENTION [Industrial Application Field] The present invention can perform highly accurate product-sum calculations in a short time. Concerning floating point multiply-accumulate calculators.

〔従来の技術〕[Conventional technology]

積和演算、器が行う積和演算は、ここでは、当該演算器
に入力される2つのデータ列について、各データ列の対
応する項ごとに乗算を行い、その乗算の結果を順次加算
することにより、内債を求める演算である、と定義され
る。
Product-sum operation, the product-sum operation performed by a device here involves multiplying two data strings input to the arithmetic device for each corresponding term of each data string, and sequentially adding the results of the multiplication. It is defined as an operation to find the internal debt.

従来の積和演算器において、入力データとして単精度の
浮動小数点データを与えたとき、先ず通常の浮動小数点
乗算に従って乗算値を得、次いで加算が行なわれるが、
この場合、浮動小数点乗算の結果は、丸めによって単精
度の浮動小数点データとして得られる。
In a conventional multiply-accumulator, when single-precision floating-point data is given as input data, a multiplication value is first obtained by normal floating-point multiplication, and then addition is performed.
In this case, the result of the floating point multiplication is obtained as single precision floating point data by rounding.

上記の通常の浮動小数点乗算を具体的に述べる。The above ordinary floating-point multiplication will be specifically described.

例えば第6図(a)に示すように、数値データ61が、
指数部がeビット、仮数部がnビット(2の補数表示)
の浮動小数点データ形式で与えられたとする。このよう
なデータ同士の乗算を行うと、指数部同士の加算及び仮
数部同士の乗算が行われ、特に仮数部は2の補数表示に
よって2n−1ビットとなる。この2n−1ビットの乗
算結果は、正規化され、その上位nビットを取出すこと
によって、単精度のデータとして求められる。
For example, as shown in FIG. 6(a), the numerical data 61 is
Exponent part is e bits, mantissa part is n bits (2's complement representation)
Suppose that it is given in floating point data format. When such data are multiplied, the exponent parts are added together and the mantissa parts are multiplied, and in particular, the mantissa part becomes 2n-1 bits by two's complement representation. This 2n-1 bit multiplication result is normalized, and by extracting its upper n bits, it is obtained as single-precision data.

上記の結果、従来の積和演算器では、単精度の浮動小数
点データとして得られた乗算値を用いて引続き加算を行
うので、積和演算の精度が低くなる。
As a result of the above, in the conventional product-sum calculation unit, the accuracy of the product-sum calculation decreases because addition is performed continuously using the multiplication value obtained as single-precision floating-point data.

従って、上記積和演算を高精度で行うためには、最初の
乗算による2n−1ビットの仮数部の乗算結果を丸める
ことな(、累算する必要がある。これを実際に行うには
、第6図(5)に示すようなeビットの指数部及び2n
−1ビットの仮数部を有する倍精度浮動小数点デークロ
2の状態で積和演算を行うことができるようにする必要
がある。
Therefore, in order to perform the above product-sum operation with high precision, it is necessary to accumulate the 2n-1-bit mantissa multiplication result of the first multiplication without rounding it.To actually perform this, The exponent part of the e bit and 2n as shown in Figure 6 (5)
It is necessary to be able to perform the sum-of-products operation in the state of the double-precision floating point DEC 2 having a mantissa of -1 bit.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

eビットの指数部及び2n−1ビットの仮数部を有する
倍精度浮動小数点データについて浮動小数点加算を行う
場合には、桁合せシフタで倍精度の仮数部をシフトさせ
る必要がある。また、仮数部について倍精度加算を行う
と共に、最後に正規化シフタによりその加算結果につい
て再度倍精度シフトを行う必要が生じる。
When performing floating point addition on double precision floating point data having an exponent part of e bits and a mantissa part of 2n-1 bits, it is necessary to shift the double precision mantissa part using a digit alignment shifter. Further, it is necessary to perform double-precision addition on the mantissa part, and finally perform double-precision shift on the addition result again using the normalization shifter.

上記のように倍精度浮動小数点加算を行うには、桁合せ
シフト、加算、正規化シフトの各々に関し、倍精度処理
を行う必要がある。従って単精度の浮動小数点加算を行
う場合に比較して処理に時間を要し、演算全体に要する
時間が長くなる。
To perform double-precision floating-point addition as described above, it is necessary to perform double-precision processing for each of the digit alignment shift, addition, and normalization shift. Therefore, compared to the case of performing single-precision floating-point addition, processing time is required, and the time required for the entire calculation becomes longer.

本発明の目的は、倍精度浮動小数点加算を含む積和演算
において、浮動小数点加算の一部を省略し、演算時間を
高速化した浮動小数点積和演算器を提供することにある
SUMMARY OF THE INVENTION An object of the present invention is to provide a floating-point multiply-accumulate calculator that can omit part of the floating-point additions in multiply-accumulate operations including double-precision floating-point additions, thereby speeding up the computation time.

〔問題点を解決するための手段〕[Means for solving problems]

本発明に係る浮動小数点積和演算器は、2つの単精度の
浮動小数点データ列を入力し、対応する項ごと乗算し、
その乗算結果を順次加算する浮動小数点積和演算器にお
いて、乗算データを倍精度で出力する浮動小数点乗算器
と、前記乗算データと順次加算データを入力し、両デー
タについて桁合せシフトを行い、2つの倍精度仮数部と
1つの指数部を出力する倍精度桁合せシフタと、前記2
つの倍精度仮数部を加算し、倍精度加算出力とオーバー
フロー出力を出力する倍精度加算器と、この倍精度加算
器でオーバーフローが生じたとき前記倍精度加算出力に
対し1ビット右シフタを行う1ビット右シフトと、前記
倍精度加算器でオーバーフローが生じたとき前記倍精度
桁合せシフタから出力される指数部に1を加算する指数
部加算器と、この指数部加算器の出力を指数部とし、前
記1ビット右シフタの出力を仮数部とした前記順次加算
データを格納すると共に、前記倍精度桁合せシフタにこ
の順次加算データを与える倍精度レジスタと、この倍精
度レジスタにおける最終的な順次加算データを左正規化
を行う左正規化シフクとを備えたことを特徴としている
The floating-point multiply-accumulate calculator according to the present invention inputs two single-precision floating-point data strings, multiplies each corresponding term, and
A floating point multiplier that outputs multiplication data in double precision is inputted to a floating point multiplier that sequentially adds the multiplication results, and the multiplication data and sequential addition data are input, digit alignment and shift is performed on both data, and 2 a double-precision digit alignment shifter that outputs two double-precision mantissa parts and one exponent part;
A double-precision adder that adds two double-precision mantissa parts and outputs a double-precision addition output and an overflow output, and a 1-bit right shifter for the double-precision addition output when an overflow occurs in this double-precision adder. a bit right shift, an exponent part adder that adds 1 to the exponent part output from the double precision digit alignment shifter when an overflow occurs in the double precision adder, and the output of this exponent part adder as the exponent part. , a double-precision register that stores the sequential addition data with the output of the 1-bit right shifter as a mantissa and supplies the sequential addition data to the double-precision digit alignment shifter, and a final sequential addition in this double-precision register. The present invention is characterized in that it includes a left normalization shifter that performs left normalization of data.

〔作用〕[Effect]

本発明において、浮動小数点乗算器に入力される2つの
単精度の浮動小数点データ同士の乗算結果の仮数部を、
単精度に丸めることな(、倍精度のまま、倍精度桁合せ
シフタに入力し、戻された倍精度レジスタの出力と桁合
せを行った後桁合せされた倍精度仮数部同士の加算を倍
精度加算器によって行う。そして上記の仮数部加算にお
いてオーバーフローが生じたときには、1ビット右シフ
タによって仮数部を1ビット右シフトし、指数部加算器
によって桁合せされた指数部に1を加算する。
In the present invention, the mantissa part of the multiplication result between two single-precision floating point data input to the floating point multiplier is
Do not round to single precision (input double precision to the double precision digit alignment shifter, align the digits with the output of the returned double precision register, then double the addition of the digit aligned double precision mantissa parts) When an overflow occurs in the mantissa addition described above, the mantissa is shifted to the right by 1 bit by a 1-bit right shifter, and 1 is added to the exponent part whose digits have been aligned by the exponent part adder.

仮数部加算において桁落ちが生じた場合には、仮数部の
加算結果は非正規化数になる。しかし、非正規化数にな
っても正規化は行われず、加算結果に対し逐一正規化し
ないで積和演算を行い、これにより倍精度正規化シフト
に要する時間を省略することができる。
If a loss of digits occurs during addition of the mantissa, the result of addition of the mantissa becomes a denormalized number. However, even if the number becomes a non-normalized number, normalization is not performed, and the sum-of-products operation is performed on the addition result without normalizing it one by one, thereby making it possible to omit the time required for double-precision normalization shift.

正規化しないで積和演算を行う場合、一般に指数部の値
は増加することはあるが、反対に減少することはない。
When performing a product-sum operation without normalization, the value of the exponent part may generally increase, but it will not decrease.

そのため、桁落ちが生じて積和の値が減少した時に、指
数部の値が積和の指数部の値よりも小さい浮動小数点乗
算結果を積和の値に加算しようとすると、桁合せシフト
により、浮動小数点乗算結果の仮数部の下位ビットが、
最悪の場合、正規化を行った場合に比較して、桁落ちし
たビット数と同じだけ失われることになる。このような
場合、仮数部の演算精度(演算桁数)は、(仮数部の桁
数)−(桁落ちした桁数)になっている。
Therefore, when digit loss occurs and the value of the sum of products decreases, if you try to add a floating point multiplication result whose exponent part value is smaller than the value of the exponent part of the sum of products to the value of the sum of products, the digit shift will occur. , the lower bits of the mantissa of the floating-point multiplication result are
In the worst case, the number of bits lost is the same as the number of bits lost compared to normalization. In such a case, the arithmetic precision (number of digits in the calculation) of the mantissa is (number of digits in the mantissa) - (number of dropped digits).

しかし、仮数部加算は倍精度で行われるので、仮に単精
度に相当するビット数の桁落ちが生じたとしても、残り
の単精度に相当するビット数の演算精度は保存される。
However, since the mantissa addition is performed in double precision, even if a loss of digits occurs in the number of bits equivalent to single precision, the operational precision of the remaining number of bits equivalent to single precision is preserved.

従って、最終的な演算結果の仮数部を単精度で得ること
を考えれば、単精度に相当するビット数以下の桁落ちま
では許容される。
Therefore, considering that the mantissa of the final operation result is obtained in single precision, a loss of digits equal to or less than the number of bits corresponding to single precision is allowed.

〔実施例〕〔Example〕

以下に、図面を用いて本発明の詳細な説明する。 The present invention will be described in detail below using the drawings.

第1図は浮動小数点積和演算器の全体構成を示すブロッ
ク図である。浮動小数点積和演算器は、図示されるよう
に、浮動小数点乗算器1と、倍精度桁合せシフト2と、
倍精度加算器3と、指数部加算器4と、1ビット右シフ
タ2と、倍精度加算器3と、指数部加算器4と、1ビッ
ト右シフタ5と、倍精度レジスタ6と左正規化演算タ7
とから構成される。
FIG. 1 is a block diagram showing the overall configuration of a floating point multiply-accumulate calculator. As shown in the figure, the floating-point multiply-accumulate unit includes a floating-point multiplier 1, a double-precision digit alignment shift 2,
Double-precision adder 3, exponent adder 4, 1-bit right shifter 2, double-precision adder 3, exponent adder 4, 1-bit right shifter 5, double-precision register 6, and left normalization Arithmetic data 7
It consists of

上記構成において、浮動小数点乗算器1は2つの入力端
子1aを有し、各入力端子1aを介して2つのe+nビ
ットの浮動小数点データを入力する。浮動小数点データ
において、eビットは指数部、nビットは仮数部である
。浮動小数点乗算器1は2つの浮動小数点データに基づ
いてe+2n−1ビットの乗算データ8を出力する。乗
算データ8において、eビットは指数部、2n−1ビッ
トは仮数部である。倍精度桁合せシフタ2には、上記乗
算データ8と後述される倍精度レジスタ6の出力データ
9とが入力される。倍精度桁合せシフタ2は、乗算デー
タ8と出力データ9に関し、指数部の値の大きい方を検
出して指数部出力10として出力すると共に、指数部の
値の小さい方の仮数部につき桁合せシフトを行った後乗
算データ8と出力データ9に係る仮数部を仮数部出力1
1.12として出力する。仮数部出力11.12は倍精
度加算器3に入力される。倍精度加算器3は倍精度桁合
せシフタ2から与えられる2つの仮数部出力11゜12
を加算し、倍精度加算出力13を出力する。また同時に
倍精度加算器3は、加算においてオーバーフローが生じ
た時には“1 n1オーバーフローが生じない時には“
0”のオーバーフロー出力14を出力する。
In the above configuration, the floating point multiplier 1 has two input terminals 1a, and receives two e+n bits of floating point data through each input terminal 1a. In floating point data, the e bit is the exponent part and the n bit is the mantissa part. The floating point multiplier 1 outputs e+2n-1 bit multiplied data 8 based on two floating point data. In the multiplication data 8, the e bit is the exponent part, and the 2n-1 bits are the mantissa part. The multiplication data 8 and output data 9 of the double precision register 6, which will be described later, are input to the double precision digit alignment shifter 2. The double-precision digit alignment shifter 2 detects the larger value of the exponent part of the multiplication data 8 and the output data 9 and outputs it as an exponent part output 10, and also performs digit alignment for the mantissa part of the smaller exponent part value. After performing the shift, the mantissa part related to the multiplication data 8 and output data 9 is output as mantissa part 1.
Output as 1.12. The mantissa outputs 11 and 12 are input to the double precision adder 3. The double precision adder 3 receives two mantissa outputs 11°12 given from the double precision digit alignment shifter 2.
are added, and a double-precision addition output 13 is output. At the same time, the double-precision adder 3 outputs "1 n1 when no overflow occurs" when an overflow occurs during addition.
Outputs an overflow output 14 of 0''.

指数部加算器4は、倍精度桁合せシフタ2からの指数部
出力10と倍精度加算器3からのオーバーフロー出力1
4を入力し、指数部出力lOの最下位ビットにオーバー
フロー出力14を加算する。また1ビット右シフタ5は
、倍精度加算器3からの倍精度加算出力13とオーバー
フロー出力14を入力し、オーバーフロー出力14が“
1”の時には倍精度加算出力13を1ビット右方向にシ
フトさせて出力し、オーバーフロー出力14がパ0”の
時には上記シフトを行わずそのまま出力する機能を有す
る。
The exponent adder 4 receives the exponent output 10 from the double-precision digit alignment shifter 2 and the overflow output 1 from the double-precision adder 3.
4 is input, and the overflow output 14 is added to the least significant bit of the exponent output lO. In addition, the 1-bit right shifter 5 inputs the double-precision addition output 13 and the overflow output 14 from the double-precision adder 3, and the overflow output 14 is “
When the output is 1'', the double-precision addition output 13 is shifted to the right by 1 bit and output, and when the overflow output 14 is 0'', the output is output as is without performing the above-mentioned shift.

上記指数部加算器4の出力及び1ビット右シフタ5の出
力は倍精度レジスタ6に与えられる。倍精度レジスタ6
は、指数部加算器4の出力を指数部とし、1ビット右シ
フタ5の出力を仮数部としたe+2n−1ビットの浮動
小数点データを格納する。このようにして倍精度レジス
タ6に格納された浮動小数点データは、所要の累算が完
了するまでの間、桁合せシフタ2に与えられる。
The output of the exponent part adder 4 and the output of the 1-bit right shifter 5 are applied to a double precision register 6. Double precision register 6
stores e+2n-1 bit floating point data with the output of the exponent part adder 4 as the exponent part and the output of the 1-bit right shifter 5 as the mantissa part. The floating point data thus stored in the double precision register 6 is provided to the digit alignment shifter 2 until the required accumulation is completed.

左正規化演算ク7は、所要の累算が完了した後に、上記
倍精度レジスタ6に格納されたe+2n−1ビットの浮
動小数点データに対して左正規化演算を行うものである
。ここで、左正規化演算とは、仮数部における左端の符
号ビットの次のビット位置に当該符号ビットと異なる符
号ビットが来るよう、仮数部全体を左方向にシフトさせ
、その時のシフト量を指数部から減する演算をいう。第
6図の例で具体的に示すと、第6図(C)の浮動小数点
データの仮数部をmビット左方向にシフトし、指数部か
らmを引くと、第6図(d)に示す如き浮動小数点デー
タが左正規化演算されたものとして得られる。
The left normalization operation 7 performs a left normalization operation on the e+2n-1 bit floating point data stored in the double precision register 6 after the required accumulation is completed. Here, the left normalization operation is to shift the entire mantissa part to the left so that a sign bit different from the leftmost sign bit in the mantissa part is placed in the next bit position, and then use the shift amount as an index. An operation that subtracts from a part. Specifically, using the example in Figure 6, if the mantissa part of the floating point data in Figure 6(C) is shifted to the left by m bits and m is subtracted from the exponent part, the result is shown in Figure 6(d). Floating point data like this is obtained after left normalization operation.

次に上記構成を有する浮動小数点積和演算器の動作を、
第2図及び第3図のフローチャートに従って説明する。
Next, the operation of the floating point multiply-accumulator with the above configuration is as follows.
This will be explained according to the flowcharts in FIGS. 2 and 3.

第2図及び第3図のフローチャートは結合子■、■、O
により結合される。
The flowcharts in Figures 2 and 3 are for connectors ■, ■, and O.
are combined by

先ず、積和演算を開始すると、浮動小数点乗算器1の2
つの入力端子1a、laのそれぞれにe+nビットの浮
動小数点データが入力される(ステップ31)。浮動小
数点乗算器1は、これらの入力データについて浮動小数
点乗算を行い(ステップS2)、e+2n−1ビットの
乗算データ8を得て、これを出力する。
First, when the multiply-accumulate operation is started, floating point multiplier 1's 2
Floating point data of e+n bits is input to each of the two input terminals 1a and la (step 31). The floating point multiplier 1 performs floating point multiplication on these input data (step S2), obtains multiplication data 8 of e+2n-1 bits, and outputs this.

ここで、上記乗算データ8の指数部をEl、指数部E1
の値を01と表現し、且つ仮数部をMlと表現する。一
方、倍精度レジスタ6から与えられる出力データ9の指
数部をE2、指数部E2の値をe2と表現し、且つ加数
部M2と表現する。
Here, the exponent part of the multiplication data 8 is El, and the exponent part E1
The value of is expressed as 01, and the mantissa is expressed as Ml. On the other hand, the exponent part of the output data 9 given from the double precision register 6 is expressed as E2, the value of the exponent part E2 is expressed as e2, and the addend part M2.

次のステップでは、倍精度桁合せシフタ2において、E
lとE2の差d=e1−e2を求める(ステップ33)
。dが負のときには、倍精度桁合せシフタ2は、Mlを
ld1桁左桁間方向フトしくステップS4)、こうして
得られたMlを仮数部出力11且つ上記M2を仮数部出
力12とすると共にE2を指数部出力10とする(ステ
ップ35)。反対にdが正のときには、M2を6桁左方
向にシフトしくステップS6)、こうして得られたM2
を仮数部出力12且つMlを仮数部出力11とすると共
に、Elを指数部出力10とする(ステップS7)。
In the next step, in double precision digit alignment shifter 2, E
Find the difference d=e1-e2 between l and E2 (step 33)
. When d is negative, the double-precision digit alignment shifter 2 shifts Ml by ld one digit in the direction between the left digits (step S4), sets the thus obtained Ml as the mantissa output 11 and the above M2 as the mantissa output 12, and outputs E2. is set as the exponent part output 10 (step 35). On the other hand, when d is positive, M2 is shifted 6 digits to the left (step S6), and the M2 thus obtained is
is set as the mantissa output 12, Ml is set as the mantissa output 11, and El is set as the exponent output 10 (step S7).

倍精度加算器3では、上記の如く定まる仮数部出力11
.12の加算が行われ、倍精度加算器3は倍精度加算出
力13を出力する(ステップ38)。倍精度加算器3に
おける加算においてはオーバーフローが生じたか否かが
判断される(ステップS9)。
In the double-precision adder 3, the mantissa output 11 is determined as described above.
.. 12 is performed, and the double-precision adder 3 outputs a double-precision addition output 13 (step 38). It is determined whether an overflow has occurred in the addition in the double-precision adder 3 (step S9).

オーバーフローが生じた場合には、1ビット右シフタ5
によって倍精度加算出力13の仮数部を1ビット右シフ
トしくステップ310)、また指数部加算器4によって
倍精度桁合せシフタ2から出力される指数部出力10に
1を加算する(ステップ511)。
If an overflow occurs, the 1-bit right shifter 5
The mantissa part of the double-precision addition output 13 is shifted to the right by one bit (step 310), and the exponent part adder 4 adds 1 to the exponent part output 10 output from the double-precision digit alignment shifter 2 (step 511).

仮数部について上記1ビット右シフトを行う場合には、
仮数部の最上位ビットには倍精度加算出力13のキャリ
ー出力が入力される。オーバーフローが生じない場合に
はステップs1o、soは実行されない。
When performing the above 1-bit right shift on the mantissa,
The carry output of the double-precision addition output 13 is input to the most significant bit of the mantissa. If no overflow occurs, steps s1o and so are not executed.

倍精度レジスタ6は、指数部加算器4の出力を指数部と
し、1ビット右シフタ5の出力を仮数部とした浮動小数
点データを、中間結果として格納する(ステップ512
)。ステップ13は、累算が終了したか否かを判断する
ステップで、終了していない場合には、ステップS1に
戻り、次の入力データに対して、上記ステップ31〜S
12の処理を繰返す。
The double-precision register 6 stores, as an intermediate result, floating point data whose exponent part is the output of the exponent part adder 4 and whose mantissa part is the output of the 1-bit right shifter 5 (step 512).
). Step 13 is a step of determining whether or not the accumulation has been completed. If the accumulation has not been completed, the process returns to step S1 and the steps 31 to S described above are performed on the next input data.
Repeat step 12.

累算が終了した場合には、倍精度レジスタ6に格納され
る値を、最終結果として左正規化シフタ7で正規化しく
ステップ514)、正規化した出力を出力して(ステッ
プ515) 、終了する。
When the accumulation is completed, the value stored in the double precision register 6 is normalized as the final result by the left normalization shifter 7 (step 514), the normalized output is output (step 515), and the process ends. do.

上記動作で明らかなように、本発明に係る浮動小数点積
和演算器では、累算の途中において逐一正規化を行わず
、累算終了後の最終結果のみを正規化する。従って1回
の累算に必要とされる浮動小数点加算に要する時間を短
縮することができる。
As is clear from the above operation, the floating point multiply-accumulator according to the present invention does not perform normalization point by point during the accumulation, but only normalizes the final result after the accumulation is completed. Therefore, the time required for floating point addition required for one accumulation can be reduced.

次に前記倍精度桁合せシフタ2と左正規化シフタ7の詳
細な構成を説明する。
Next, detailed configurations of the double-precision digit alignment shifter 2 and left normalization shifter 7 will be explained.

第4図は倍精度桁合せシフタ2の構成を示す回路図であ
る。倍精度桁合せシフタ2は、図示の如く、入力レジス
タ201  、202 、減算器203 、204、入
力セレクタ205 、 206、シフト量セレクタ20
7、シフタ208、指数部出力セレクタ209、仮数部
出力セレクタ210 、211 とから構成される。
FIG. 4 is a circuit diagram showing the structure of the double precision digit alignment shifter 2. As shown in the figure, the double precision digit alignment shifter 2 includes input registers 201, 202, subtracters 203, 204, input selectors 205, 206, and a shift amount selector 20.
7, a shifter 208, an exponent output selector 209, and a mantissa output selector 210 and 211.

上記構成において、第1の入力レジスタ201には前記
乗算データ8が入力し、第2のレジスタ202には前記
出力データ9が入力する。入力レジスタ201に格納さ
れた乗算データ8の指数部及び入力レジスタ202に格
納された出力データ90指数部は減算器203 、20
4に供給され、減算器203は入力レジスタ201の指
数部から入力レジスタ202の指数部を減算し、減算器
204は入力レジスタ202の指数部から入力レジスタ
201の指数部を減算する。これの減算器203 、2
04の各減算出力はシフト量セレクタ207 に供給さ
れる。
In the above configuration, the multiplication data 8 is input to the first input register 201, and the output data 9 is input to the second register 202. The exponent part of the multiplication data 8 stored in the input register 201 and the exponent part of the output data 90 stored in the input register 202 are sent to the subtracters 203 and 20.
4, the subtracter 203 subtracts the exponent part of the input register 202 from the exponent part of the input register 201, and the subtracter 204 subtracts the exponent part of the input register 201 from the exponent part of the input register 202. This subtractor 203, 2
Each subtraction output of 04 is supplied to the shift amount selector 207.

また減算器203は、前記2つの指数部の大小関係を表
わす符号信号として、減算値における最上位ビットを取
り、これをO8から出力する。この符号信号において、
入力レジスタ201の指数部の値が入力レジスタ202
0指数部の値より大きいか又は等しいときにはC8の値
は“0”となり、反対に入力レジスタ201の指数部の
値が入力レジスタ202の指数部の値よりも小さいとき
にはC8の値は“1”となる。この符号信号は、入力セ
レクタ205 、206 、シフト量セレクタ207等
に与えられる。
Further, the subtracter 203 takes the most significant bit of the subtracted value as a code signal representing the magnitude relationship between the two exponent parts, and outputs it from O8. In this code signal,
The value of the exponent part of input register 201 is input to input register 202.
0 When the value of the exponent part is greater than or equal to the value of the exponent part, the value of C8 is "0", and conversely, when the value of the exponent part of the input register 201 is smaller than the value of the exponent part of the input register 202, the value of C8 is "1". becomes. This code signal is given to input selectors 205 , 206 , shift amount selector 207 and the like.

入力セレクタ205 、206のそれぞれには、入力レ
ジスタ201 、202の各仮数部が供給され、上記C
8の値に応じていずれかの仮数部を選択する。
The mantissa parts of the input registers 201 and 202 are supplied to the input selectors 205 and 206, respectively.
Select one of the mantissa parts according to the value of 8.

すなわち、入力セレクタ205は、C8の値が“0”の
ときには入力レジスタ201の2n−1ビット仮数部を
選択し、C8の値が“1”のときには入力レジスタ20
2の2n−1ビットの仮数部を選択する。一方、入力セ
レクタ206は、C3の値が“0”のときには入力レジ
スタ202の仮数部を選択し、O8の値が“1″のとき
には入力レジスタ201の仮数部を選択する。入力セレ
クタ205の出力は仮数部出力セレクタ210.211
に与えられ、入力セレクタ206の出力はシフタ208
に与えられる。
That is, the input selector 205 selects the 2n-1 bit mantissa part of the input register 201 when the value of C8 is "0", and selects the 2n-1 bit mantissa part of the input register 201 when the value of C8 is "1".
Select the 2n-1 bit mantissa of 2. On the other hand, the input selector 206 selects the mantissa part of the input register 202 when the value of C3 is "0", and selects the mantissa part of the input register 201 when the value of O8 is "1". The output of the input selector 205 is the mantissa output selector 210.211.
and the output of the input selector 206 is input to the shifter 208.
given to.

前記シフト量セレクタ207は、C8の値が“0”のと
きに減算器203の出力を選択し、C8O値が“1”の
ときに減算器204の出力を選択する。シフト量セレク
タ207の出力はシフタ208に与えられる。
The shift amount selector 207 selects the output of the subtracter 203 when the value of C8 is "0", and selects the output of the subtracter 204 when the value of C8O is "1". The output of shift amount selector 207 is given to shifter 208.

シフタ208では、入力セレクタ206の出力について
、シフト量セレクタ207の出力によって指定されるビ
ット数の分だけ右シフトが行われる。シフタ208の出
力は仮数部出力セレクタ210.211に与えられる。
In the shifter 208, the output of the input selector 206 is shifted to the right by the number of bits specified by the output of the shift amount selector 207. The output of shifter 208 is given to mantissa output selectors 210 and 211.

指数部出力セレクタ209には、入力レジスタ201゜
202の指数部出力及び減算器203の前記符号信号が
供給される。指数部出力セレクタ209は、O8の値が
“0”のときに入力レジスタ201の指数部出力を選択
し、C8O値が“1”のときに入力レジスタ202の指
数部出力を選択する。指数部出力セレクタ209は前記
指数部出力10を出力する。
The exponent output selector 209 is supplied with the exponent outputs of the input registers 201 and 202 and the code signal of the subtracter 203. Exponent output selector 209 selects the exponent output of input register 201 when the value of O8 is "0", and selects the exponent output of input register 202 when the value of C8O is "1". The exponent part output selector 209 outputs the exponent part output 10.

仮数部出力セレクタ210.211には減算器203か
ら符号信号が供給され、この符号信号によって仮数部出
力セレクタ210 、211 は次のようなセレクタ動
作を行う。すなわち、仮数部出力セレクタ210では、
C8の値が“0”のときには入力セレクタ205の出力
を選択し、O8の値が“1”のときにはシフタ208の
出力を選択し、前記仮数部出力11として出力する。ま
た仮数部出力セレクタ211では、C8の値が“0”の
ときにはシフタ208の出力を選択し、C8の値が“1
”のときには入力セレクタ205の出力を選択し、前記
仮数部出力12として出力する。
A sign signal is supplied from the subtracter 203 to the mantissa output selectors 210 and 211, and the sign signal causes the mantissa output selectors 210 and 211 to perform the following selector operation. That is, in the mantissa output selector 210,
When the value of C8 is "0", the output of the input selector 205 is selected, and when the value of O8 is "1", the output of the shifter 208 is selected and output as the mantissa output 11. Furthermore, the mantissa output selector 211 selects the output of the shifter 208 when the value of C8 is "0", and selects the output of the shifter 208 when the value of C8 is "1".
”, the output of the input selector 205 is selected and output as the mantissa output 12.

以上のようにして、倍精度桁合せシフタ2では、入力レ
ジスタ201 、202 に入力される乗算データ8と
出力データ9のうち、大きい値の指数部が指数部出力1
0として出力され、小さい値の指数部を有する7′−夕
の仮数部が指数部の差の分だけ右シフトされることによ
って仮数部出力11.12が出力される。
As described above, in the double-precision digit alignment shifter 2, among the multiplication data 8 and the output data 9 input to the input registers 201 and 202, the exponent part with the larger value is the exponent part output 1.
0, and the mantissa part of 7'-1, which has a small exponent part, is shifted to the right by the difference in the exponent parts, thereby producing a mantissa output of 11.12.

第5図は左正規化シフタ7の構成を示す回路図である。FIG. 5 is a circuit diagram showing the configuration of the left normalization shifter 7.

左正規化シフタ7は、図示される如く、入力レジスタ7
1と、最大及符号ビット検出回路72と、減算器73と
、シフタ74と、出力レジスタ75から構成される。
The left normalization shifter 7 has an input register 7 as shown in the figure.
1, a maximum sign bit detection circuit 72, a subtracter 73, a shifter 74, and an output register 75.

上記構成において、入力レジスタ71には前記倍精度レ
ジスタ6から累算された出力データが入力される。入力
レジスタ71の出力において、指数部データが減算器7
3に与えられると共に仮数部データが最大及符号ビット
検出回路72及びシフタ74に与えられる。最大及符号
ビット検出回路72は、上記仮数部データの最大及符号
ビット(符号ビットの下位ビットの中で符号ビットと異
なるビットを有する最大桁のビット)の位置を検出し、
符号ビットの次の桁のビットと最大及符号ビットとの桁
の差を出力する。最大及符号ビット検出回路72の出力
は減算器73及びシフタ74に与えられる。
In the above configuration, the output data accumulated from the double precision register 6 is input to the input register 71. At the output of the input register 71, the exponent data is sent to the subtracter 7.
3, and the mantissa data is also provided to the maximum sign bit detection circuit 72 and shifter 74. The largest plus sign bit detection circuit 72 detects the position of the largest plus sign bit (the largest bit having a bit different from the sign bit among the lower bits of the sign bit) of the mantissa data,
Outputs the digit difference between the next digit bit of the sign bit and the largest sign bit. The output of the maximum sign bit detection circuit 72 is given to a subtracter 73 and a shifter 74.

減算器73では、入力レジスタ71の指数部データから
最大及符号ビット検出回路72の出力が減じられる。ま
たシフタ74では、入力レジスタ71の仮数′  部デ
ータについて最大及符号ビット検出回路72の出力をシ
フト量として左シフトが行われる。かかる減算器73及
びシフタ74の出力に基づいて、出力レジスタ75は、
減算器73のeビットの出力を指数部とし、シフタ74
の2n−1ビットの出力を仮数部とした、e+2n−1
ビットの浮動小数点データを出力する。
In the subtracter 73, the output of the maximum plus sign bit detection circuit 72 is subtracted from the exponent part data of the input register 71. Further, in the shifter 74, the mantissa' part data of the input register 71 is shifted to the left using the output of the maximum sign bit detection circuit 72 as the shift amount. Based on the outputs of the subtracter 73 and shifter 74, the output register 75
The output of the e bit of the subtracter 73 is used as the exponent part, and the shifter 74
e+2n-1 with the 2n-1 bits of output as the mantissa part
Output bit floating point data.

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

以上の説明で明らかなように、本発明によれば、順次に
得られる浮動小数点乗算結果に対し倍精度小数点累算を
行う浮動小数点積和演算器において、上記浮動小数点累
算における各加算において正規化シフトを行わず、最終
的な累算結果のみに対して正規化を行うことにより、浮
動小数点加算に要する時間を短縮化し、浮動小数点積和
演算全体に要する時間を短くすることができる効果があ
る。
As is clear from the above description, according to the present invention, in a floating-point multiply-accumulate unit that performs double-precision point accumulation on floating-point multiplication results obtained sequentially, each addition in the floating-point accumulation is normalized. By performing normalization only on the final accumulation result without performing a conversion shift, the time required for floating-point addition can be shortened, and the time required for the entire floating-point multiply-accumulate operation can be shortened. be.

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

第1図は、本発明に係る浮動小数点積和演算器の全体構
成を示すブロック図、 第2図は動作説明のためのフローチャート、第3図は動
作説明のためのフローチャート、第4図は倍精度桁合せ
シフタの詳細な構成を示す回路図、 第5図は左正規化シフタの詳細な構成を示す回路図、 第6図は通常の浮動小数点データ表現及び倍精度浮動小
数点データ表現を示す図である。 1 ・・・・・・ 浮動小数点乗算器 2 ・・・・・・ 倍精度桁合せシフタ3 ・・・・・
・ 倍精度加算器 4 ・・・・・・ 指数部加算器 5 ・・・・・・ 1ビット右シフタ 6 ・・・・・・ 倍精度レジスタ 7 ・・・・・・ 左正規化シフタ 代理人 弁理士  岩 佐 義 幸 第1図 第2図 第6図
FIG. 1 is a block diagram showing the overall configuration of a floating-point multiply-accumulate unit according to the present invention, FIG. 2 is a flowchart for explaining the operation, FIG. 3 is a flowchart for explaining the operation, and FIG. Figure 5 is a circuit diagram showing the detailed configuration of the precision digit alignment shifter, Figure 5 is a circuit diagram showing the detailed configuration of the left normalization shifter, Figure 6 is a diagram showing normal floating point data representation and double precision floating point data representation. It is. 1... Floating point multiplier 2... Double precision digit alignment shifter 3...
・Double precision adder 4...Exponent adder 5...1 bit right shifter 6...Double precision register 7...Left normalization shifter agent Patent Attorney Yoshiyuki Iwasa Figure 1 Figure 2 Figure 6

Claims (1)

【特許請求の範囲】[Claims] (1)2つの単精度の浮動小数点データ列を入力し、対
応する項ごと乗算し、その乗算結果を順次加算する浮動
小数点積和演算器において、乗算データを倍精度で出力
する浮動小数点乗算器と、前記乗算データと順次加算デ
ータを入力し、両データについて桁合せシフトを行い、
2つの倍精度仮数部と1つの指数部を出力する倍精度桁
合せシフタと、前記2つの倍精度仮数部を加算し、倍精
度加算出力とオーバーフロー出力を出力する倍精度加算
器と、この倍精度加算器でオーバーフローが生じたとき
前記倍精度加算出力に対し1ビット右シフトを行う1ビ
ット右シフタと、前記倍精度加算器でオーバーフローが
生じたとき前記倍精度桁合せシフタから出力される指数
部に1を加算する指数部加算器と、この指数部加算器の
出力を指数部とし、前記1ビット右シフタの出力を仮数
部とした前記順次加算データを格納すると共に、前記倍
精度桁合せシフタにこの順次加算データを与える倍精度
レジスタと、この倍精度レジスタにおける最終的な順次
加算データを左正規化を行う左正規化シフタとを備えた
ことを特徴とする浮動小数点積和演算器。
(1) A floating-point multiplier that inputs two single-precision floating-point data strings, multiplies each corresponding term, and sequentially adds the multiplication results. A floating-point multiplier that outputs the multiplied data in double precision. Then, input the multiplication data and sequential addition data, perform digit alignment shift on both data,
a double-precision digit shifter that outputs two double-precision mantissa parts and one exponent part; a double-precision adder that adds the two double-precision mantissa parts and outputs a double-precision addition output and an overflow output; a 1-bit right shifter that shifts the double-precision addition output by 1 bit to the right when an overflow occurs in the precision adder; and an exponent output from the double-precision digit alignment shifter when an overflow occurs in the double-precision adder. an exponent adder that adds 1 to the exponent adder; the output of the exponent adder is the exponent; the output of the 1-bit right shifter is the mantissa; the sequentially added data is stored; A floating-point product-sum calculator comprising: a double-precision register that supplies this sequential addition data to a shifter; and a left normalization shifter that left-normalizes the final sequential addition data in the double-precision register.
JP22030985A 1985-10-04 1985-10-04 Floating point arithmetic unit for sum of product Granted JPS6280764A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP22030985A JPS6280764A (en) 1985-10-04 1985-10-04 Floating point arithmetic unit for sum of product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP22030985A JPS6280764A (en) 1985-10-04 1985-10-04 Floating point arithmetic unit for sum of product

Publications (2)

Publication Number Publication Date
JPS6280764A true JPS6280764A (en) 1987-04-14
JPH0361224B2 JPH0361224B2 (en) 1991-09-19

Family

ID=16749121

Family Applications (1)

Application Number Title Priority Date Filing Date
JP22030985A Granted JPS6280764A (en) 1985-10-04 1985-10-04 Floating point arithmetic unit for sum of product

Country Status (1)

Country Link
JP (1) JPS6280764A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6895423B2 (en) 2001-12-28 2005-05-17 Fujitsu Limited Apparatus and method of performing product-sum operation
JP2020521192A (en) * 2017-05-17 2020-07-16 グーグル エルエルシー Performing matrix multiplication in hardware

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6895423B2 (en) 2001-12-28 2005-05-17 Fujitsu Limited Apparatus and method of performing product-sum operation
JP2020521192A (en) * 2017-05-17 2020-07-16 グーグル エルエルシー Performing matrix multiplication in hardware
JP2022106737A (en) * 2017-05-17 2022-07-20 グーグル エルエルシー Performing matrix multiplication in hardware
US11989258B2 (en) 2017-05-17 2024-05-21 Google Llc Performing matrix multiplication in hardware

Also Published As

Publication number Publication date
JPH0361224B2 (en) 1991-09-19

Similar Documents

Publication Publication Date Title
EP0472148B1 (en) Method and apparatus for computing floating point data
CN112860220B (en) Reconfigurable floating-point multiply-add operation unit and method suitable for multi-precision calculation
EP0472139A2 (en) A floating-point processor
JP4388543B2 (en) 3-input floating-point adder / subtracter
EP0356153B1 (en) Radix-2**n divider method and apparatus using overlapped quotient bit selection and concurrent quotient rounding and correction
JP3313560B2 (en) Floating point processor
CN116643718A (en) Floating point fusion multiply-add device and method of pipeline structure and processor
JP2822399B2 (en) Logarithmic function arithmetic unit
US6598065B1 (en) Method for achieving correctly rounded quotients in algorithms based on fused multiply-accumulate without requiring the intermediate calculation of a correctly rounded reciprocal
CN116450085A (en) Extensible BFLoat 16-point multiplication arithmetic unit and microprocessor
CN117932200A (en) Floating point square root calculation method and floating point calculation module
KR100317767B1 (en) Floating point binary quad word format multiply instruction unit
JPS6280764A (en) Floating point arithmetic unit for sum of product
JP2558669B2 (en) Floating point arithmetic unit
JPH04172526A (en) Floating point divider
JPS62168228A (en) Product/sum arithmetic unit with floating point function
JPH0283728A (en) Floating point multiplier
JP3137131B2 (en) Floating point multiplier and multiplication method
Shapran et al. DIVISION USING THE BASE RADIX16 NUMBER SYSTEM TO FORM FRACTION DIGITS
JP3100868B2 (en) Arithmetic unit for floating point numbers
JP2792998B2 (en) Type conversion device using addition / subtraction circuit
JPH0498524A (en) Floating point arithmetic unit
JP3124286B2 (en) Floating point arithmetic unit
JPH0447848B2 (en)
JPH0427587B2 (en)

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term