JPH0855015A - Arithmetic unit for floating point number - Google Patents

Arithmetic unit for floating point number

Info

Publication number
JPH0855015A
JPH0855015A JP7129940A JP12994095A JPH0855015A JP H0855015 A JPH0855015 A JP H0855015A JP 7129940 A JP7129940 A JP 7129940A JP 12994095 A JP12994095 A JP 12994095A JP H0855015 A JPH0855015 A JP H0855015A
Authority
JP
Japan
Prior art keywords
exponent
operand
bit
subtraction
mantissa
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
JP7129940A
Other languages
Japanese (ja)
Other versions
JP3100868B2 (en
Inventor
Genichiro Inoue
源一郎 井上
Yoshinori Urano
美紀 浦野
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 JP07129940A priority Critical patent/JP3100868B2/en
Publication of JPH0855015A publication Critical patent/JPH0855015A/en
Application granted granted Critical
Publication of JP3100868B2 publication Critical patent/JP3100868B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PURPOSE:To reduce the hardware amount of an arithmetic unit for executing the addition, subtraction, multiplication and division of floating point numbers. CONSTITUTION:In the case of floating point addition and subtraction, two mantissas for which digits are matched by a swapper 15 and a right shifter 16 are supplied through first and second mantissa selectors 17 and 18 and two pieces of one-bit right shifters 19 and 20 to an adder-subtractor 21 and added and subtracted in the adder-subtractor 21 and the result is rounded. In the case of floating point multiplication and divison, an intermediate sum S and a carry C outputted from a multiplier 24 are supplied through the first and second mantissa selectors 17 and 18 and two pieces of the one-bit right shifters 19 and 20 to the adder-subtractor 21 and added in the adder-subtractor 21 and the result is rounded. The rounded result of the adder-subtractor 21 is passed through a priority encoder 22 and a left shifter 23 and outputted as the normalized mantissa. Exponents are processed by exponent computing units 11, 13 and 14 and an exponent selector 12.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、浮動小数点数の加減乗
除算を実行するための算術演算装置に関するものであ
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an arithmetic unit for performing addition, subtraction, multiplication and division of floating point numbers.

【0002】[0002]

【従来の技術】近年、科学技術計算やグラフィック処理
の複雑化に伴って高速性を要求されてきた浮動小数点算
術演算装置では、複数の演算ユニットを並列に動作させ
ることで、この要求に答えてきた。一方、組込み用途な
どに用いられるマイクロコントローラでは、高速演算の
要求が高まっている反面、コスト削減のために、複数の
演算ユニットを持つ算術演算装置を用いることができな
いという実状がある。したがって、少ないハードウェア
量で複数の種類の算術演算を実現する浮動小数点算術演
算装置が必要となってくる。
2. Description of the Related Art In recent years, a floating point arithmetic operation unit, which has been required to have high speed in accordance with scientific and technical calculations and complicated graphic processing, responds to this request by operating a plurality of arithmetic units in parallel. It was On the other hand, in microcontrollers used for embedded applications and the like, the demand for high-speed arithmetic is increasing, but in order to reduce costs, it is not possible to use arithmetic arithmetic units having a plurality of arithmetic units. Therefore, there is a need for a floating-point arithmetic operation device that realizes a plurality of types of arithmetic operations with a small amount of hardware.

【0003】米国特許第4,866,652号には、
(A×B)+Cの形の浮動小数点演算のための算術演算
装置が開示されている。この装置では、加減算のための
仮数の桁合せ手段を構成する2つのマルチプレクサと右
シフタとが乗算器の後段に配置されていた。一方、nビ
ットの仮数とmビットの仮数との乗算で求められた(n
+m)ビットの積をnビットに丸めると、nビットの積
仮数が得られる。従来は、米国特許第4,866,65
2号に従来技術として示されているように、仮数乗算器
の内部で丸めが行われていた。また、仮数乗算器の内部
に丸め用ビット生成装置を設けて、該仮数乗算器から
(n+m)ビットの積のうちの上位nビットと生成され
た丸め用ビットとを出力するようにした構成も知られて
いる。
US Pat. No. 4,866,652 describes
An arithmetic unit for floating point arithmetic of the form (A × B) + C is disclosed. In this device, the two multiplexers and the right shifter that constitute the mantissa digit matching means for addition and subtraction are arranged in the subsequent stage of the multiplier. On the other hand, it is obtained by multiplying the n-bit mantissa by the m-bit mantissa (n
Rounding the product of + m) bits to n bits yields the n-bit product mantissa. Previously, US Pat. No. 4,866,65
Rounding was done inside the mantissa multiplier, as shown in the prior art in No. 2. A configuration is also possible in which a rounding bit generator is provided inside the mantissa multiplier and the higher n bits of the product of (n + m) bits and the generated rounding bit are output from the mantissa multiplier. Are known.

【0004】ところで、IEEE(the Institute of E
lectrical and Electronics Engineers )754規格で
は、1ビットの符号Sと、8ビットの指数Eと、23ビ
ットの小数部Fとの合計32ビットの単精度浮動小数点
数の表現形式が規定されている。通常は、小数部Fの最
上位ビット(MSB)より更に上位に仮想的な非ゼロ値
ビットと小数点とが位置するように正規化処理を施した
浮動小数点数が用いられる。ただし、指数Eが正数とな
るように、実際の指数にバイアスBが与えられる。単精
度の場合には、実際の指数にバイアスBとして27 −1
=127を加えた数を指数Eとする。すなわち、単精度
の正規化数(ノーマライズド・ナンバー)として表現さ
れる実数Rは、 R=(−1)S E-127 (1.F) …(1) となる。ただし、式(1)中の1.Fを仮数Mという。
By the way, IEEE (the Institute of E
The Electrical and Electronics Engineers) 754 standard defines an expression format of a 32-bit single precision floating point number consisting of a 1-bit code S, an 8-bit exponent E, and a 23-bit fractional part F. Usually, a floating-point number that has been normalized so that the virtual non-zero value bit and the decimal point are positioned higher than the most significant bit (MSB) of the decimal part F is used. However, the bias B is given to the actual index so that the index E is a positive number. In the case of single precision, 2 7 −1 is set as the bias B for the actual index.
= 127 is set as an index E. That is, the real number R expressed as a single-precision normalized number (normalized number) is R = (− 1) S 2 E-127 (1.F) (1). However, in the formula (1), 1. F is called the mantissa M.

【0005】被乗数オペランドの指数又は被除数オペラ
ンドの指数をnビットの第1の指数Xとし、乗数オペラ
ンドの指数又は除数オペランドの指数をnビットの第2
の指数Yとし、かつ指数のバイアスをB=2(n-1) −1
とする。乗算の際の実際の指数の演算は、 (X−B)+(Y−B)=(X+Y−B)−B …(2) である。つまり、乗算の場合に求めるべきバイアス付き
の指数はX+Y−Bである。また、除算の際の実際の指
数の演算は、 (X−B)−(Y−B)=(X−Y+B)−B …(3) である。つまり、除算の場合に求めるべきバイアス付き
の指数はX−Y+Bである。
The exponent of the multiplicand operand or the exponent of the dividend operand is an n-bit first exponent X, and the exponent of the multiplier operand or the divisor operand is an n-bit second exponent.
, And the bias of the index is B = 2 (n-1) -1
And The actual calculation of the exponent at the time of multiplication is (X−B) + (Y−B) = (X + Y−B) −B (2). That is, the exponent with bias to be obtained in the case of multiplication is X + Y-B. The actual calculation of the exponent at the time of division is (X−B) − (Y−B) = (X−Y + B) −B (3). That is, the exponent with bias to be obtained in the case of division is XY + B.

【0006】特開平4−328630号公報には、積指
数X+Y−B及び商指数X−Y+Bを1つの加算器で求
めるための指数演算装置の構成が開示されている。
Japanese Unexamined Patent Publication (Kokai) No. 4-328630 discloses a structure of an exponent arithmetic unit for obtaining the product exponent X + Y-B and the quotient exponent X-Y + B by one adder.

【0007】[0007]

【発明が解決しようとする課題】上記米国特許第4,8
66,652号に開示されている(A×B)+Cの形の
浮動小数点演算のための算術演算装置は、仮数の桁合せ
手段が乗算器の後段に配置されていたので、単一加算A
+Bや単一減算A−Bには適していなかった。また、乗
算器の内部で丸めを行ったり、乗算器の内部に丸め用ビ
ット生成装置を設けたりする構成では、結果として乗算
器のハードウェア量が増加するという問題があった。
The above-mentioned US Pat. No. 4,8
The arithmetic unit for floating-point arithmetic in the form of (A × B) + C disclosed in Japanese Patent No. 66,652 has a single addition A since the means for aligning the mantissa is arranged after the multiplier.
It was not suitable for + B or single subtraction AB. Further, in the configuration in which the rounding is performed inside the multiplier or the rounding bit generating device is provided inside the multiplier, there is a problem that the hardware amount of the multiplier increases as a result.

【0008】また、上記特開平4−328630号公報
に開示されている指数演算装置は、加減算の場合の指数
処理を実行できない問題があった。
Further, the exponential arithmetic unit disclosed in the above-mentioned Japanese Patent Laid-Open No. 4-328630 has a problem that the exponential processing in the case of addition and subtraction cannot be executed.

【0009】本発明の目的は、浮動小数点数の単一加
算、単一減算、単一乗算及び単一除算の実行に適したハ
ードウェア量の少ない算術演算装置を提供することにあ
る。
It is an object of the present invention to provide an arithmetic operation unit with a small amount of hardware suitable for executing single addition, single subtraction, single multiplication and single division of floating point numbers.

【0010】本発明の他の目的は、加減乗除算に兼用で
きる指数演算装置を提供することにある。
Another object of the present invention is to provide an exponential arithmetic unit which can be used for addition, subtraction, multiplication and division.

【0011】[0011]

【課題を解決するための手段】本発明に係る第1及び第
2の算術演算装置は、第1のオペランドの指数及び仮数
として被加数オペランドの指数及び仮数又は被減数オペ
ランドの指数及び仮数が、第2のオペランドの指数及び
仮数として加数オペランドの指数及び仮数又は減数オペ
ランドの指数及び仮数が、第3のオペランドの指数及び
仮数として被乗数オペランドの指数及び仮数又は被除数
オペランドの指数及び仮数が、第4のオペランドの指数
及び仮数として乗数オペランドの指数及び仮数又は除数
オペランドの指数及び仮数がそれぞれ与えられる浮動小
数点数のための算術演算装置であることを前提としたも
のである。
In the first and second arithmetic operation units according to the present invention, the exponent and the mantissa of the augend operand or the exponent and the mantissa of the minuend operand are used as the exponent and the mantissa of the first operand, respectively. The exponent and mantissa of the add operand as the exponent and mantissa of the second operand, and the exponent and mantissa of the multiplicand operand as the exponent and mantissa of the third operand, respectively. 4 is assumed to be an arithmetic operation unit for a floating point number to which the exponent and the mantissa of the multiplier operand and the exponent and the mantissa of the divisor operand are given as the exponent and the mantissa, respectively.

【0012】本発明に係る第1の算術演算装置は、仮数
の桁合せ手段と仮数の乗除算手段とを並列配置した構成
を採用したものである。具体的には、第1のオペランド
の仮数と第2のオペランドの仮数との桁合せを行うため
の桁合せ手段と、第3のオペランドの仮数及び第4のオ
ペランドの仮数から2つの中間値の形の中間積又は中間
商を算出するための乗除算手段と、加減算の場合には前
記桁合せされた2つの仮数のうちの一方を、乗除算の場
合には前記2つの中間値のうちの一方を各々第1のデー
タとして選択するための第1の選択手段と、加減算の場
合には前記桁合せされた2つの仮数のうちの他方を、乗
除算の場合には前記2つの中間値のうちの他方を各々第
2のデータとして選択するための第2の選択手段と、前
記第1及び第2のデータの加減算を行うための加減算手
段とを備えた構成を採用したものである。
A first arithmetic operation device according to the present invention employs a configuration in which mantissa digit aligning means and mantissa multiplication / division means are arranged in parallel. Specifically, a digit alignment means for performing digit alignment between the mantissa of the first operand and the mantissa of the second operand, and two intermediate values from the mantissa of the third operand and the mantissa of the fourth operand. Form multiplying and dividing means for calculating an intermediate product or an intermediate quotient, one of the two mantissas aligned in the case of addition and subtraction, and one of the two intermediate values in the case of multiplication and division. First selecting means for selecting one as the first data, the other of the two mantissas aligned in the case of addition and subtraction, and the other of the two intermediate values in the case of multiplication and division. The second selection means for selecting the other of them as the second data, and the addition / subtraction means for performing the addition / subtraction of the first and second data are adopted.

【0013】本発明に係る第2の算術演算装置は、(n
+m)ビットの積又は商からnビットに丸められた結果
を得る処理が、加減算で使用されるハードウェアで実現
できることに着目して、(n+m)ビットの積を加減算
手段に分割入力する構成として得られたものである。具
体的には、第3のオペランドの仮数及び第4のオペラン
ドの仮数から(n+m)ビットの積又は商を算出するた
めの乗除算手段と、加減算の場合には第1のオペランド
の仮数を、乗除算の場合には前記(n+m)ビットの積
又は商のうちの上位nビットを各々第1のデータとして
選択するための第1の選択手段と、加減算の場合には第
2のオペランドの仮数を、乗除算の場合には前記(n+
m)ビットの積又は商のうちの下位mビットを各々第2
のデータとして選択するための第2の選択手段と、加減
算の場合には前記第1のデータと前記第2のデータとの
桁合せを行うとともに第1の丸め用ビットを生成し乗除
算の場合には前記第1のデータを出力するとともに前記
第2のデータから第2の丸め用ビットを生成するための
桁合せ手段と、加減算の場合には前記桁合せされた第1
及び第2のデータの加減算とともに前記第1の丸め用ビ
ットを用いた丸めを行い乗除算の場合には前記第2の丸
め用ビットを用いて前記第1のデータの丸めを行うため
の加減算手段とを備えた構成を採用したものである。
A second arithmetic operation unit according to the present invention is (n
Paying attention to the fact that the processing for obtaining a result rounded to n bits from the product or quotient of + m) bits can be realized by the hardware used for addition and subtraction, as a configuration for dividing and inputting the product of (n + m) bits to the addition and subtraction means. It was obtained. Specifically, the multiplication / division means for calculating the product or quotient of (n + m) bits from the mantissa of the third operand and the mantissa of the fourth operand, and the mantissa of the first operand in the case of addition / subtraction, In the case of multiplication / division, first selection means for selecting the upper n bits of the product or quotient of the (n + m) bits as the first data, and in the case of addition / subtraction, the mantissa of the second operand. In the case of multiplication and division, (n +
m) the lower m bits of the product or quotient of
In the case of multiplication and division, the second selection means for selecting the first rounding bit and the second data in the case of addition and subtraction are aligned with each other. To the digitizing means for outputting the first data and generating the second rounding bit from the second data, and in the case of addition and subtraction, the digitized first digit.
And addition / subtraction of second data, rounding using the first rounding bit, and in the case of multiplication / division, addition / subtraction means for rounding the first data using the second rounding bit It adopts a configuration with and.

【0014】本発明に係る指数演算装置は、加減算及び
乗除算における指数演算が全て減算で実現できる点に着
目して、減算器に多少の回路を付加して得られたもので
ある。具体的には、第1のオペランドの指数として被加
数オペランドの指数又は被減数オペランドの指数が、第
2のオペランドの指数として加数オペランドの指数又は
減数オペランドの指数が、第3のオペランドの指数とし
て被乗数オペランドの指数又は被除数オペランドの指数
が、第4のオペランドの指数として乗数オペランドの指
数又は除数オペランドの指数がそれぞれ与えられる浮動
小数点数のための指数演算装置であって、第1のオペラ
ンドの指数又は第3のオペランドの指数をnビットの第
1の指数Xとし、第2のオペランドの指数又は第4のオ
ペランドの指数をnビットの第2の指数Yとし、かつ指
数のバイアスをB=2(n-1) −1とするとき、各々次の
ような機能を有するn個の1ビット反転器と、論理ゲー
トと、減算器と、(n+1)ビット反転器と、出力セレ
クタとを備えた構成を採用したものである。
The exponential arithmetic unit according to the present invention is obtained by adding some circuits to the subtractor, paying attention to the fact that exponential arithmetic in addition and subtraction and multiplication and division can be realized by subtraction. Specifically, the exponent of the augend operand or the exponent of the augend operand is used as the exponent of the first operand, the exponent of the addend operand or the exponent of the subtractive operand is used as the exponent of the second operand, and the exponent of the third operand. Is an exponent arithmetic unit for a floating-point number in which the exponent of the multiplicand operand or the exponent of the dividend operand is the exponent of the multiplier operand or the exponent of the divisor operand, respectively, as the exponent of the fourth operand. The exponent or the exponent of the third operand is the n-bit first exponent X, the exponent of the second operand or the fourth operand is the n-bit second exponent Y, and the exponent bias is B = 2 (n-1) -1, n 1-bit inverters each having the following functions, a logic gate, a subtractor, and (n + 1) ) A configuration including a bit inverter and an output selector is adopted.

【0015】すなわち、n個の1ビット反転器は、加減
算の場合には第2の指数Yそのもので構成されるnビッ
トの中間データを、乗算の場合には第2の指数Yの最上
位ビットと第2の指数Yの下位(n−1)ビットの各々
の反転とで構成されるnビットの中間データを、除算の
場合には第2の指数Yの最上位ビットの反転と第2の指
数Yの下位(n−1)ビットとで構成されるnビットの
中間データをそれぞれ得るものである。論理ゲートは、
(n+1)ビットの減数データIBを得るように、加減
算の場合には0を、乗除算の場合には前記n個の1ビッ
ト反転器により得られたnビットの中間データの最上位
ビットの値をそれぞれ該nビットの中間データの上位桁
に付加するものである。減算器は、第1の指数Xを被減
数データIAとして、第1の減算結果P=IA−IBと
第2の減算結果Q=IA−(IB+1)とを算出するも
のである。(n+1)ビット反転器は、前記第2の減算
結果Qを構成する(n+1)ビットの各々の反転を得る
ものである。出力セレクタは、X≧Yかつ加減算の場合
には第1のオペランドの指数が第2のオペランドの指数
より小さくないことを示す信号と、第1のオペランドの
指数と第2のオペランドの指数との差の絶対値X−Yと
を出力するように前記第1の減算結果Pを選択し、X<
Yかつ加減算の場合には第1のオペランドの指数が第2
のオペランドの指数より小さいことを示す信号と、第1
のオペランドの指数と第2のオペランドの指数との差の
絶対値Y−Xとを出力するように前記(n+1)ビット
反転器の結果を選択し、乗算の場合には積指数X+Y−
Bを出力するように前記第1の減算結果Pを選択し、除
算の場合には商指数X−Y+Bを出力するように前記第
2の減算結果Qを選択するものである。
That is, the n 1-bit inverters use n bits of intermediate data composed of the second exponent Y itself in the case of addition and subtraction and the most significant bit of the second exponent Y in the case of multiplication. And the inversion of each of the lower (n-1) bits of the second exponent Y, in the case of division, the inversion of the most significant bit of the second exponent Y It obtains n-bit intermediate data composed of the lower (n-1) bits of the exponent Y, respectively. The logic gate is
In order to obtain the (n + 1) -bit subtraction data IB, 0 is added and subtracted, and in the case of multiplication and division, the value of the most significant bit of the n-bit intermediate data obtained by the n 1-bit inverters. Are added to the upper digits of the n-bit intermediate data. The subtractor calculates the first subtraction result P = IA-IB and the second subtraction result Q = IA- (IB + 1) using the first exponent X as the minuend data IA. The (n + 1) -bit inverter obtains the inversion of each of the (n + 1) -bits forming the second subtraction result Q. The output selector outputs a signal indicating that the exponent of the first operand is not smaller than the exponent of the second operand when X ≧ Y and addition / subtraction, and the exponent of the first operand and the exponent of the second operand. The first subtraction result P is selected so as to output the absolute value X−Y of the difference, and X <
In the case of Y and addition / subtraction, the exponent of the first operand is the second
A signal that is less than the exponent of the operand of
The result of the (n + 1) bit inverter is selected to output the absolute value Y−X of the difference between the exponent of the operand and the exponent of the second operand, and in the case of multiplication, the product exponent X + Y−
The first subtraction result P is selected so as to output B, and the second subtraction result Q is selected so as to output the quotient index XY + B in the case of division.

【0016】[0016]

【作用】上記本発明に係る第1の算術演算装置によれ
ば、単一加算及び単一減算の場合には桁合せ手段、第1
及び第2の選択手段並びに加減算手段が、単一乗算及び
単一除算の場合には乗除算手段、第1及び第2の選択手
段並びに加減算手段がそれぞれ仮数処理に用いられる。
つまり、加減算の場合の桁合せされた2つの仮数の処理
と、乗除算の場合の中間積又は中間商の処理とが、同一
の加減算手段で行われる。
According to the first arithmetic operation unit of the present invention, in the case of single addition and single subtraction, the digit aligning means, the first
In the case of the single multiplication and the single division, the multiplication and division means, the first and second selection means, and the addition and subtraction means are used for mantissa processing, respectively.
In other words, the processing of the two mantissas aligned in the case of addition and subtraction and the processing of the intermediate product or the intermediate quotient in the case of multiplication and division are performed by the same addition and subtraction means.

【0017】上記本発明に係る第2の算術演算装置によ
れば、単一加算及び単一減算の場合には第1及び第2の
選択手段、桁合せ手段並びに加減算手段が、単一乗算及
び単一除算の場合には乗除算手段、第1及び第2の選択
手段、桁合せ手段並びに加減算手段がそれぞれ仮数処理
に用いられる。つまり、加減算の場合の2つの仮数の丸
めを伴う桁合せ加減算処理と、乗除算の場合の積又は商
の所要のビット数への丸め加算処理とが、同一の桁合せ
手段及び加減算手段で行われる。
According to the second arithmetic operation device of the present invention, in the case of single addition and single subtraction, the first and second selecting means, the digit aligning means, and the adding / subtracting means perform the single multiplication and In the case of single division, the multiplication / division means, the first and second selection means, the digit alignment means, and the addition / subtraction means are used for mantissa processing, respectively. In other words, the digit alignment addition / subtraction processing involving rounding of two mantissas in the case of addition / subtraction and the rounding addition processing to the required number of bits of the product or quotient in the case of multiplication / division are performed by the same digit alignment means and addition / subtraction means. Be seen.

【0018】上記本発明に係る指数演算装置によれば、
加減算の場合には指数差の絶対値が、乗算の場合にはI
EEE754規格に適合した積指数が、除算の場合には
IEEE754規格に適合した商指数がそれぞれ得られ
る。
According to the exponential calculation device of the present invention,
In the case of addition and subtraction, the absolute value of the exponent difference is calculated, and in the case of multiplication, I
A product index conforming to the IEEE754 standard and a quotient exponent conforming to the IEEE754 standard are obtained in the case of division, respectively.

【0019】[0019]

【実施例】以下、本発明の実施例について図面を参照し
ながら説明する。
Embodiments of the present invention will be described below with reference to the drawings.

【0020】(実施例1)図1は、本発明の第1の実施
例に係る浮動小数点算術演算装置の構成図である。図1
において、11は第1の指数演算装置で、これは、加減
算では2つの指数入力Ex,Eyの指数差の絶対値を求
めるとともに、演算結果から仮数の入換えを行うか否か
を決定するスワップ信号SWを生成し、指数差の絶対値
を右シフト量RSAとして出力し、乗算ではEx,Ey
の積指数Ezを、除算ではEx,Eyの商指数Ezをそ
れぞれ求めるものである。12は第1の指数演算装置1
1における演算結果Ez及び指数入力Ex,Eyの3つ
のうちから1つを選択する指数セレクタである。13は
指数セレクタ12の出力と定数との加減算を行う第2の
指数演算装置である。
(Embodiment 1) FIG. 1 is a block diagram of a floating point arithmetic operation unit according to a first embodiment of the present invention. FIG.
In FIG. 11, 11 is a first exponential arithmetic unit, which is a swap that determines the absolute value of the exponential difference between two exponent inputs Ex and Ey in addition and subtraction, and determines whether to replace the mantissa from the arithmetic result. The signal SW is generated, the absolute value of the exponential difference is output as the right shift amount RSA, and Ex and Ey are used for multiplication.
And the quotient index Ez of Ex and Ey are obtained by division. 12 is the first exponential arithmetic unit 1
It is an exponent selector that selects one of the three operation results Ez and the exponent inputs Ex and Ey in 1. Reference numeral 13 is a second exponent arithmetic unit for adding and subtracting the output of the exponent selector 12 and a constant.

【0021】15は第1の指数演算装置11で生成され
たスワップ信号SWに従い、X,Yの2つの入力をA=
X,B=Y又はA=Y,B=Xとして出力するスワッパ
である。16は第1の指数演算装置11から出力される
右シフト量RSAに基づき、スワッパ15のB側の出力
を右シフトするとともに、丸め用のビットを生成する右
シフタである。24は2つの仮数入力Mx,Myについ
て乗算を行い、中間和S及び桁上げCを出力する乗算器
である。17はスワッパ15のA側の出力と乗算器24
の出力Sとのどちらか一方を選択する第1の仮数セレク
タである。18は右シフタ16の出力と乗算器24の出
力Cとのどちらか一方を選択する第2の仮数セレクタで
ある。19は演算の種類に応じて、第1の仮数セレクタ
17の出力を右シフトした結果を出力したり、第1の仮
数セレクタ17の出力をそのまま出力したりする1ビッ
ト右シフタである。同様に、20は第2の仮数セレクタ
18の出力を右シフトした結果を出力したり、第2の仮
数セレクタ18の出力をそのまま出力したりする1ビッ
ト右シフタである。21は1ビット右シフタ19,20
の出力に対して加減算及び丸めを行う加減算器である。
22は、加減算器21の出力の中の最初の“1”の位置
を検出することで先行する“0”の数を求め、これを左
シフト量LSAとして出力するプライオリティ・エンコ
ーダである。23は左シフト量LSAに基づき加減算器
21の出力を左シフトする左シフタである。14は第2
の指数演算装置13の出力からプライオリティ・エンコ
ーダ22で得られた左シフト量LSAを減じる第3の指
数演算装置である。
Reference numeral 15 denotes two inputs of X and Y in accordance with the swap signal SW generated by the first exponential arithmetic unit 11, where A =
A swapper that outputs as X, B = Y or A = Y, B = X. Reference numeral 16 is a right shifter that shifts the output on the B side of the swapper 15 to the right based on the right shift amount RSA output from the first exponent arithmetic unit 11 and generates a rounding bit. Reference numeral 24 is a multiplier that performs multiplication on two mantissa inputs Mx and My and outputs an intermediate sum S and a carry C. 17 is an output on the A side of the swapper 15 and a multiplier 24
It is a first mantissa selector which selects one of the output S and the output S. A second mantissa selector 18 selects either the output of the right shifter 16 or the output C of the multiplier 24. Reference numeral 19 is a 1-bit right shifter that outputs the result of right-shifting the output of the first mantissa selector 17 or outputs the output of the first mantissa selector 17 as it is according to the type of operation. Similarly, 20 is a 1-bit right shifter that outputs the result of right shifting the output of the second mantissa selector 18 or outputs the output of the second mantissa selector 18 as it is. 21 is a 1-bit right shifter 19, 20
Is an adder / subtractor that performs addition / subtraction and rounding on the output of.
Reference numeral 22 is a priority encoder that detects the number of leading "0" s by detecting the position of the first "1" in the output of the adder / subtractor 21 and outputs this as the left shift amount LSA. Reference numeral 23 is a left shifter that shifts the output of the adder / subtractor 21 to the left based on the left shift amount LSA. 14 is the second
It is a third exponential arithmetic unit for subtracting the left shift amount LSA obtained by the priority encoder 22 from the output of the exponential arithmetic unit 13.

【0022】以上のように構成された浮動小数点算術演
算装置についての動作を説明する。浮動小数点加減算を
行う場合には、まず、指数差を求め、小さい方の指数を
持つ仮数をこの指数差だけ右シフトして桁合せを行う必
要がある。
The operation of the floating point arithmetic unit having the above structure will be described. When performing floating-point addition / subtraction, it is necessary to first find the exponent difference and right-shift the mantissa having the smaller exponent by this exponent difference to perform digit alignment.

【0023】このために、第1の指数演算装置11にお
いて指数差(Ex−Ey)が演算され、その絶対値を右
シフト量RSAとして求める。一方、2つの指数Ex,
Eyの大小はEx−Eyの演算において最上位ビットか
ら生じるボローがあるか否かで判断でき、ボローがあれ
ばEx−Ey<0すなわちEx<Eyであるので、この
ボローをスワップ信号SWとして出力する。また、指数
セレクタ12では、ボローの値に従ってEx,Eyの指
数のうち大きい方を第2の指数演算装置13に出力す
る。
For this purpose, the first exponent arithmetic unit 11 calculates the exponent difference (Ex-Ey), and the absolute value thereof is obtained as the right shift amount RSA. On the other hand, the two indices Ex,
The magnitude of Ey can be determined by whether or not there is a borrow generated from the most significant bit in the operation of Ex-Ey. If there is a borrow, Ex-Ey <0, that is, Ex <Ey, so this borrow is output as a swap signal SW. To do. Further, the exponent selector 12 outputs the larger one of the indices of Ex and Ey to the second exponent arithmetic unit 13 according to the borrow value.

【0024】更に、2つの仮数Mx,Myはスワッパ1
5に入力され、スワップ信号SWがSW=1すなわちE
x<EyであればA=My,B=Mxとし、またスワッ
プ信号SWがSW=0すなわちEx≧EyであればA=
Mx,B=Myとしてそれぞれ出力する。このことによ
り、小さい方の指数を持つオペランドの仮数が常に右シ
フタ16に入力される。右シフタ16では、スワッパ1
5のB側の出力を右シフト量RSAに従って右シフト
し、第2の仮数セレクタ18に出力する。この動作によ
って仮数の桁合せが完了する。以上のように桁合せされ
た仮数を演算するために、第1の仮数セレクタ17はス
ワッパ15のA側の出力を選択して1ビット右シフタ1
9に出力し、第2の仮数セレクタ18は右シフタ16の
出力を選択して1ビット右シフタ20に出力する。
Further, the two mantissas Mx and My are the swapper 1
5, the swap signal SW is SW = 1, that is, E
If x <Ey, A = My and B = Mx, and if the swap signal SW is SW = 0, that is, Ex ≧ Ey, A = My.
Output as Mx and B = My respectively. As a result, the mantissa of the operand having the smaller exponent is always input to the right shifter 16. In the right shifter 16, the swapper 1
The output on the B side of 5 is right-shifted according to the right-shift amount RSA and is output to the second mantissa selector 18. This operation completes the digit alignment of the mantissa. In order to calculate the digit-matched mantissa as described above, the first mantissa selector 17 selects the output on the A side of the swapper 15 to select the 1-bit right shifter 1
Then, the second mantissa selector 18 selects the output of the right shifter 16 and outputs it to the 1-bit right shifter 20.

【0025】次に、桁合せして得られた仮数について加
減算及び丸めを行うが、IEEE754規格に規定され
る丸めを実現するには、丸め用のビットが少なくとも2
ビット必要になる。このうち下位側の1ビットは、ステ
ィッキー・ビットと呼ばれ、この桁から下の桁全てが0
であるか否かを表すものである。
Next, addition and subtraction and rounding are performed on the mantissa obtained by aligning the digits. To realize rounding defined by the IEEE754 standard, at least two rounding bits are required.
Bit needed. Of these, the lower 1 bit is called the sticky bit, and all digits below this digit are 0.
Or not.

【0026】ところで、丸め用の2ビットを上位側から
r,sとすると、丸め前の演算結果は以下の3通りにな
る。ここで、「*」は“1”又は“0”を示す。
By the way, assuming that the two bits for rounding are r and s from the upper side, there are the following three calculation results before rounding. Here, “*” indicates “1” or “0”.

【0027】 (a) 1*.***…*rs (b) 1.***…**rs (c) 0.***…***rs(A) 1 *. *** ... * rs (b) 1. *** ... ** rs (c) 0. *** ... *** rs

【0028】丸めによる桁上げは上述したrの位置から
上位側に発生するので、このままでは桁上げ位置を3通
り用意しなければならない。しかし、加減算において
は、同符号の浮動小数点数について加算を行うかあるい
は異符号の浮動小数点数について減算を行う場合(以下
簡単のために、仮数に桁上げが生じる場合と呼ぶ)は、
結果は(a),(b)のどちらかにしかならず、またこ
れ以外の場合は(b),(c)のどちらかにしかならな
い。本実施例では、仮数に桁上げが生じる場合は1ビッ
ト右シフタ19,20で入力を右へ1ビットシフトし、
加減算器21に出力する。また仮数に桁上げが生じない
場合は、1ビット右シフタ19,20でシフトを行わ
ず、入力をそのまま加減算器21に出力する。このよう
に1ビット右シフタ19,20によって仮数に桁上げが
ある場合でも(b),(c)として扱うことができ、丸
めの桁上げ位置を2通りに減少させることができる。1
ビット右シフタ19,20でシフトが行われた場合は、
指数を補正する必要があるので、第2の指数演算装置1
3では、入力に1を加えた結果を第3の指数演算装置1
4に出力する。これ以外の場合は、指数の補正の必要は
ないので、第2の指数演算装置13では、入力をそのま
ま第3の指数演算装置14に出力する。
Since the carry by rounding occurs from the position of r to the higher order side, it is necessary to prepare three carry positions as it is. However, in addition and subtraction, if addition is performed for floating-point numbers with the same sign or subtraction is performed for floating-point numbers with different signs (hereinafter, for the sake of simplicity, it is called the case where a mantissa is carried),
The result is only one of (a) and (b), and in the other cases, only one of (b) and (c). In this embodiment, when a carry is generated in the mantissa, the 1-bit right shifters 19 and 20 shift the input to the right by 1 bit,
Output to the adder / subtractor 21. If no carry is generated in the mantissa, the 1-bit right shifters 19 and 20 do not shift and the input is output as it is to the adder / subtractor 21. Thus, even if the mantissa has a carry by the 1-bit right shifters 19 and 20, it can be treated as (b) and (c), and the rounding carry position can be reduced in two ways. 1
When shifting is performed by the bit right shifters 19 and 20,
Since it is necessary to correct the exponent, the second exponent arithmetic unit 1
In 3, the result of adding 1 to the input is the result of the third exponentiation unit 1
4 is output. In other cases, there is no need to correct the exponent, so the second exponent arithmetic unit 13 outputs the input to the third exponent arithmetic unit 14 as it is.

【0029】こうして得られた1ビット右シフタ19,
20の出力を加減算器21に入力し、加減算と丸めを行
い、加減算結果をプライオリティ・エンコーダ22及び
左シフタ23に出力する。
The 1-bit right shifter 19 thus obtained,
The output of 20 is input to the adder / subtractor 21, which performs addition / subtraction and rounding, and outputs the addition / subtraction result to the priority encoder 22 and the left shifter 23.

【0030】本実施例では、右シフタ16でシフトが行
われる際に丸めのためのスティッキー・ビットsを生成
するが、この時、(b)のsの位置を下位に1ビットず
らすことで、sの位置を(c)と共通にし、右シフタ1
6のハードウェア量を減らしている。sの位置をずらす
ことで増加する丸めビットをgとすると、丸め前の演算
結果が(b)及び(c)となる時の仮数の組合せは、そ
れぞれ図2(a)及び図2(b)のとおりである。ここ
で、x,yは“1”又は“0”を示す。
In this embodiment, the sticky bit s for rounding is generated when the right shifter 16 shifts. At this time, the position of s in (b) is shifted to the lower one bit, The position of s is the same as that of (c), and the right shifter 1
We are reducing the amount of hardware in 6. If the rounding bit that increases by shifting the position of s is g, the combinations of mantissas when the operation results before rounding are (b) and (c) are as shown in FIGS. 2 (a) and 2 (b), respectively. It is as follows. Here, x and y indicate "1" or "0".

【0031】さて、加減算器21では、加減算と丸めは
以下のように実現される。2つの入力に対して図2
(a)のgより上位の桁について加減算を行い、最下位
桁からの桁上げがあった場合の演算結果Z1と、桁上げ
がなかった場合の演算結果Z0の両方を用意する。一
方、g以下の桁に対して、図2(a)及び図2(b)の
それぞれの場合のgの桁からの桁上げCgb,Cgcを
演算する。図2(a)の場合はgrsによる丸めの桁上
げがCgbとなるが、図2(b)の場合はrsによる丸
めの桁上げとgの桁の値とによってCgcが決定する。
加減算器21の出力は、演算結果Z1,Z0の最上位桁
の値と、桁上げCgb,Cgcと、仮数に対して加算が
行われたか減算が行われたかとによって、gより上位の
桁についてはZ1,Z0のどちらかとなり、gの桁は演
算結果か0のどちらかとなる。以上のようにして、加減
算と丸めとを1つの加減算器21で実現する。
In the adder / subtractor 21, addition and subtraction and rounding are realized as follows. Figure 2 for two inputs
Addition / subtraction is performed for digits higher than g in (a), and both the operation result Z1 when there is a carry from the lowest digit and the operation result Z0 when there is no carry are prepared. On the other hand, for digits less than or equal to g, carry Cgb, Cgc from the digit of g in each case of FIGS. 2A and 2B is calculated. In the case of FIG. 2A, the rounding carry by grs is Cgb, but in the case of FIG. 2B, Cgc is determined by the rounding carry by rs and the value of g.
The output of the adder / subtractor 21 is for digits higher than g depending on the value of the most significant digit of the operation results Z1, Z0, carry Cgb, Cgc, and whether addition or subtraction is performed on the mantissa. Is either Z1 or Z0, and the digit of g is either the operation result or 0. As described above, addition and subtraction and rounding are realized by one adder / subtractor 21.

【0032】プライオリティ・エンコーダ22では、入
力について最初の“1”の位置を検出するが、これはす
なわち先行する“0”の数を求めることであり、これに
よって加減算器21の加減算結果を正規化するための左
シフト量LSAを得る。左シフタ23では、プライオリ
ティ・エンコーダ22の出力である左シフト量LSAに
従って加減算器21の出力を左シフトし、正規化された
仮数を出力する。第3の指数演算装置14は、第2の指
数演算装置13の出力からプライオリティ・エンコーダ
22の出力である左シフト量LSAを減じることで、指
数を補正して出力する。以上のような動作によって浮動
小数点加減算が実行できる。
The priority encoder 22 detects the position of the first "1" in the input, that is, to find the number of leading "0" s, and thereby the addition / subtraction result of the adder / subtractor 21 is normalized. To obtain the left shift amount LSA. The left shifter 23 shifts the output of the adder / subtractor 21 to the left according to the left shift amount LSA output from the priority encoder 22, and outputs a normalized mantissa. The third exponent arithmetic unit 14 corrects the exponent by subtracting the left shift amount LSA, which is the output of the priority encoder 22, from the output of the second exponent arithmetic unit 13, and outputs the corrected exponent. Floating point addition / subtraction can be executed by the above operation.

【0033】次に、浮動小数点乗算を行う場合の動作を
説明する。浮動小数点乗算を行う場合は、まず、第1の
指数演算装置11においてEx,Eyの積指数Ezを求
める。求められた積指数Ezは指数セレクタ12で選択
され、第2の指数演算装置13に入力される。仮数M
x,Myは乗算器24で乗算され、乗算結果を中間和S
及び桁上げCの形で出力する。第1の仮数セレクタ17
は中間和Sを選択して1ビット右シフタ19に出力し、
第2の仮数セレクタ18は桁上げCを選択して1ビット
右シフタ20に出力する。
Next, the operation when performing floating point multiplication will be described. When performing floating-point multiplication, first, the first exponent arithmetic unit 11 obtains the product exponent Ez of Ex and Ey. The product index Ez thus obtained is selected by the index selector 12 and input to the second index calculator 13. Mantissa M
x and My are multiplied by the multiplier 24, and the multiplication result is the intermediate sum S.
And carry C are output. First mantissa selector 17
Selects the intermediate sum S and outputs it to the 1-bit right shifter 19,
The second mantissa selector 18 selects the carry C and outputs it to the 1-bit right shifter 20.

【0034】浮動小数点乗算では、丸める前の加算結果
が常に(a),(b)のどちらかであるために、1ビッ
ト右シフタ19,20で入力を右へ1ビットシフトす
る。1ビット右シフタ19,20の出力は加減算器21
で加算され、丸めて仮数の乗算結果を得る。以降、プラ
イオリティ・エンコーダ22、左シフタ23及び第3の
指数演算装置14における動作は前記した浮動小数点加
減算を行う場合と同じである。
In the floating-point multiplication, the addition result before rounding is always either (a) or (b), so the 1-bit right shifters 19 and 20 shift the input to the right by 1 bit. The outputs of the 1-bit right shifters 19 and 20 are adder / subtractor 21.
Are added and rounded to obtain the mantissa multiplication result. After that, the operations of the priority encoder 22, the left shifter 23, and the third exponent arithmetic unit 14 are the same as the above-mentioned floating point addition / subtraction.

【0035】一方、第1の指数演算装置11では、指数
のバイアスをBとして積指数Ez=Ex+Ey−Bを得
て、指数セレクタ12に出力する。指数セレクタ12は
第1の指数演算装置11の出力を選択し、第2の指数演
算装置13に入力する。1ビット右シフタ19,20に
おいてシフトが行われたので、第2の指数演算装置13
では、入力に1を加えた結果を第3の指数演算装置14
に出力する。第3の指数演算装置14における動作は前
記した浮動小数点加減算を行う場合と同じである。以上
のようにして浮動小数点乗算が実行できる。
On the other hand, the first exponent arithmetic unit 11 obtains the product exponent Ez = Ex + Ey-B with the exponent bias being B, and outputs it to the exponent selector 12. The exponent selector 12 selects the output of the first exponent arithmetic unit 11 and inputs it to the second exponent arithmetic unit 13. Since the shift has been performed in the 1-bit right shifters 19 and 20, the second exponent arithmetic unit 13
Then, the result obtained by adding 1 to the input is the third exponential arithmetic unit 14
Output to. The operation of the third exponent arithmetic unit 14 is the same as the above-mentioned floating point addition / subtraction. Floating point multiplication can be executed as described above.

【0036】次に、浮動小数点除算を行う場合の動作を
説明する。Yの仮数の逆数を格納したROM(Read Onl
y Memory)を用いてX/Yの除算を行う。いま、Xの指
数及び仮数をそれぞれXe,Xfとし、Yの指数及び仮
数をそれぞれYe,Yfとする。まず、仮数Yfの逆数
を不図示のROMから読出し、図1のMyとして乗算器
24に入力する。一方、仮数Xfを図1のMxとして乗
算器24に入力し、乗算結果Mx・My=Xf/Yfを
中間和S及び桁上げCとして得る。第1の仮数セレクタ
17は中間和Sを選択して1ビット右シフタ19に出力
し、第2の仮数セレクタ18は桁上げCを選択して1ビ
ット右シフタ20に出力する。
Next, the operation when performing floating point division will be described. ROM (Read Onl) that stores the reciprocal of the mantissa of Y
y Memory) is used to perform X / Y division. Now, let the exponent and mantissa of X be Xe and Xf, and the exponent and mantissa of Y be Ye and Yf, respectively. First, the reciprocal of the mantissa Yf is read from the ROM (not shown) and input to the multiplier 24 as My in FIG. On the other hand, the mantissa Xf is input to the multiplier 24 as Mx in FIG. 1, and the multiplication result Mx · My = Xf / Yf is obtained as the intermediate sum S and the carry C. The first mantissa selector 17 selects the intermediate sum S and outputs it to the 1-bit right shifter 19, and the second mantissa selector 18 selects the carry C and outputs it to the 1-bit right shifter 20.

【0037】浮動小数点除算では、丸める前の加算結果
が常に(b),(c)のどちらかであるために、1ビッ
ト右シフタ19,20は入力をそのまま加減算器21に
出力する。1ビット右シフタ19,20の出力は加減算
器21で加算され、丸めて仮数の除算結果を得る。以
降、プライオリティ・エンコーダ22、左シフタ23に
おける動作は前記した浮動小数点加減算を行う場合と同
じである。
In floating-point division, the addition result before rounding is always either (b) or (c), so the 1-bit right shifters 19 and 20 output their inputs to the adder / subtractor 21 as they are. The outputs of the 1-bit right shifters 19 and 20 are added by an adder / subtractor 21 and rounded to obtain a mantissa division result. After that, the operations of the priority encoder 22 and the left shifter 23 are the same as those in the case of performing the floating point addition / subtraction described above.

【0038】一方、指数Xe,Yeをそれぞれ図1のE
x,Eyとして第1の指数演算装置11に入力する。第
1の指数演算装置11では、指数のバイアスをBとして
商指数Ez=Ex−Ey+Bを得て、指数セレクタ12
に出力する。指数セレクタ12は第1の指数演算装置1
1の出力を選択し、第2の指数演算装置13に入力す
る。1ビット右シフタ19,20においてシフトが行わ
れないので、第2の指数演算装置13では入力をそのま
ま第3の指数演算装置14に出力する。第3の指数演算
装置14における動作は前記した浮動小数点加減算を行
う場合と同じである。以上のようにして、浮動小数点除
算が実行できる。
On the other hand, the indices Xe and Ye are respectively represented by E in FIG.
It is input to the first exponent arithmetic unit 11 as x and Ey. In the first exponent arithmetic unit 11, the exponent bias is set to B, the quotient exponent Ez = Ex−Ey + B is obtained, and the exponent selector 12
Output to. The exponent selector 12 is the first exponent arithmetic unit 1
The output of 1 is selected and input to the second exponent arithmetic unit 13. Since no shift is performed in the 1-bit right shifters 19 and 20, the second exponent arithmetic unit 13 outputs the input to the third exponent arithmetic unit 14 as it is. The operation of the third exponent arithmetic unit 14 is the same as the above-mentioned floating point addition / subtraction. As described above, the floating point division can be executed.

【0039】以上のように本実施例によれば、スワッパ
15と右シフタ16とで構成される桁合せ手段の出力と
乗算器24の出力とを、第1及び第2の仮数セレクタ1
7,18で演算の種類に応じて選択することにより、加
減算及び乗除算で加減算器21を共用することができ
る。また、1ビット右シフタ19,20を設けることに
より、仮数の桁上がりに対する指数の補正を仮数の加減
算と並列に行うことができ、処理を高速に行うことが可
能になる。
As described above, according to the present embodiment, the output of the digit matching means constituted by the swapper 15 and the right shifter 16 and the output of the multiplier 24 are set to the first and second mantissa selectors 1.
It is possible to share the adder / subtractor 21 for addition / subtraction and multiplication / division by selecting 7 or 18 according to the type of operation. Further, by providing the 1-bit right shifters 19 and 20, the exponent correction for the carry of the mantissa can be performed in parallel with the addition and subtraction of the mantissa, and the processing can be performed at high speed.

【0040】なお、本実施例では、乗算器24の出力を
中間和S及び桁上げCの形の中間値として加減算器21
で加算したが、冗長2進数を使用した乗算器が出力する
ように乗算結果を正数及び負数の中間値とし、加減算器
21で正数から負数を減じる演算を行っても良い。
In this embodiment, the output of the multiplier 24 is used as an intermediate value in the form of the intermediate sum S and the carry C, and the adder / subtractor 21
However, the multiplication result may be an intermediate value between the positive number and the negative number so that the multiplier using the redundant binary number outputs, and the adder / subtractor 21 may perform the operation of subtracting the negative number from the positive number.

【0041】また、指数セレクタ12と第2の指数演算
装置13との間、及び第2の指数演算装置13と第3の
指数演算装置14との間にそれぞれ指数レジスタを挿入
し、また第1の仮数セレクタ17と1ビット右シフタ1
9との間、第2の仮数セレクタ18と1ビット右シフタ
20との間、及び加減算器21とプライオリティ・エン
コーダ22との間にそれぞれ仮数レジスタを挿入すれ
ば、パイプライン化された浮動小数点算術演算装置が実
現できる。これによれば、1演算命令の実行中では各パ
イプラインステージに割り当てられた回路ブロックをそ
れぞれ1回しか使用しないので、パイプライン制御方式
のメリットを十分に引き出した高速処理が可能となる。
An exponent register is inserted between the exponent selector 12 and the second exponent arithmetic unit 13, and between the second exponent arithmetic unit 13 and the third exponent arithmetic unit 14, respectively. Mantissa selector 17 and 1-bit right shifter 1
9 and between the second mantissa selector 18 and the 1-bit right shifter 20, and between the adder / subtractor 21 and the priority encoder 22, respectively, pipeline floating-point arithmetic An arithmetic unit can be realized. According to this, since the circuit block assigned to each pipeline stage is used only once during the execution of one arithmetic instruction, it is possible to perform high-speed processing that brings out the full advantage of the pipeline control method.

【0042】(実施例2)図3は、本発明の第2の実施
例に係る浮動小数点算術演算装置の構成図である。図3
において、図1と同じ機能を有するものには同じ符号を
付してその詳細な説明を省略し、図1と異なる機能を有
するものについてのみ説明する。
(Embodiment 2) FIG. 3 is a block diagram of a floating point arithmetic operation unit according to a second embodiment of the present invention. FIG.
1 having the same functions as those in FIG. 1 are denoted by the same reference numerals and detailed description thereof will be omitted, and only those having functions different from those in FIG. 1 will be described.

【0043】25は仮数Mx,Myの乗算を行い、結果
を(n+m)ビットで出力する乗算器である。26は仮
数Mxと乗算器25の出力の上位nビットとのうちのど
ちらか一方を選択する第1の仮数セレクタである。27
は仮数Myと乗算器25の出力の下位mビットとのうち
のどちらか一方を選択する第2の仮数セレクタである。
28は論理ゲートで、制御信号SWEに従って、第1の
指数演算装置11から出力されるスワップ信号SWを0
にして出力したり、スワップ信号SWをそのまま出力し
たりするものである。29は第1の指数演算装置11か
ら出力される右シフト量ERSAと不図示の制御部が決
定する右シフト量CRSAとのうちのどちらか一方を選
択して右シフト量RSAとするシフト量セレクタであ
る。
Reference numeral 25 is a multiplier for multiplying the mantissas Mx and My and outputting the result in (n + m) bits. Reference numeral 26 is a first mantissa selector that selects either the mantissa Mx or the upper n bits of the output of the multiplier 25. 27
Is a second mantissa selector that selects either the mantissa My or the lower m bits of the output of the multiplier 25.
Reference numeral 28 denotes a logic gate, which sets the swap signal SW output from the first exponent arithmetic unit 11 to 0 according to the control signal SWE.
And the swap signal SW is output as it is. Reference numeral 29 is a shift amount selector that selects either the right shift amount ERSA output from the first exponential arithmetic unit 11 or the right shift amount CRSA determined by a control unit (not shown) as the right shift amount RSA. Is.

【0044】以上のように構成された浮動小数点算術演
算装置についての動作を説明するが、基本的な動作は第
1の実施例と殆ど同じであるので、第1の実施例と動作
が異なる部分について説明を行う。
The operation of the floating-point arithmetic operation unit having the above-mentioned configuration will be described. Since the basic operation is almost the same as that of the first embodiment, the operation is different from that of the first embodiment. Will be described.

【0045】浮動小数点加減算を行う場合は、第1の仮
数セレクタ26で仮数Mxを選択してスワッパ15のX
側の入力に出力し、第2の仮数セレクタ27で仮数My
を選択してスワッパ15のY側の入力に出力する。論理
ゲート28では第1の指数演算装置11から出力された
スワップ信号SWがそのまま出力される。スワッパ15
は論理ゲート28の出力を新たにスワップ信号とし、第
1の実施例で説明した動作を行う。シフト量セレクタ2
9は第1の指数演算装置11から出力される右シフト量
ERSAを選択して右シフト量RSAとし、右シフタ1
6に出力する。右シフタ16は第1の実施例で説明した
動作を行う。スワッパ15のA側の出力は1ビット右シ
フタ19に入力され、右シフタ16の出力は1ビット右
シフタ20に入力される。以上で説明したもの以外の構
成要素は、第1の実施例に説明した動作を行い、浮動小
数点加減算を実行する。
When performing floating point addition / subtraction, the mantissa Mx is selected by the first mantissa selector 26 and X of the swapper 15 is selected.
The second mantissa selector 27 outputs the mantissa My.
Is output to the input on the Y side of the swapper 15. The swap signal SW output from the first exponential arithmetic unit 11 is output to the logic gate 28 as it is. Swapper 15
Uses the output of the logic gate 28 as a new swap signal to perform the operation described in the first embodiment. Shift amount selector 2
Reference numeral 9 designates the right shift amount ERSA output from the first exponent arithmetic unit 11 to be the right shift amount RSA, and the right shifter 1
6 is output. The right shifter 16 performs the operation described in the first embodiment. The output on the A side of the swapper 15 is input to the 1-bit right shifter 19, and the output of the right shifter 16 is input to the 1-bit right shifter 20. The components other than those described above perform the operations described in the first embodiment and execute floating point addition / subtraction.

【0046】一方、浮動小数点乗算を行う場合は、乗算
器25で仮数Mx,Myの乗算が行われ、その結果を
(n+m)ビットで出力する。この場合の浮動小数点乗
算においては、乗算器25の演算結果のうち、上位nビ
ットのみが有効な数となり、下位mビットは丸め用ビッ
トを生成するために使用されるので、第1の仮数セレク
タ26では乗算器25の乗算結果の上位nビットを選択
してスワッパ15のX側に出力し、第2の仮数セレクタ
27では乗算器25の乗算結果の下位mビットを選択し
てスワッパ15のY側に出力する。論理ゲート28では
スワップ信号SWを0として出力する。スワッパ15は
論理ゲート28の出力を新たにスワップ信号とし、第1
の実施例で説明した動作を行う。シフト量セレクタ29
は不図示の制御部が決定する右シフト量CRSAを選択
して右シフト量RSAとし、右シフタ16に出力する。
右シフタ16は右シフト量RSAに従ってスワッパ15
のB側の出力を右シフトする。このとき、右シフト量C
RSAはmであり、乗算結果の下位mビットをmビット
だけ右シフトすることで、丸め用ビットが生成される。
加減算器21では1ビット右シフタ19,20の出力を
加算することにより、乗算器25の出力の上位nビット
に右シフタ16で生成された丸め用ビットを付加し、こ
れを丸めてnビットの乗算結果を得る。以上説明したも
の以外の構成要素は、第1の実施例に説明した動作を行
い、浮動小数点乗算を実行する。なお、浮動小数点除算
時の動作説明は省略する。
On the other hand, when performing floating point multiplication, the multiplier 25 multiplies the mantissas Mx and My and outputs the result in (n + m) bits. In the floating-point multiplication in this case, only the upper n bits of the operation result of the multiplier 25 are valid numbers, and the lower m bits are used to generate the rounding bit. Therefore, the first mantissa selector In 26, the upper n bits of the multiplication result of the multiplier 25 are selected and output to the X side of the swapper 15, and in the second mantissa selector 27, the lower m bits of the multiplication result of the multiplier 25 are selected and Y of the swapper 15 is selected. Output to the side. The logic gate 28 outputs the swap signal SW as 0. The swapper 15 newly uses the output of the logic gate 28 as a swap signal,
The operation described in the embodiment is performed. Shift amount selector 29
Selects a right shift amount CRSA determined by a control unit (not shown) as a right shift amount RSA and outputs the right shift amount RSA to the right shifter 16.
The right shifter 16 moves the swapper 15 according to the right shift amount RSA.
The output on the B side of is right-shifted. At this time, the right shift amount C
RSA is m, and the lower m bits of the multiplication result are right-shifted by m bits to generate a rounding bit.
The adder / subtractor 21 adds the outputs of the 1-bit right shifters 19 and 20 to add the rounding bits generated by the right shifter 16 to the upper n bits of the output of the multiplier 25, and rounds the n-bit rounded bits. Get the multiplication result. The components other than those described above perform the operation described in the first embodiment and execute the floating point multiplication. The description of the operation during floating point division is omitted.

【0047】図4は、図1及び図3の中の第1の指数演
算装置11の内部構成を示す。図4において、53は2
つの入力IA,IBを減算する(n+1)ビットの減算
器であり、減算結果P=IA−IB及びQ=IA−(I
B+1)を出力する。51.1は制御信号CS1に従っ
て入力を反転する1ビット反転器、52は制御信号CS
3によって0を出力したり、1ビット反転器51.1の
出力をそのまま出力したりする論理ゲートである。論理
ゲート52の出力は減算器53の減数側IBの最上位ビ
ットとなり、1ビット反転器51.1の出力は減算器5
3の減数側IBの最上位から2番目のビットとなる。5
1.2〜51.nはそれぞれ制御信号CS2に従って入
力を反転する(n−1)個の1ビット反転器であり、減
算器53の減数側IBの下位(n−1)ビットには、1
ビット反転器51.2〜51.nの出力がそれぞれ接続
されている。54は減算器53のQ出力を反転して出力
する(n+1)ビットの反転器である。55は減算器5
3のQ出力、P出力及び反転器54の出力のうちから1
つを選択する出力セレクタである。
FIG. 4 shows the internal structure of the first exponent arithmetic unit 11 in FIGS. 1 and 3. In FIG. 4, 53 is 2
It is a (n + 1) -bit subtracter that subtracts two inputs IA and IB, and subtraction results P = IA-IB and Q = IA- (I
B + 1) is output. 51.1 is a 1-bit inverter for inverting the input according to the control signal CS1, 52 is the control signal CS
It is a logic gate that outputs 0 by 3 or outputs the output of the 1-bit inverter 51.1 as it is. The output of the logic gate 52 becomes the most significant bit of the subtraction side IB of the subtractor 53, and the output of the 1-bit inverter 51.1 is the subtractor 5
It is the second bit from the most significant bit of the IB of 3 on the reduction side. 5
1.2-51. Each n is a (n-1) 1-bit inverter whose input is inverted according to the control signal CS2, and the lower (n-1) bit of the subtraction side IB of the subtractor 53 has 1
Bit inverters 51.2 to 51. The n outputs are connected together. Reference numeral 54 is an (n + 1) -bit inverter that inverts and outputs the Q output of the subtractor 53. 55 is a subtractor 5
1 out of 3 Q output, P output and inverter 54 output
It is an output selector that selects one.

【0048】以上のように構成された指数演算装置は、
以下のように動作して、加算、減算、乗算及び除算時の
指数の演算を行う。減算器53の被減数IAは第1の指
数入力X(Ex)であり、n個の1ビット反転器51.
1〜51.nの入力は第2の指数入力Y(Ey)であ
る。
The exponential arithmetic unit configured as described above is
The following operations are performed to calculate exponents during addition, subtraction, multiplication and division. The minuend IA of the subtractor 53 is the first exponential input X (Ex), and the n 1-bit inverters 51.
1-51. The input of n is the second exponential input Y (Ey).

【0049】まず、積指数X+Y−Bは、第2の指数Y
のビット反転データyを用いて、 X+Y−B=X−(B−Y) =X−(B+y+1) …(4) と表せ、 Y=Yn-1 (n-1) +Yn-2 (n-2) +…+Y1 1 +Y0 0 …(5) とすると、 y=yn-1 (n-1) +yn-2 (n-2) +…+y1 1 +y0 0 …(6) と表せる。したがって、式(6)とB=2(n-1) −1と
から、 B+y+1=2(n-1) −1+y+1 =2(n-1) +y =2n +(yn-1 +1)2(n-1) +yn-2 (n-2) +…+y0 0 …(7) と表現することができる。
First, the product index X + Y-B is the second index Y.
Using the bit inversion data y of the above, it can be expressed as X + Y−B = X− (B−Y) = X− (B + y + 1) (4), and Y = Y n−1 2 (n−1) + Y n−2 2 (n-2) + ... + Y 1 2 1 + Y 0 2 0 ... (5), y = y n-1 2 (n-1) + y n-2 2 (n-2) + ... + y 1 2 1 It can be expressed as + y 0 2 0 (6). Therefore, from the formula (6) and B = 2 (n-1) -1, from B + y + 1 = 2 (n-1) -1 + y + 1 = 2 (n-1) + y = 2 n + (y n-1 +1) 2 It can be expressed as (n-1) + y n-2 2 (n-2) + ... + y 0 2 0 (7).

【0050】ここで、yn-1 =0(Yn-1 =1)とする
と、式(7)より、 B+y+1=2n +2(n-1) +yn-2 (n-2) +…+y0 0 …(8) となる。また、yn-1 =1(Yn-1 =0)とすると、式
(7)より、 B+y+1=2n +2n +yn-2 (n-2) +…+y0 0 …(9) となる。yn-1 =1のときはB−Y>0となるので、式
(9)の右辺の第1項及び第2項は無視できる。したが
って、式(8),(9)から、 B+y+1=Yn-1 n +Yn-1 (n-1) +yn-2 (n-2) +…+y0 0 …(10) と表すことができる。
Here, assuming that y n-1 = 0 (Y n-1 = 1), from the equation (7), B + y + 1 = 2 n +2 (n-1) + y n-2 2 (n-2) + … + Y 0 2 0 It becomes (8). Further, assuming that y n-1 = 1 (Y n-1 = 0), according to the equation (7), B + y + 1 = 2 n +2 n + y n-2 2 (n-2) + ... + y 0 2 0 (9 ). Since y 0> 0 when y n−1 = 1, the first and second terms on the right side of the equation (9) can be ignored. Therefore, from equations (8) and (9), B + y + 1 = Y n-1 2 n + Y n-1 2 (n-1) + y n-2 2 (n-2) + ... + y 0 2 0 (10) It can be expressed as.

【0051】一方、商指数X−Y+Bは、バイアスBの
ビット反転データbを用いて、 X−Y+B=X−(Y−B) =X−(Y+b+1) …(11) と表せる。b+1はBの2の補数にあたるので、 b+1=2n +2(n-1) +1 …(12) である。式(5),(12)より、 Y+b+1=Yn-1 (n-1) +Yn-2 (n-2) +…+Y0 0 +2n +2(n-1) +1 =2n +(Yn-1 +1)2(n-1) +Yn-2 (n-2) +…+Y0 0 +1 …(13) と表現できる。
On the other hand, the quotient exponent XY + B can be expressed as XY + B = X- (Y-B) = X- (Y + b + 1) (11) using the bit inversion data b of the bias B. Since b + 1 corresponds to the two's complement of B, b + 1 = 2 n +2 (n-1) +1 (12). Equation (5), from (12), Y + b + 1 = Y n-1 2 (n-1) + Y n-2 2 (n-2) + ... + Y 0 2 0 +2 n +2 (n-1) +1 = 2 n It can be expressed as + (Y n-1 +1) 2 (n-1) + Y n-2 2 (n-2) + ... + Y 0 2 0 +1 (13).

【0052】ここで、Yn-1 =0(yn-1 =1)とする
と、式(13)より、 Y+b+1=2n +2(n-1) +Yn-2 (n-2) +…+Y0 0 +1 …(14) となる。また、Yn-1 =1(yn-1 =0)とすると、式
(13)より、 Y+b+1=2n +2n +Yn-2 (n-2) +…+Y0 0 +1 …(15) となる。Yn-1 =1のときはY−B>0となるので、式
(15)の右辺の第1項及び第2項は無視できる。した
がって、式(14),(15)から、 Y+b+1=yn-1 n +yn-1 (n-1) +Yn-2 (n-2) +…+Y0 0 +1 …(16) と表せる。
Assuming that Y n-1 = 0 (y n-1 = 1), from the equation (13), Y + b + 1 = 2 n +2 (n-1) + Y n-2 2 (n-2) + ... + Y 0 2 0 +1 ... (14). Further, assuming that Y n-1 = 1 (y n-1 = 0), from the equation (13), Y + b + 1 = 2 n +2 n + Y n-2 2 (n-2) + ... + Y 0 2 0 +1 (( 15) When Y n-1 = 1 then Y−B> 0, so the first and second terms on the right side of equation (15) can be ignored. Therefore, from equations (14) and (15), Y + b + 1 = y n-1 2 n + y n-1 2 (n-1) + Y n-2 2 (n-2) + ... + Y 0 2 0 +1 (16) ) Can be expressed as

【0053】式(10)によれば、式(4)中の減数B
+y+1は、第2の指数Yの最上位ビットと同じ値を上
位2ビットとして持ち、かつ第2の指数Yの下位(n−
1)ビットの反転を下位(n−1)ビットとして持つ
(n+1)ビットのデータであることが判る。この減数
B+y+1を第1の指数Xから減じると、積指数X+Y
−Bを得ることができる。
According to equation (10), the subtraction B in equation (4)
+ Y + 1 has the same value as the most significant bit of the second exponent Y as the upper 2 bits, and the lower (n−) of the second exponent Y.
1) It is understood that the data is (n + 1) -bit data having the inversion of bits as the lower (n-1) bits. If this subtraction B + y + 1 is subtracted from the first index X, the product index X + Y
-B can be obtained.

【0054】また、式(16)によれば、式(11)中
の減数Y+b+1は、第2の指数Yの最上位ビットの反
転を上位2ビットとして持ち、かつ第2の指数Yの下位
(n−1)ビットと同じ値を下位(n−1)ビットとし
て持つ(n+1)ビットのデータに1を加えて得られる
データであることが判る。この減数Y+b+1を第1の
指数Xから減じると、商指数X−Y+Bを得ることがで
きる。
According to the equation (16), the subtraction Y + b + 1 in the equation (11) has the inversion of the most significant bit of the second exponent Y as the upper 2 bits, and the lower ( It can be seen that the data is obtained by adding 1 to the (n + 1) -bit data having the same value as the (n-1) -bit as the lower (n-1) bits. Subtracting this subtraction Y + b + 1 from the first index X gives the quotient index XY + B.

【0055】乗算時には、1ビット反転器51.1が反
転動作を行わず、(n−1)個の1ビット反転器51.
2〜51.nが反転動作を行い、かつ論理ゲート52が
1ビット反転器51.1の出力をそのまま出力するよう
に、制御信号CS1,CS2,CS3が供給される。し
たがって、減算器53においてIA=X,IB=B+y
+1となる。この場合の減算結果Pは、 P=IA−IB =X−(B+y+1) …(17) であり、式(4)から減算結果PはX+Y−Bに等しい
ことが判る。出力セレクタ55は、この減算結果Pを積
指数Ezとして選択して出力する。
At the time of multiplication, the 1-bit inverter 51.1 does not perform the inversion operation, and the (n-1) 1-bit inverters 51.
2 to 51. Control signals CS1, CS2 and CS3 are supplied so that n performs an inverting operation and the logic gate 52 outputs the output of the 1-bit inverter 51.1 as it is. Therefore, in the subtractor 53, IA = X, IB = B + y
It becomes +1. The subtraction result P in this case is P = IA-IB = X- (B + y + 1) (17), and it is understood from the equation (4) that the subtraction result P is equal to X + Y-B. The output selector 55 selects the subtraction result P as the product index Ez and outputs it.

【0056】除算時には、1ビット反転器51.1が反
転動作を行い、(n−1)個の1ビット反転器51.2
〜51.nが反転動作を行わず、かつ論理ゲート52が
1ビット反転器51.1の出力をそのまま出力するよう
に、制御信号CS1,CS2,CS3が供給される。し
たがって、減算器53においてIA=X,IB=Y+b
となる。この場合の減算結果Qは、 Q=IA−(IB+1) =X−(Y+b+1) …(18) であり、式(11)から減算結果QはX−Y+Bに等し
いことが判る。出力セレクタ55は、この減算結果Qを
商指数Ezとして選択して出力する。
At the time of division, the 1-bit inverter 51.1 performs the inverting operation, and (n-1) 1-bit inverters 51.2
~ 51. Control signals CS1, CS2 and CS3 are supplied so that n does not perform the inverting operation and the logic gate 52 outputs the output of the 1-bit inverter 51.1 as it is. Therefore, in the subtractor 53, IA = X, IB = Y + b
Becomes The subtraction result Q in this case is Q = IA- (IB + 1) = X- (Y + b + 1) (18), and it can be seen from the equation (11) that the subtraction result Q is equal to XY + B. The output selector 55 selects and outputs the subtraction result Q as the quotient index Ez.

【0057】加減算時には、n個の1ビット反転器5
1.1〜51.nがいずれも反転動作を行わず、かつ論
理ゲート52が0を出力するように、制御信号CS1,
CS2,CS3が供給される。したがって、減算器53
においてIA=X,IB=Yとなる。この場合の2つの
減算結果P,Qは、 P=IA−IB =X−Y …(19) Q=IA−(IB+1) =X−(Y+1) …(20) である。
At the time of addition and subtraction, n 1-bit inverters 5
1.1-51. The control signals CS1 and CS1 are controlled so that n does not perform the inverting operation and the logic gate 52 outputs 0.
CS2 and CS3 are supplied. Therefore, the subtractor 53
In IA = X, IB = Y. Two subtraction results P and Q in this case are P = IA-IB = XY ... (19) Q = IA- (IB + 1) = X- (Y + 1) ... (20).

【0058】前記のとおり、加減算時には指数差(X−
Y)の絶対値を求める必要がある。X−Y≧0である場
合には減算器53の減算結果Pが求める絶対値となる
が、X−Y<0の場合にはY−Xを求める必要がある。
ここで、X−Y<0かどうかはX−Yの演算において最
上位ビットから生じるボローがあるか否かで判断でき、
ボローがあればX−Y<0である。一方、Y−Xは、減
算結果Qの全てのビットを反転することにより得られ
る。その理由を説明すると、 X−Y=−(Y−X) = INV(Y−X)+1 …(21) である。ここに、 INV(W)は、Wの全てのビットの反
転操作を意味するものとする。式(21)より、 INV(Y−X)=X−Y−1 =X−(Y+1) …(22) である。したがって、 Y−X= INV(X−(Y+1)) …(23) である。つまり、式(20)の減算結果Qの全てのビッ
トを(n+1)ビット反転器54で反転することによ
り、Y−Xが得られる。
As described above, the exponential difference (X-
It is necessary to find the absolute value of Y). When X−Y ≧ 0, the subtraction result P of the subtractor 53 is the absolute value to be obtained, but when XY <0, Y−X needs to be obtained.
Here, whether or not XY <0 can be determined by whether or not there is a borrow generated from the most significant bit in the operation of XY.
With borrow, XY <0. On the other hand, Y-X is obtained by inverting all the bits of the subtraction result Q. The reason is as follows: X−Y = − (Y−X) = INV (Y−X) +1 (21). Here, INV (W) means an inversion operation of all bits of W. From the formula (21), INV (Y−X) = X−Y−1 = X− (Y + 1) (22). Therefore, Y−X = INV (X− (Y + 1)) (23). That is, Y-X is obtained by inverting all the bits of the subtraction result Q of the equation (20) by the (n + 1) -bit inverter 54.

【0059】加減算時には、出力セレクタ55は、減算
器53の演算で最上位ビットから生じるボローがあれば
(n+1)ビット反転器54の出力を選択し、ボローが
なければ減算器53の減算結果Pを選択する。出力セレ
クタ55の(n+1)ビット出力のうちの最上位ビット
はスワップ信号SWとしてスワッパ15へ供給され、残
りのnビットは右シフト量RSAとして右シフタ16へ
供給される。
At the time of addition / subtraction, the output selector 55 selects the output of the (n + 1) -bit inverter 54 if there is a borrow generated from the most significant bit in the operation of the subtractor 53, and the subtraction result P of the subtractor 53 if there is no borrow. Select. The most significant bit of the (n + 1) -bit output of the output selector 55 is supplied to the swapper 15 as the swap signal SW, and the remaining n bits are supplied to the right shifter 16 as the right shift amount RSA.

【0060】図1及び図3の中の第1の指数演算装置1
1に図4の内部構成を採用すれば、第1〜第3の指数演
算装置11,13,14のハードウェアが加減算器を主
構成として非常に似た構成になる。したがって、図1及
び図3の浮動小数点算術演算装置をバランスの良いパイ
プライン構成にすることができる。なお、乗算器24,
25及びプライオリティ・エンコーダ22の内部構成の
説明は省略する。
The first exponential arithmetic unit 1 in FIGS. 1 and 3
If the internal configuration of FIG. 4 is adopted in FIG. 1, the hardware of the first to third exponent arithmetic units 11, 13, and 14 has a very similar configuration with the adder / subtractor as the main configuration. Therefore, the floating-point arithmetic operation units of FIGS. 1 and 3 can have a well-balanced pipeline configuration. The multiplier 24,
25 and the description of the internal configuration of the priority encoder 22 will be omitted.

【0061】[0061]

【発明の効果】以上説明してきたとおり、本発明に係る
第1の算術演算装置によれば、仮数の桁合せ手段と仮数
の乗除算手段とを並列配置した構成を採用したので、加
減算の場合の桁合せされた2つの仮数の処理と、乗除算
の場合の中間積又は中間商の処理とが同一の加減算手段
で行われる結果、少ないハードウェア量で浮動小数点数
の単一加算、単一減算、単一乗算及び単一除算を実行で
きる。
As described above, according to the first arithmetic operation unit of the present invention, since the mantissa digit aligning means and the mantissa multiplying / dividing means are arranged in parallel, the case of addition and subtraction As a result of the processing of the two mantissas aligned with each other and the processing of the intermediate product or the intermediate quotient in the case of multiplication / division being performed by the same addition / subtraction means, single addition of floating point numbers and single Subtraction, single multiplication and single division can be performed.

【0062】本発明に係る第2の算術演算装置によれ
ば、(n+m)ビットの積を加減算手段に分割入力する
構成を採用したので、加減算の場合の2つの仮数の丸め
を伴う桁合せ加減算処理と、乗除算の場合の所要のビッ
ト数への積又は商の丸め加算処理とが同一の手段で行わ
れる結果、少ないハードウェア量で浮動小数点数の単一
加算、単一減算、単一乗算及び単一除算を実行できる。
According to the second arithmetic operation device of the present invention, since the product of (n + m) bits is divided and input to the adder / subtractor, digit addition / subtraction accompanied by rounding of two mantissas in the case of addition / subtraction is adopted. The same processing and rounding addition of the product or quotient to the required number of bits in the case of multiplication and division result in single addition, single subtraction and single addition of floating point numbers with a small amount of hardware. Multiplication and single division can be performed.

【0063】本発明に係る指数演算装置によれば、2つ
の減算結果P=IA−IB及びQ=IA−(IB+1)
を算出するための減算器と、減算結果Qの反転を得るた
めの(n+1)ビット反転器とを用いて、加減算の場合
の指数差の絶対値と、乗算の場合の積指数と、除算の場
合の商指数とを算出する構成を採用したので、該指数演
算装置を加減乗除算に兼用できる。
According to the exponential arithmetic unit of the present invention, two subtraction results P = IA-IB and Q = IA- (IB + 1).
And a (n + 1) -bit inverter for obtaining the inversion of the subtraction result Q are used to calculate the absolute value of the exponent difference in the case of addition and subtraction, the product exponent in the case of multiplication, and the In this case, since the quotient index and the quotient index are calculated, the index calculator can be used for addition, subtraction, multiplication and division.

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

【図1】本発明の第1の実施例に係る浮動小数点算術演
算装置の構成を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of a floating-point arithmetic operation device according to a first embodiment of the present invention.

【図2】(a)及び(b)は図1中の加減算器の動作を
説明するための図である。
2A and 2B are diagrams for explaining the operation of the adder / subtractor in FIG.

【図3】本発明の第2の実施例に係る浮動小数点算術演
算装置の構成を示すブロック図である。
FIG. 3 is a block diagram showing a configuration of a floating point arithmetic unit according to a second embodiment of the present invention.

【図4】図1及び図3中の第1の指数演算装置の内部構
成例を示すブロック図である。
FIG. 4 is a block diagram showing an internal configuration example of a first exponential arithmetic unit in FIGS. 1 and 3.

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

11 第1の指数演算装置 12 指数セレクタ 13 第2の指数演算装置 14 第3の指数演算装置 15 スワッパ 16 右シフタ 17 第1の仮数セレクタ 18 第2の仮数セレクタ 19,20 1ビット右シフタ 21 加減算器 22 プライオリティ・エンコーダ 23 左シフタ 24,25 乗算器 26 第1の仮数セレクタ 27 第2の仮数セレクタ 28 論理ゲート 29 シフト量セレクタ 51.1〜51.n 1ビット反転器 52 論理ゲート 53 減算器 54 (n+1)ビット反転器 55 出力セレクタ 11 First Exponential Arithmetic Unit 12 Exponent Selector 13 Second Exponential Arithmetic Unit 14 Third Exponential Arithmetic Unit 15 Swapper 16 Right Shifter 17 First Mantissa Selector 18 Second Mantissa Selector 19, 20 1-bit Right Shifter 21 Addition / Subtraction Device 22 priority encoder 23 left shifter 24, 25 multiplier 26 first mantissa selector 27 second mantissa selector 28 logic gate 29 shift amount selector 51.1 to 51. n 1-bit inverter 52 Logic gate 53 Subtractor 54 (n + 1) bit inverter 55 Output selector

Claims (14)

【特許請求の範囲】[Claims] 【請求項1】 第1のオペランドの指数及び仮数として
被加数オペランドの指数及び仮数又は被減数オペランド
の指数及び仮数が、第2のオペランドの指数及び仮数と
して加数オペランドの指数及び仮数又は減数オペランド
の指数及び仮数が、第3のオペランドの指数及び仮数と
して被乗数オペランドの指数及び仮数又は被除数オペラ
ンドの指数及び仮数が、第4のオペランドの指数及び仮
数として乗数オペランドの指数及び仮数又は除数オペラ
ンドの指数及び仮数がそれぞれ与えられる浮動小数点数
のための算術演算装置であって、 前記第1のオペランドの仮数と前記第2のオペランドの
仮数との桁合せを行うための桁合せ手段と、 前記第3のオペランドの仮数及び前記第4のオペランド
の仮数から、2つの中間値の形の中間積又は中間商を算
出するための乗除算手段と、 加減算の場合には前記桁合せされた2つの仮数のうちの
一方を、乗除算の場合には前記2つの中間値のうちの一
方を各々第1のデータとして選択するための第1の選択
手段と、 加減算の場合には前記桁合せされた2つの仮数のうちの
他方を、乗除算の場合には前記2つの中間値のうちの他
方を各々第2のデータとして選択するための第2の選択
手段と、 前記第1及び第2のデータの加減算を行うための加減算
手段とを備えたことを特徴とする算術演算装置。
1. An exponent and a mantissa of an augend operand as an exponent and a mantissa of a first operand, and an exponent and a mantissa of an addend of a operand are used as an exponent and a mantissa of a second operand. Is the exponent and mantissa of the third operand as the exponent and mantissa of the third operand, and the exponent and mantissa of the mantissa or the dividend operand are the exponent and mantissa of the fourth operand as the exponent and mantissa of the fourth operand, respectively. And a mantissa, which are arithmetic units for floating-point numbers, and digit aligning means for performing digit alignment between the mantissa of the first operand and the mantissa of the second operand. From the mantissa of the operand and the mantissa of the fourth operand, the intermediate product or the intermediate quotient in the form of two intermediate values. Multiply / divide means for calculating, and one of the two mantissas aligned in the case of addition / subtraction, and one of the two intermediate values in the case of multiplication / division as first data. A first selecting means for selecting the second mantissa of the two digit-matched mantissas in the case of addition and subtraction, and a second of the two intermediate values in the case of multiplication and division. An arithmetic operation device comprising: a second selecting means for selecting as data and an adding / subtracting means for performing addition / subtraction of the first and second data.
【請求項2】 請求項1記載の算術演算装置において、 前記乗除算手段は、 前記第3のオペランドの仮数及び前記第4のオペランド
の仮数から、中間和と桁上げとの形の中間積を生成する
ための乗算器を備えたことを特徴とする算術演算装置。
2. The arithmetic operation device according to claim 1, wherein the multiplication / division means calculates an intermediate product in the form of an intermediate sum and a carry from the mantissa of the third operand and the mantissa of the fourth operand. An arithmetic operation device comprising a multiplier for generating.
【請求項3】 請求項1記載の算術演算装置において、 前記桁合せ手段は、 前記第1及び第2のオペランドのうちの大きい方の指数
を持つオペランドの仮数を第1の数値とし、他方のオペ
ランドの仮数を第2の数値として出力するためのスワッ
パと、 前記第2の数値に右シフト処理を施すための右シフタと
を備えたことを特徴とする算術演算装置。
3. The arithmetic operation unit according to claim 1, wherein the digit aligning means sets a mantissa of an operand having a larger exponent of the first and second operands as a first numerical value, and An arithmetic operation device comprising a swapper for outputting a mantissa of an operand as a second numerical value, and a right shifter for performing a right shift process on the second numerical value.
【請求項4】 請求項3記載の算術演算装置において、 加減算の場合には前記第1のオペランドの指数と前記第
2のオペランドの指数との大小関係を示す信号を前記ス
ワッパへ供給し、かつ前記第1のオペランドの指数と前
記第2のオペランドの指数との差の絶対値をシフト量と
して前記右シフタへ供給し、乗除算の場合には前記第3
のオペランドの指数及び前記第4のオペランドの指数か
ら積指数又は商指数を算出するための第1の指数演算装
置と、 加減算の場合には前記第1のオペランドの指数と前記第
2のオペランドの指数とのうちの大きい方の指数を選択
し、乗除算の場合には前記算出された積指数又は商指数
を選択するための指数セレクタとを更に備えたことを特
徴とする算術演算装置。
4. The arithmetic operation unit according to claim 3, wherein in the case of addition and subtraction, a signal indicating a magnitude relationship between the exponent of the first operand and the exponent of the second operand is supplied to the swapper, and The absolute value of the difference between the exponent of the first operand and the exponent of the second operand is supplied to the right shifter as a shift amount, and in the case of multiplication / division, the third value is supplied.
A first exponent arithmetic unit for calculating a product exponent or a quotient exponent from the exponent of the operand and the exponent of the fourth operand; and, in the case of addition and subtraction, the exponent of the first operand and the exponent of the second operand. An arithmetic operation device further comprising: an exponent selector for selecting a larger exponent of the exponents and selecting the calculated product exponent or quotient exponent in the case of multiplication and division.
【請求項5】 請求項4記載の算術演算装置において、 前記第1の指数演算装置は、 前記第1のオペランドの指数又は前記第3のオペランド
の指数をnビットの第1の指数Xとし、前記第2のオペ
ランドの指数又は前記第4のオペランドの指数をnビッ
トの第2の指数Yとし、かつ指数のバイアスをB=2
(n-1) −1とするとき、 加減算の場合には前記第2の指数Yそのもので構成され
るnビットの中間データを、乗算の場合には前記第2の
指数Yの最上位ビットと前記第2の指数Yの下位(n−
1)ビットの各々の反転とで構成されるnビットの中間
データを、除算の場合には前記第2の指数Yの最上位ビ
ットの反転と前記第2の指数Yの下位(n−1)ビット
とで構成されるnビットの中間データをそれぞれ得るた
めのn個の1ビット反転器と、 (n+1)ビットの減数データIBを得るように、加減
算の場合には0を、乗除算の場合には前記n個の1ビッ
ト反転器により得られたnビットの中間データの最上位
ビットの値をそれぞれ該nビットの中間データの上位桁
に付加するための論理ゲートと、 前記第1の指数Xを被減数データIAとして、第1の減
算結果P=IA−IBと第2の減算結果Q=IA−(I
B+1)とを算出するための減算器と、 前記第2の減算結果Qを構成する(n+1)ビットの各
々の反転を得るための(n+1)ビット反転器と、 X≧Yかつ加減算の場合には前記第1のオペランドの指
数が前記第2のオペランドの指数より小さくないことを
示す信号と、前記第1のオペランドの指数と前記第2の
オペランドの指数との差の絶対値X−Yとを出力するよ
うに前記第1の減算結果Pを選択し、X<Yかつ加減算
の場合には前記第1のオペランドの指数が前記第2のオ
ペランドの指数より小さいことを示す信号と、前記第1
のオペランドの指数と前記第2のオペランドの指数との
差の絶対値Y−Xとを出力するように前記(n+1)ビ
ット反転器の結果を選択し、乗算の場合には積指数X+
Y−Bを出力するように前記第1の減算結果Pを選択
し、除算の場合には商指数X−Y+Bを出力するように
前記第2の減算結果Qを選択するための出力セレクタと
を備えたことを特徴とする算術演算装置。
5. The arithmetic operation device according to claim 4, wherein the first exponent operation device sets the exponent of the first operand or the exponent of the third operand to an n-bit first exponent X, The exponent of the second operand or the exponent of the fourth operand is the n-bit second exponent Y, and the exponent bias is B = 2.
(n−1) −1, in the case of addition and subtraction, the n-bit intermediate data composed of the second exponent Y itself is used as the most significant bit of the second exponent Y in the case of multiplication. Lower part (n−) of the second index Y
1) Inversion of the n-bit intermediate data consisting of the inversion of each bit and the inversion of the most significant bit of the second exponent Y and the lower order (n-1) of the second exponent Y in the case of division. And n-bit 1-bit inverters for obtaining n-bit intermediate data respectively, and (n + 1) -bit subtraction data IB, in the case of addition and subtraction, in the case of multiplication and division A logic gate for adding the value of the most significant bit of the n-bit intermediate data obtained by the n 1-bit inverters to the upper digit of the n-bit intermediate data, and the first exponent. The first subtraction result P = IA-IB and the second subtraction result Q = IA- (I
B + 1), a (n + 1) -bit inverter for obtaining the inversion of each of the (n + 1) bits forming the second subtraction result Q, and X ≧ Y and addition and subtraction Is a signal indicating that the exponent of the first operand is not less than the exponent of the second operand, and the absolute value XY of the difference between the exponent of the first operand and the exponent of the second operand. Selecting the first subtraction result P so as to output, and a signal indicating that the exponent of the first operand is smaller than the exponent of the second operand when X <Y and addition / subtraction, 1
The result of the (n + 1) -bit inverter is output so as to output the absolute value Y−X of the difference between the exponent of the operand and the exponent of the second operand, and in the case of multiplication, the product exponent X +
And an output selector for selecting the first subtraction result P so as to output Y−B, and for selecting the second subtraction result Q so as to output the quotient index X−Y + B in the case of division. An arithmetic operation device characterized by being provided.
【請求項6】 請求項4記載の算術演算装置において、 前記右シフタは、丸め用ビットを生成する機能を更に備
え、 前記加減算手段は、加減算とともに前記丸め用ビットを
用いた丸めを行うための加減算器を備え、 前記算術演算装置は、 各々前記第1及び第2の選択手段と前記加減算手段との
間に介在し、算術演算の種類に応じて選択的に前記第1
及び第2のデータに1ビット右シフト処理を施すための
2つの1ビット右シフタと、 前記指数セレクタによって選択された指数を前記1ビッ
ト右シフト処理に応じて修正するための第2の指数演算
装置とを更に備えたことを特徴とする算術演算装置。
6. The arithmetic operation device according to claim 4, wherein the right shifter further has a function of generating a rounding bit, and the adder / subtractor performs rounding using the rounding bit together with addition and subtraction. The arithmetic operation device includes an adder / subtractor, and the arithmetic operation device is interposed between the first and second selection means and the addition / subtraction means, and selectively operates the first arithmetic operation unit according to a type of arithmetic operation.
And two 1-bit right shifters for performing 1-bit right shift processing on the second data, and a second exponent operation for correcting the exponent selected by the exponent selector according to the 1-bit right shift processing. An arithmetic operation device further comprising a device.
【請求項7】 請求項6記載の算術演算装置において、 前記加減算手段の結果の最初の非ゼロ値ビットの位置を
検出することにより、先行するゼロ値ビットの数を求め
るためのプライオリティ・エンコーダと、 前記加減算手段の結果に前記求められたゼロ値ビットの
数をシフト量とする左シフト処理を施すための左シフタ
と、 前記第2の指数演算装置によって修正された指数を前記
左シフト処理に応じて補正するための第3の指数演算装
置とを更に備えたことを特徴とする算術演算装置。
7. An arithmetic operation unit according to claim 6, further comprising: a priority encoder for determining the number of leading zero-value bits by detecting the position of the first non-zero-value bit of the result of said addition / subtraction means. A left shifter for performing a left shift process with the obtained number of zero-valued bits as a shift amount on the result of the adding / subtracting means, and an exponent corrected by the second exponent arithmetic unit to the left shift process. An arithmetic operation device further comprising a third exponential operation device for performing correction in accordance therewith.
【請求項8】 第1のオペランドの指数及び仮数として
被加数オペランドの指数及び仮数又は被減数オペランド
の指数及び仮数が、第2のオペランドの指数及び仮数と
して加数オペランドの指数及び仮数又は減数オペランド
の指数及び仮数が、第3のオペランドの指数及び仮数と
して被乗数オペランドの指数及び仮数又は被除数オペラ
ンドの指数及び仮数が、第4のオペランドの指数及び仮
数として乗数オペランドの指数及び仮数又は除数オペラ
ンドの指数及び仮数がそれぞれ与えられる浮動小数点数
のための算術演算装置であって、 前記第3のオペランドの仮数及び前記第4のオペランド
の仮数から、(n+m)ビットの積又は商を算出するた
めの乗除算手段と、 加減算の場合には前記第1のオペランドの仮数を、乗除
算の場合には前記(n+m)ビットの積又は商のうちの
上位nビットを各々第1のデータとして選択するための
第1の選択手段と、 加減算の場合には前記第2のオペランドの仮数を、乗除
算の場合には前記(n+m)ビットの積又は商のうちの
下位mビットを各々第2のデータとして選択するための
第2の選択手段と、 加減算の場合には前記第1のデータと前記第2のデータ
との桁合せを行うとともに第1の丸め用ビットを生成
し、乗除算の場合には前記第1のデータを出力するとと
もに前記第2のデータから第2の丸め用ビットを生成す
るための桁合せ手段と、 加減算の場合には前記桁合せされた第1及び第2のデー
タの加減算とともに前記第1の丸め用ビットを用いた丸
めを行い、乗除算の場合には前記第2の丸め用ビットを
用いて前記第1のデータの丸めを行うための加減算手段
とを備えたことを特徴とする算術演算装置。
8. The exponent and mantissa of the augend operand as the exponent and mantissa of the first operand, and the exponent and the mantissa of the operand of the operand are the exponent and mantissa of the addend operand as the exponent and the mantissa of the second operand, respectively. Is the exponent and mantissa of the third operand as the exponent and mantissa of the third operand, and the exponent and mantissa of the mantissa or the dividend operand are the exponent and mantissa of the fourth operand as the exponent and mantissa of the fourth operand, respectively. And a mantissa, which are arithmetic units for floating-point numbers, and multiply and divide to calculate a product or quotient of (n + m) bits from the mantissa of the third operand and the mantissa of the fourth operand. Arithmetic means, the mantissa of the first operand in the case of addition and subtraction, and the ( + M) first selection means for selecting the upper n bits of the product or quotient of the bits as the first data, and the mantissa of the second operand in the case of addition and subtraction, and the multiplication and division in the case of multiplication and division. Is a second selecting means for selecting the lower m bits of the product or quotient of the (n + m) bits as the second data; and, in the case of addition and subtraction, the first data and the second data. And a digit for generating a first rounding bit, and in the case of multiplication / division, outputting the first data and generating a second rounding bit from the second data. Aligning means, in the case of addition and subtraction, rounding using the first rounding bit together with addition and subtraction of the digitized first and second data, and in the case of multiplication and division for the second rounding Circle of the first data using bits Arithmetic apparatus characterized by comprising a subtraction means for performing.
【請求項9】 請求項8記載の算術演算装置において、 前記桁合せ手段は、 加減算の場合には前記第1及び第2のデータに係る前記
第1及び第2のオペランドのうちの大きい方の指数を持
つオペランドの仮数を第1の数値としかつ他方のオペラ
ンドの仮数を第2の数値として出力し、乗除算の場合に
は前記第1のデータを第1の数値としかつ前記第2のデ
ータを第2の数値として出力するためのスワッパと、 加減算の場合には前記第1及び第2の数値の桁合せを行
うとともに前記第1の丸め用ビットを生成するように、
乗除算の場合には前記第2の丸め用ビットを生成するよ
うに、それぞれ前記第2の数値に右シフト処理を施すた
めの右シフタとを備えたことを特徴とする算術演算装
置。
9. The arithmetic operation device according to claim 8, wherein said digit aligning means is a larger one of said first and second operands relating to said first and second data in the case of addition and subtraction. The mantissa of the operand having the exponent is output as the first numerical value and the mantissa of the other operand is output as the second numerical value, and in the case of multiplication / division, the first data is the first numerical value and the second data is A swapper for outputting as a second numerical value, and in the case of addition and subtraction, digit matching of the first and second numerical values and generation of the first rounding bit,
An arithmetic operation device comprising a right shifter for performing a right shift process on each of the second numerical values so as to generate the second rounding bit in the case of multiplication and division.
【請求項10】 請求項9記載の算術演算装置におい
て、 加減算の場合には前記第1のオペランドの指数と前記第
2のオペランドの指数との大小関係を示す信号を前記ス
ワッパへ供給し、かつ前記第1のオペランドの指数と前
記第2のオペランドの指数との差の絶対値をシフト量と
して前記右シフタへ供給し、乗除算の場合には前記第3
のオペランドの指数及び前記第4のオペランドの指数か
ら積指数又は商指数を算出するための第1の指数演算装
置と、 加減算の場合には前記第1のオペランドの指数と前記第
2のオペランドの指数とのうちの大きい方の指数を選択
し、乗除算の場合には前記算出された積指数又は商指数
を選択するための指数セレクタとを更に備えたことを特
徴とする算術演算装置。
10. The arithmetic operation device according to claim 9, wherein in the case of addition and subtraction, a signal indicating a magnitude relationship between the exponent of the first operand and the exponent of the second operand is supplied to the swapper, and The absolute value of the difference between the exponent of the first operand and the exponent of the second operand is supplied to the right shifter as a shift amount, and in the case of multiplication / division, the third value is supplied.
A first exponent arithmetic unit for calculating a product exponent or a quotient exponent from the exponent of the operand and the exponent of the fourth operand; and, in the case of addition and subtraction, the exponent of the first operand and the exponent of the second operand. An arithmetic operation device further comprising: an exponent selector for selecting a larger exponent of the exponents and selecting the calculated product exponent or quotient exponent in the case of multiplication and division.
【請求項11】 請求項10記載の算術演算装置におい
て、 前記第1の指数演算装置は、 前記第1のオペランドの指数又は前記第3のオペランド
の指数をnビットの第1の指数Xとし、前記第2のオペ
ランドの指数又は前記第4のオペランドの指数をnビッ
トの第2の指数Yとし、かつ指数のバイアスをB=2
(n-1) −1とするとき、 加減算の場合には前記第2の指数Yそのもので構成され
るnビットの中間データを、乗算の場合には前記第2の
指数Yの最上位ビットと前記第2の指数Yの下位(n−
1)ビットの各々の反転とで構成されるnビットの中間
データを、除算の場合には前記第2の指数Yの最上位ビ
ットの反転と前記第2の指数Yの下位(n−1)ビット
とで構成されるnビットの中間データをそれぞれ得るた
めのn個の1ビット反転器と、 (n+1)ビットの減数データIBを得るように、加減
算の場合には0を、乗除算の場合には前記n個の1ビッ
ト反転器により得られたnビットの中間データの最上位
ビットの値をそれぞれ該nビットの中間データの上位桁
に付加するための論理ゲートと、 前記第1の指数Xを被減数データIAとして、第1の減
算結果P=IA−IBと第2の減算結果Q=IA−(I
B+1)とを算出するための減算器と、 前記第2の減算結果Qを構成する(n+1)ビットの各
々の反転を得るための(n+1)ビット反転器と、 X≧Yかつ加減算の場合には前記第1のオペランドの指
数が前記第2のオペランドの指数より小さくないことを
示す信号と、前記第1のオペランドの指数と前記第2の
オペランドの指数との差の絶対値X−Yとを出力するよ
うに前記第1の減算結果Pを選択し、X<Yかつ加減算
の場合には前記第1のオペランドの指数が前記第2のオ
ペランドの指数より小さいことを示す信号と、前記第1
のオペランドの指数と前記第2のオペランドの指数との
差の絶対値Y−Xとを出力するように前記(n+1)ビ
ット反転器の結果を選択し、乗算の場合には積指数X+
Y−Bを出力するように前記第1の減算結果Pを選択
し、除算の場合には商指数X−Y+Bを出力するように
前記第2の減算結果Qを選択するための出力セレクタと
を備えたことを特徴とする算術演算装置。
11. The arithmetic operation device according to claim 10, wherein the first exponent operation device sets an exponent of the first operand or an exponent of the third operand to an n-bit first exponent X, The exponent of the second operand or the exponent of the fourth operand is the n-bit second exponent Y, and the exponent bias is B = 2.
(n−1) −1, in the case of addition and subtraction, the n-bit intermediate data composed of the second exponent Y itself is used as the most significant bit of the second exponent Y in the case of multiplication. Lower part (n−) of the second index Y
1) Inversion of the n-bit intermediate data consisting of the inversion of each bit and the inversion of the most significant bit of the second exponent Y and the lower order (n-1) of the second exponent Y in the case of division. And n-bit 1-bit inverters for obtaining n-bit intermediate data respectively, and (n + 1) -bit subtraction data IB, in the case of addition and subtraction, in the case of multiplication and division A logic gate for adding the value of the most significant bit of the n-bit intermediate data obtained by the n 1-bit inverters to the upper digit of the n-bit intermediate data, and the first exponent. The first subtraction result P = IA-IB and the second subtraction result Q = IA- (I
B + 1), a (n + 1) -bit inverter for obtaining the inversion of each of the (n + 1) bits forming the second subtraction result Q, and X ≧ Y and addition and subtraction Is a signal indicating that the exponent of the first operand is not less than the exponent of the second operand, and the absolute value XY of the difference between the exponent of the first operand and the exponent of the second operand. Selecting the first subtraction result P so as to output, and a signal indicating that the exponent of the first operand is smaller than the exponent of the second operand when X <Y and addition / subtraction, 1
The result of the (n + 1) -bit inverter is output so as to output the absolute value Y−X of the difference between the exponent of the operand and the exponent of the second operand, and in the case of multiplication, the product exponent X +
And an output selector for selecting the first subtraction result P so as to output Y−B, and for selecting the second subtraction result Q so as to output the quotient index X−Y + B in the case of division. An arithmetic operation device characterized by being provided.
【請求項12】 請求項10記載の算術演算装置におい
て、 各々前記桁合せ手段と前記加減算手段との間に介在し、
算術演算の種類に応じて選択的に前記桁合せ手段の2出
力に1ビット右シフト処理を施すための2つの1ビット
右シフタと、 前記指数セレクタによって選択された指数を前記1ビッ
ト右シフト処理に応じて修正するための第2の指数演算
装置とを更に備えたことを特徴とする算術演算装置。
12. The arithmetic operation device according to claim 10, wherein the arithmetic unit is interposed between the digit aligning unit and the adding / subtracting unit, respectively.
Two 1-bit right shifters for selectively performing 1-bit right shift processing on the two outputs of the digit aligning means in accordance with the type of arithmetic operation, and the 1-bit right shift processing for the exponent selected by the exponent selector. An arithmetic operation device further comprising: a second exponential operation device for making correction according to the above.
【請求項13】 請求項12記載の算術演算装置におい
て、 前記加減算手段の結果の最初の非ゼロ値ビットの位置を
検出することにより、先行するゼロ値ビットの数を求め
るためのプライオリティ・エンコーダと、 前記加減算手段の結果に前記求められたゼロ値ビットの
数をシフト量とする左シフト処理を施すための左シフタ
と、 前記第2の指数演算装置によって修正された指数を前記
左シフト処理に応じて補正するための第3の指数演算装
置とを更に備えたことを特徴とする算術演算装置。
13. The arithmetic unit according to claim 12, further comprising: a priority encoder for determining the number of leading zero-value bits by detecting the position of the first non-zero-value bit in the result of the adding / subtracting means. A left shifter for performing a left shift process with the obtained number of zero-valued bits as a shift amount on the result of the adding / subtracting means, and an exponent corrected by the second exponent arithmetic unit to the left shift process. An arithmetic operation device further comprising a third exponential operation device for performing correction in accordance therewith.
【請求項14】 第1のオペランドの指数として被加数
オペランドの指数又は被減数オペランドの指数が、第2
のオペランドの指数として加数オペランドの指数又は減
数オペランドの指数が、第3のオペランドの指数として
被乗数オペランドの指数又は被除数オペランドの指数
が、第4のオペランドの指数として乗数オペランドの指
数又は除数オペランドの指数がそれぞれ与えられる浮動
小数点数のための指数演算装置であって、 前記第1のオペランドの指数又は前記第3のオペランド
の指数をnビットの第1の指数Xとし、前記第2のオペ
ランドの指数又は前記第4のオペランドの指数をnビッ
トの第2の指数Yとし、かつ指数のバイアスをB=2
(n-1) −1とするとき、 加減算の場合には前記第2の指数Yそのもので構成され
るnビットの中間データを、乗算の場合には前記第2の
指数Yの最上位ビットと前記第2の指数Yの下位(n−
1)ビットの各々の反転とで構成されるnビットの中間
データを、除算の場合には前記第2の指数Yの最上位ビ
ットの反転と前記第2の指数Yの下位(n−1)ビット
とで構成されるnビットの中間データをそれぞれ得るた
めのn個の1ビット反転器と、 (n+1)ビットの減数データIBを得るように、加減
算の場合には0を、乗除算の場合には前記n個の1ビッ
ト反転器により得られたnビットの中間データの最上位
ビットの値をそれぞれ該nビットの中間データの上位桁
に付加するための論理ゲートと、 前記第1の指数Xを被減数データIAとして、第1の減
算結果P=IA−IBと第2の減算結果Q=IA−(I
B+1)とを算出するための減算器と、 前記第2の減算結果Qを構成する(n+1)ビットの各
々の反転を得るための(n+1)ビット反転器と、 X≧Yかつ加減算の場合には前記第1のオペランドの指
数が前記第2のオペランドの指数より小さくないことを
示す信号と、前記第1のオペランドの指数と前記第2の
オペランドの指数との差の絶対値X−Yとを出力するよ
うに前記第1の減算結果Pを選択し、X<Yかつ加減算
の場合には前記第1のオペランドの指数が前記第2のオ
ペランドの指数より小さいことを示す信号と、前記第1
のオペランドの指数と前記第2のオペランドの指数との
差の絶対値Y−Xとを出力するように前記(n+1)ビ
ット反転器の結果を選択し、乗算の場合には積指数X+
Y−Bを出力するように前記第1の減算結果Pを選択
し、除算の場合には商指数X−Y+Bを出力するように
前記第2の減算結果Qを選択するための出力セレクタと
を備えたことを特徴とする指数演算装置。
14. The exponent of the augend operand or the exponent of the minuend operand is the second exponent as the exponent of the first operand.
The exponent of the add operand or the exponent of the subtractive operand as the exponent of the operand of, the exponent of the multiplicand operand as the exponent of the third operand, or the exponent of the dividend operand, and the exponent of the multiplier operand as the exponent of the fourth operand An exponent arithmetic unit for a floating-point number to which an exponent is given, wherein the exponent of the first operand or the exponent of the third operand is a first exponent X of n bits, and the exponent of the second operand is The exponent or the exponent of the fourth operand is the n-bit second exponent Y, and the exponent bias is B = 2.
(n−1) −1, in the case of addition and subtraction, the n-bit intermediate data composed of the second exponent Y itself is used as the most significant bit of the second exponent Y in the case of multiplication. Lower part (n−) of the second index Y
1) Inversion of the n-bit intermediate data consisting of the inversion of each bit and the inversion of the most significant bit of the second exponent Y and the lower order (n-1) of the second exponent Y in the case of division. And n-bit 1-bit inverters for obtaining n-bit intermediate data respectively, and (n + 1) -bit subtraction data IB, in the case of addition and subtraction, in the case of multiplication and division A logic gate for adding the value of the most significant bit of the n-bit intermediate data obtained by the n 1-bit inverters to the upper digit of the n-bit intermediate data, and the first exponent. The first subtraction result P = IA-IB and the second subtraction result Q = IA- (I
B + 1), a (n + 1) -bit inverter for obtaining the inversion of each of the (n + 1) bits forming the second subtraction result Q, and X ≧ Y and addition and subtraction Is a signal indicating that the exponent of the first operand is not less than the exponent of the second operand, and the absolute value XY of the difference between the exponent of the first operand and the exponent of the second operand. Selecting the first subtraction result P so as to output, and a signal indicating that the exponent of the first operand is smaller than the exponent of the second operand when X <Y and addition / subtraction, 1
The result of the (n + 1) -bit inverter is output so as to output the absolute value Y−X of the difference between the exponent of the operand and the exponent of the second operand, and in the case of multiplication, the product exponent X +
And an output selector for selecting the first subtraction result P so as to output Y−B, and for selecting the second subtraction result Q so as to output the quotient index X−Y + B in the case of division. An exponent calculation device characterized by being provided.
JP07129940A 1994-06-07 1995-05-29 Arithmetic unit for floating point numbers Expired - Fee Related JP3100868B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP07129940A JP3100868B2 (en) 1994-06-07 1995-05-29 Arithmetic unit for floating point numbers

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP12502594 1994-06-07
JP6-125025 1994-06-07
JP07129940A JP3100868B2 (en) 1994-06-07 1995-05-29 Arithmetic unit for floating point numbers

Publications (2)

Publication Number Publication Date
JPH0855015A true JPH0855015A (en) 1996-02-27
JP3100868B2 JP3100868B2 (en) 2000-10-23

Family

ID=26461567

Family Applications (1)

Application Number Title Priority Date Filing Date
JP07129940A Expired - Fee Related JP3100868B2 (en) 1994-06-07 1995-05-29 Arithmetic unit for floating point numbers

Country Status (1)

Country Link
JP (1) JP3100868B2 (en)

Also Published As

Publication number Publication date
JP3100868B2 (en) 2000-10-23

Similar Documents

Publication Publication Date Title
KR100203468B1 (en) Arithmetic apparatus for floating point numbers
JP4418578B2 (en) Data processing apparatus and method for applying floating point arithmetic to first, second and third operands
JPH02196328A (en) Floating point computing apparatus
US5148386A (en) Adder-subtracter for signed absolute values
WO2022170809A1 (en) Reconfigurable floating point multiply-accumulate operation unit and method suitable for multi-precision calculation
JP3845009B2 (en) Product-sum operation apparatus and product-sum operation method
US20080215660A1 (en) Three-Term Input Floating-Point Adder-Subtractor
EP0356153B1 (en) Radix-2**n divider method and apparatus using overlapped quotient bit selection and concurrent quotient rounding and correction
GB2421327A (en) Calculating the number of digits in a quotient for integer division
US5132925A (en) Radix-16 divider using overlapped quotient bit selection and concurrent quotient rounding and correction
US20100125621A1 (en) Arithmetic processing device and methods thereof
US8060551B2 (en) Method and apparatus for integer division
CN111752526A (en) Floating point addition
US5260889A (en) Computation of sticky-bit in parallel with partial products in a floating point multiplier unit
US5623435A (en) Arithmetic unit capable of performing concurrent operations for high speed operation
JP7285966B2 (en) Multi-input floating point adder
JP2511527B2 (en) Floating point arithmetic unit
JP3100868B2 (en) Arithmetic unit for floating point numbers
JPH0540605A (en) Floating point multiplier
JP2003084969A (en) Floating point remainder computing element, information processing device, and computer program
JPH04172526A (en) Floating point divider
JPH086766A (en) Sine and cosine arithmetic device
US7243119B1 (en) Floating point computing unit
JP4428778B2 (en) Arithmetic device, arithmetic method, and computing device
Gopal Design and performance analysis of high throughput and low latency double precision floating point division on FPGA

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: 20000801

LAPS Cancellation because of no payment of annual fees