JP2517064B2 - Denormalized number processing method - Google Patents
Denormalized number processing methodInfo
- Publication number
- JP2517064B2 JP2517064B2 JP63113166A JP11316688A JP2517064B2 JP 2517064 B2 JP2517064 B2 JP 2517064B2 JP 63113166 A JP63113166 A JP 63113166A JP 11316688 A JP11316688 A JP 11316688A JP 2517064 B2 JP2517064 B2 JP 2517064B2
- Authority
- JP
- Japan
- Prior art keywords
- exponent
- bit
- mantissa
- circuit
- processing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Description
【発明の詳細な説明】 〔目次〕 概要 産業上の利用分野 従来の技術と発明が解決しようとする課題 課題を解決するための手段 作用 実施例 発明の効果 〔概要〕 米国電気電子工学協会(IEEE)規格,或いはこれに準
拠した2進浮動小数点表現形式を用いる浮動小数点処理
装置における非正規化数の処理方式に関し、 演算前正規化回路の削除と非正規化数を含む浮動小数
点演算の処理速度を向上させることを目的とし、 オペランドデータが上記非正規化数のケースであって
も無限の指数範囲をもつものとして演算する機構を備え
た2進数浮動小数点処理装置において、 2つの入力オペランドデータのそれぞれについて、そ
の指数部Eを構成する全ビットが‘0'であるか否かを検
出する手段を設け、該指数部Eが‘0'であると検出され
た場合には、対応するオペランドデータ側について、指
数演算部に供給される指数部の値を強制的に‘1'とし、
且つ仮数演算部に供給される1ビットの整数部を‘0'と
し、該指数部Eの少なくとも1ビットが‘1'である場合
には、対応するオペランドデータ側について、オペラン
ドデータの指数部をその侭上記指数部演算部へ供給し,
且つ仮数演算部に供給される1ビットの整数部を‘1'と
して浮動小数点の演算をするように構成する。DETAILED DESCRIPTION [Table of Contents] Outline Industrial field of application Conventional techniques and problems to be solved by the invention Means for solving the problem Action Example Effect of the invention [Outline] American Institute of Electrical and Electronics Engineers (IEEE) ) Regarding the processing method of denormalized numbers in the floating point processing device using the standard or the binary floating point representation format conforming to this standard, deletion of the pre-operation normalization circuit and the processing speed of floating point arithmetic including denormalized numbers In order to improve the performance of the two input operand data in a binary floating point processor equipped with a mechanism for operating the operand data as having an infinite exponent range even in the case of the above denormalized number. For each of them, means for detecting whether or not all the bits constituting the exponent part E are “0” is provided, and when the exponent part E is detected as “0”, For operand data side to respond to the forced '1' value of exponent supplied to the exponent operation portion,
Further, when the 1-bit integer part supplied to the mantissa operation unit is set to '0' and at least 1 bit of the exponent part E is '1', the exponent part of the operand data is set to the corresponding operand data side. Supply it to the above-mentioned exponent part operation part,
In addition, the 1-bit integer part supplied to the mantissa arithmetic unit is set to '1' to perform floating point arithmetic.
本発明は、米国電気電子工学協会(IEEE)規格,或い
はこれに準拠した2進浮動小数点表現形式を用いる浮動
小数点処理装置における非正規化数の処理方式に関す
る。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a denormalized number processing method in a floating point processing device using a binary floating point representation format conforming to the American Institute of Electrical and Electronics Engineers (IEEE) standard or the standard.
従来から化学技術計算を行う大型の計算機において
は、該科学技術計算の高速処理に対する要求が強く、浮
動小数点演算命令を高速に実行する能力が重要な課題と
なっている。2. Description of the Related Art Conventionally, in a large-scale computer that performs chemical engineering calculation, there is a strong demand for high-speed processing of the scientific and technological calculation, and the ability to execute floating point arithmetic instructions at high speed has become an important issue.
従って、該大型の計算機では、該浮動小数点専用の演
算器を設けることにより、浮動小数点演算を高速に実行
している。Therefore, in the large-scale computer, the floating-point arithmetic is executed at high speed by providing the arithmetic unit dedicated to the floating-point.
又、浮動小数点演算命令のオペランドデータは、通常
の場合、予め、正規化された正規化浮動小数点データで
ある為、上記のような専用演算器は、該正規化数に対し
て最高速に動作できるような最適設計がなされるのが一
般的である。In addition, since the operand data of the floating point arithmetic instruction is usually the normalized floating point data which has been normalized in advance, the dedicated arithmetic unit as described above operates at the highest speed with respect to the normalized number. In general, the optimum design is made so that it can be done.
然し、該オペランドデータが正規化されていないデー
タである場合も、本来は高速に処理されることが望まし
い。However, even when the operand data is not normalized data, it is originally desired to be processed at high speed.
通常、計算機が処理する浮動小数点データは限られた
桁数の有効数字しか表現できない為、多くの場合、該浮
動小数点演算の結果には誤差が生じる。Usually, the floating-point data processed by a computer can express only a limited number of significant digits, so that an error occurs in the result of the floating-point operation in many cases.
従来、どの程度の誤差が生じるかは、ハードウェア構
成に依存することが大きく、プログラムが同じでも、計
算機によって誤差の程度が異なり、例えば、演算結果が
零の近傍にあった場合には、計算機によっては該演算結
果が零になってしまってプログラム例外が発生し、ユー
ザの期待しない結果となることがあった。Conventionally, how much error occurs depends largely on the hardware configuration. Even if the programs are the same, the degree of error differs depending on the computer. For example, if the operation result is near zero, In some cases, the calculation result becomes zero, and a program exception occurs, which may result in a result that the user does not expect.
これまで、このような数値計算における例外処理,誤
差に対する処理といった、該演算結果に対する統一され
た処理の標準化が遅れていることから、最近のように数
値計算用の応用ソフトウェアのパッケージ化が進むにつ
れて、該パッケージ化された応用ソフトウェアの普及,
及び開発の促進を妨げていた。Until now, standardization of unified processing for the calculation results such as exceptional processing and processing for errors in such numerical calculation has been delayed, so as application software for numerical calculation has recently been packaged, , Spread of the packaged application software,
And hindered the promotion of development.
近年、このような事態を改善することを主な目的とし
て、ユーザ指定が可能な丸めモードや,無限大,非数
(数値でないデータ)といった特殊なオペランドを表現
できる浮動小数点表現形式をもつ規格が米国電気電子工
学協会(IEEE)委員会より提唱され、広く世間に普及し
つつあり、将来的にも、該IEEE規格,或いは、それに準
拠した規格の需要が高まると予想されることから、この
ような規格に十分対処できる浮動小数点演算処理方式が
必要とされる。In recent years, mainly for the purpose of improving such a situation, there is a standard having a rounding mode that can be specified by a user and a floating point representation format that can express a special operand such as infinity and not a number (data that is not a number). Advocated by the Institute of Electrical and Electronics Engineers (IEEE) Committee, it is becoming widespread in the world, and it is expected that the demand for the IEEE standard or standards conforming to it will increase in the future. A floating-point arithmetic processing method capable of coping with various standards is required.
第2図は従来の非正規化数の処理方式を説明する図で
ある。FIG. 2 is a diagram for explaining a conventional denormalized number processing method.
前述のように、米国電気電子工学協会(以下、IEEEと
いう)規格,或いはこれに準拠した2進浮動小数点表現
形式を用いる処理装置においては、指数部の最大値(指
数部を構成する各ビットが全て‘1'),及び最小値(指
数部を構成する各ビットが全て‘0')が、無限大数,NAN
(非数),ゼロ,非正規化数等の特殊な数を表現するた
めに予約されている。As described above, in the processor using the American Institute of Electrical and Electronics Engineers (hereinafter referred to as IEEE) standard or the binary floating point representation format based on this standard, the maximum value of the exponent part (each bit constituting the exponent part is All are "1"), and the minimum value (all bits that make up the exponent part are all "0") is an infinite number, NAN
Reserved for representing special numbers such as (not a number), zero, and denormalized numbers.
このような浮動小数点表現形式の例を第2図(a)に
示す。本図において、Sは符号ビットで、S=0のとき
‘正',S=1のとき‘負’を表し、Eは指数部で実際の
指数eに適当なバイアス値を加えたものである。又、F
は仮数部で2審浮動小数点の小数部を表すビット列で構
成され、正規化数の場合は該仮数部の整数部は暗黙に
‘1'として仮定される。An example of such a floating point representation format is shown in FIG. In the figure, S is a sign bit, which represents'positive 'when S = 0 and'negative' when S = 1, and E is the exponent part with an appropriate bias value added to the actual exponent e. . Also, F
Is a mantissa part and is composed of a bit string representing the fraction part of the second trial floating point. In the case of a normalized number, the integer part of the mantissa part is implicitly assumed to be '1'.
第2図(a)の浮動小数点表現形式は以下のような数
値を表す。The floating point representation format of FIG. 2 (a) represents the following numerical values.
E=2m−1,且つF≠0のとき非数(NAN), E=2m−1,且つF=0のとき(−1)S×∞ ……(±無限大) 0<E<2m−1のとき (−1)S×(1.F)×2E-bias ……(正規化数) E=0,且つF≠0のとき (−1)s×(0.F)×21-bias(非正規化数) E=0,且つF=0のとき(−1)s×0(±0) ここで、0≦E≦2m−1(mは指数部のビット数)で
あり、0<E<2m−1のときは正規化数を表し、biasは
バイアス値である。When E = 2 m −1 and F ≠ 0, it is not a number (NAN), when E = 2 m −1 and F = 0, (−1) S × ∞ ... (± infinity) 0 <E < When 2 m -1 (-1) S x (1.F) x 2 E-bias ... (normalized number) When E = 0 and F ≠ 0 (-1) s x (0.F) × 2 1-bias (unnormalized number) When E = 0 and F = 0 (−1) s × 0 (± 0) where 0 ≦ E ≦ 2 m −1 (m is a bit of the exponent part) Number), and when 0 <E <2 m −1, it represents a normalized number, and bias is a bias value.
このIEEE規格においては、上記のように、E=0(指
数部最小),及びE=2m−1(指数部最大)は無限大,
非数,ゼロ,非正規化数等の特殊な数値を表現する為に
予約されている。In this IEEE standard, as described above, E = 0 (minimum exponent part) and E = 2 m −1 (maximum exponent part) are infinite,
Reserved to represent special numbers such as not-a-number, zero, and denormalized numbers.
そして、非正規化数は、E=0で,且つF≠0である
ことによって認識される。然し、該正規化数の実際の指
数値は正規化数の指数の最小値数(即ち、E=1−バイ
アス)と等しいように定義されている。Then, the denormalized number is recognized by E = 0 and F ≠ 0. However, the actual exponent value of the normalized number is defined to be equal to the minimum number of exponents of the normalized number (ie, E = 1-bias).
上記IEEE規格による浮動小数点演算のオペランドデー
タが非正規化数である場合には、演算モードによって処
理が異なる。When the operand data of the floating point arithmetic according to the IEEE standard is a denormalized number, the processing differs depending on the arithmetic mode.
つまり、無効演算として例外を検出する警告演算モー
ドと,無限の指数範囲を持つものとしてオペランドデー
タの演算前正規化処理を行った中間結果を用いて演算を
実行する正規化演算モードである。That is, there are a warning operation mode in which an exception is detected as an invalid operation, and a normalization operation mode in which an operation is performed using an intermediate result obtained by performing pre-operation normalization processing of operand data as having an infinite exponent range.
通常、浮動小数点演算を高速に処理するデータ処理装
置には、特に、処理速度の高速性が要求される乗算や加
減算などは専用の演算器を備えている。Generally, a data processing device that processes floating-point arithmetic at high speed is provided with a dedicated arithmetic unit especially for multiplication and addition / subtraction that require high processing speed.
然も、オペランドデータは殆どの場合、正規化数と予
測されることから、これらの専用の演算器は、該正規化
数の演算に最適になるように設計されており、特殊なオ
ペランドに対する処理は、専用演算器の処理対象外であ
ることを検出して、別途処理されれば十分である。何故
なら、該特殊なオペランドが処理されることは希であ
り、然も、一般に、特殊なオペランドの処理結果は特殊
な結果を発生するからである。However, since the operand data is expected to be a normalized number in most cases, these dedicated arithmetic units are designed to be optimal for the operation of the normalized number, and processing for a special operand is performed. Suffices to detect that it is not the processing target of the dedicated arithmetic unit and perform the processing separately. This is because the special operand is rarely processed, and in general, the processing result of the special operand produces a special result.
然し、上記の正規化演算モードにおいて、正規化数と
非正規化数の演算,或いは、非正規化数と非正規化数の
演算のような演算を行う場合は、結果として数値が得ら
れることがある為、なるべく高速に処理されることが好
ましいことになる。However, in the above normalization operation mode, when performing operations such as operations on normalized numbers and denormalized numbers, or operations on denormalized numbers and denormalized numbers, numerical values should be obtained as a result. Therefore, it is preferable that the processing is performed as fast as possible.
所が、従来の浮動小数点演算器は、第2図(b)に示
すように、正規化数を対象とした構成になっていた。
尚、本図の演算器は一般的な乗算器の構成を例にしてい
る。However, as shown in FIG. 2B, the conventional floating point arithmetic unit has a configuration for a normalized number.
The arithmetic unit shown in the figure is an example of a general multiplier configuration.
先ず、入力オペランドとして正規化数が供給される
と、符号演算回路1は両オペランドの符号ビット(S1,S
2)の排他的論理和(∀)をとって、乗算結果の符号部S
rとして出力し、仮数演算回路3はオペランド1の整数
部としてL1,小数部としてF1が供給され、又、オペラン
ド2の整数部としてL2,小数部としてF2が供給されて、
両者の積を仮装部演算後正規化回路5へと供給する。First, when a normalized number is supplied as an input operand, the sign arithmetic circuit 1 causes the sign bits (S 1 , S
2 ) The exclusive OR (∀) of
and outputs it as r, and the mantissa arithmetic circuit 3 is supplied with L 1 as the integer part of operand 1 and F 1 as the decimal part, and with L 2 as the integer part of operand 2 and F 2 as the decimal part,
The product of the two is supplied to the normalization circuit 5 after the provisional part calculation.
該仮数部演算後正規化回路5は積の‘0'でないビット
の内、最も重みの大きいビットが小数点の1ビット上位
の位置にくるように該積を、右シフト,又は左シフトす
ることによって演算後正規化を行い、その結果をFrとて
出力すると共に、そのシフト量を指数部演算補正回路4
に送出する。The mantissa post-normalization circuit 5 shifts the product to the right or left so that the bit with the highest weight among the bits that are not "0" of the product comes to the position 1 bit higher than the decimal point. After calculation, normalization is performed, and the result is output as Fr, and the shift amount is calculated as the exponent part correction circuit 4
To send to.
又、指数演算回路2は両オペランドの指数部(E1,
E2)を加算し、そのとき余分に加算された指数バイアス
{通常、浮動小数点データの指数部が正数となるように
実際の指数値に所定のバイアス値(bias)が加算されて
いる}を減算した結果を、上記指数部演算後補正回路4
に送出する。Further, the exponent arithmetic circuit 2 uses the exponent part (E 1 ,
E 2 ) is added, and the exponential bias added at that time {usually, a predetermined bias value (bias) is added to the actual exponent value so that the exponent part of the floating point data is a positive number} The result obtained by subtracting the
To send to.
該指数部演算後補正回路4は上記仮数部演算後正規化
回路5より供給されるシフト量に基づいた指数演算結果
の正規化補正を行って、該乗算結果の指数部Erを出力す
る。The exponent part post-compensation correction circuit 4 performs the normalization correction of the exponent calculation result based on the shift amount supplied from the mantissa part post-normalization circuit 5, and outputs the exponent part Er of the multiplication result.
該指数の演算後補正は、仮数演算結果が上記加数部演
算後正規化回路5により右シフトされた場合は、1ビッ
トのシフトにつき‘+1',左シフトされた場合には、1
ビットのシフトにつき‘−1'だけ指数値を補正すること
によって行われる。The post-computation correction of the exponent is performed by adding "+1" per 1-bit shift when the mantissa calculation result is right-shifted by the post-addition-part normalization circuit 5, and 1 when left-shifted.
This is done by correcting the exponent value by '−1' per bit shift.
尚、実際の乗算回路においては、更に、演算結果の丸
め処理回路(図示せず)、各種例外検出回路(図示せ
ず)が付加されているが、説明の簡単化の為に省略され
ている。Incidentally, in the actual multiplication circuit, a rounding processing circuit (not shown) for the operation result and various exception detection circuits (not shown) are further added, but they are omitted for simplification of description. .
以上のような、従来の乗算器では、入力オペランドが
非正規化数である場合には、その侭では処理することが
できない為、入力オペランドの演算前正規化回路を付加
するか、例えば、ファームウェア等によって演算前正規
化処理を行った後の正規化データを本演算器に供給しな
ければならなかった。In the conventional multiplier as described above, when the input operand is a non-normalized number, it cannot be processed by the scholar, so it is necessary to add a pre-operation normalization circuit for the input operand. Therefore, the normalized data after performing the pre-computation normalization processing by the above-mentioned method must be supplied to the present arithmetic unit.
この為、非正規化数の演算前正規化処理を行ってから
浮動小数点演算を実行すると、該演算前正規化処理の分
だけ余分に処理時間がかかり、一度に1つのオペランド
に対する演算前正規化処理しかできない構成の場合に
は、最悪2つのオペランドの演算前正規化処理の分だけ
処理時間が余分にかかるという問題があった。Therefore, if a floating point operation is executed after performing pre-operation normalization processing of a denormalized number, an extra processing time is required for the pre-operation normalization processing, and pre-operation normalization for one operand at a time is performed. In the case of a configuration capable of performing only processing, there is a problem that the processing time is increased by an amount corresponding to the pre-operation normalization processing of two operands in the worst case.
又、上記の非正規化数の指数部Eは‘0'であるが、実
際の指数値としては、前述のように、正規化数の最小指
数値と同じ大きさを持つ為、演算前の正規化処理によっ
て正規化数に変換する場合には、例えば、‘+1'をして
正規化シフト量を指数部より減算しなければならない。Also, the exponent part E of the above denormalized number is '0', but since the actual exponent value has the same size as the minimum exponent value of the normalized number as described above, When converting to a normalized number by the normalization process, for example, “+1” must be added to subtract the normalized shift amount from the exponent part.
更に、専用演算部に演算前正規化処理回路を付加した
場合には、該専用演算器のハードウェア量の増加と制御
の複雑化という問題があり、上記別途の手段によって演
算前正規化処理を行った結果を該専用演算器に供給する
場合には、該演算器に供給する非正規化数を正規化した
オペランドデータの指数部Eは負数となるので、本来の
正規化数の表現形式(通常、指数部Eは正の整数であ
る)では表現できず、従って、新たな処理モードを追加
しなければならないという問題があり、IEEE規格等の浮
動小数点表現形式の正規化演算モードの実現上の溢路と
なっていた。Further, when the pre-computation normalization processing circuit is added to the dedicated arithmetic unit, there is a problem that the amount of hardware of the dedicated arithmetic unit increases and the control becomes complicated, and the pre-computation normalization processing is performed by the above-mentioned separate means. When the result of the operation is supplied to the dedicated arithmetic unit, the exponent part E of the operand data obtained by normalizing the denormalized number supplied to the arithmetic unit becomes a negative number. Usually, the exponent part E cannot be expressed by a positive integer), and therefore, there is a problem that a new processing mode must be added, and there is a problem in realizing the normalization operation mode of the floating point expression format such as the IEEE standard. It was an overflow road.
本発明は上記従来の欠点に鑑み、IEEE規格,又はこれ
に準拠した2進浮動小数点形式を用いる処理装置におい
て、正規化演算モードでの非正規化数を処理する際での
演算前正規化回路の削除と、非正規化数を含む演算の処
理速度を向上させる非正規化数の処理方式を提供するこ
とを目的とするものである。In view of the above conventional drawbacks, the present invention provides a pre-operation normalization circuit for processing a denormalized number in a normalization operation mode in a processing device using a binary floating point format conforming to the IEEE standard or the IEEE standard. It is an object of the present invention to provide a denormalized number processing method that improves the processing speed of operations including the deletion of and denormalized numbers.
上記の問題点は下記の如くに構成された非正規化数の
処理方式によって解決される。The above problems can be solved by the denormalized number processing method configured as follows.
1ビットの符号部Sと,mビットの指数部Eと,及びn
ビットの仮数部Fとよって、 E=2m−1,且つF≠0のとき、非数(NAN), E=2m−1,且つF=0のとき、(−1)S×∞ ……(±無限大) 0<E<2m−1のとき、 (−1)S×(1.F)×2E-bias ……(正規化数) E=0,且つF≠0のとき (−1)s×(0.F)×21-bias(非正規化数) E=0,且つF=0のとき、(−1)s×0(±0) ここで、biasはバイアス値である。1-bit sign part S, m-bit exponent part E, and n
According to the mantissa part F of a bit, when E = 2 m −1 and F ≠ 0, it is not a number (NAN), when E = 2 m −1 and F = 0, (−1) S × ∞ ... … (± Infinity) 0 <E <2 m −1, (−1) S × (1.F) × 2 E-bias …… (Normalized number) E = 0 and F ≠ 0 (-1) s x (0.F) x 2 1-bias (unnormalized number) When E = 0 and F = 0, (-1) s x 0 (± 0) where bias is the bias It is a value.
をそれぞれ表す浮動小数点形式を持ち、 オペランドデータが上記非正規化数のケースであって
も無限の指数範囲をもつものとして演算する機構を備え
た2進数浮動小数点処理装置において、 2つの入力オペランドデータのそれぞれについて、そ
の指数部Eを構成する全ビットが‘0'であるか否かを検
出する手段を設け、 該手段において、指数部Eが‘0'であると検出された
場合には、対応するオペランドデータ側について、指数
演算部に供給される指数部の値を強制的に‘1'とし、且
つ仮数演算部に供給される1ビットの整数部を‘0'と
し、 該指数部Eの少なくとも1ビットが‘1'である場合に
は、対応するオペランドデータ側について、オペランド
データの指数部をその侭上記指数演算部へ供給し,且つ
仮数演算部に供給される1ビットの整数部を‘1'とし
て、 浮動小数点演算をするように構成する。In a binary floating-point processor having a floating-point format that represents each of the two, and the operand data has a mechanism to operate as having an infinite exponent range even in the case of the above denormalized number, two input operand data For each of the above, a means for detecting whether or not all the bits constituting the exponent part E are '0' is provided, and when the exponent part E is detected as '0' in the means, For the corresponding operand data side, the value of the exponent part supplied to the exponent calculation unit is forcibly set to "1", and the 1-bit integer part supplied to the mantissa calculation unit is set to "0". If at least 1 bit of the operand is '1', the exponent part of the operand data is supplied to the exponent operation part of the corresponding operand data side, and the 1-bit integer part supplied to the mantissa operation part To Configure as '1' to perform floating point arithmetic.
即ち、本発明によれば、IEEE規格,又はこれに準拠す
る浮動小数点表現形式の処理装置における浮動小数点デ
ータの演算処理部においては、オペランドデータが非正
規化数であっても、中間結果の精度を十分に確保すれ
ば、演算前正規化処理を行わないで演算した結果を演算
後正規化処理をすることで正しい結果を得ることができ
る。又、非正規化数の指数値は正規化数の最小指数値と
同じとしているが、数値の表現上は非正規化の指数部は
‘0'であり、正規化数の指数部は‘1'であり、更に、非
正規化数の仮数の整数部は‘0'であり、正規化数の仮数
の整数部は‘1'であることに着目し、本発明において
は、オペランドデータの指数部Eが最小値(=0)であ
るか否かを検出して、該E≠0の場合には、オペランド
データの指数部Eを、その侭指数演算部に供給すると共
に、仮数部の上位にある1ビットの暗黙の整数部を‘1'
として仮数演算回路に供給し、該E=0の場合には、オ
ペランドデータの指数部Eの最下位ビットを強制的に
‘1'として指数演算部に供給すると共に、仮数部の上位
にある1ビットの暗黙の整数部を‘0'として仮数演算回
路に供給する手段を設けることによって、該オペランド
データが非正規化数であっても、演算前正規化処理を行
うことなく浮動小数点演算を実行するようにしたもので
あるので、正規化数の処理に最適に設計された演算器を
大幅に改造することなく、非正規化数のオペランドを処
理することができ、演算前正規化処理に必要なハードウ
ェア量,及び処理時間を節約することができることか
ら、IEEE規格等での正規化演算モードにおける非正規化
数に対する演算処理がハードウェア量的にも、時間的に
も大幅に改善できる効果がある。That is, according to the present invention, even if the operand data is a denormalized number, the precision of the intermediate result can be reduced in the arithmetic processing unit of the floating point data in the processing device of the floating point representation format conforming to the IEEE standard. Is sufficiently secured, the correct result can be obtained by performing the post-operation normalization processing on the result calculated without performing the pre-operation normalization processing. Although the exponent value of the denormalized number is the same as the minimum exponent value of the normalized number, the denormalized exponent part is '0' and the exponent part of the normalized number is '1'. ', Further, the integer part of the mantissa of the denormalized number is'0', the integer part of the mantissa of the normalized number is' 1 ', in the present invention, the exponent of the operand data It is detected whether or not the part E is the minimum value (= 0), and when E ≠ 0, the exponent part E of the operand data is supplied to the sagittal exponent operation part and the upper part of the mantissa part. 1-bit implicit integer part in
Is supplied to the exponent arithmetic circuit, and when E = 0, the least significant bit of the exponent E of the operand data is forcibly supplied as '1' to the exponentiation arithmetic unit, and at the same time, it is 1 above the mantissa. By providing a means to supply the mantissa arithmetic circuit with the implicit integer part of the bit set to '0', even if the operand data is a denormalized number, floating point arithmetic is executed without performing pre-operation normalization processing. It is possible to process denormalized operands without major modification of the arithmetic unit designed optimally for normalized number processing, and it is necessary for pre-normalization processing. Since the amount of hardware and processing time can be saved, the arithmetic processing for denormalized numbers in the normalized arithmetic mode according to the IEEE standard, etc. can be significantly improved both in terms of hardware and time. But You.
以下本発明の実施例を図面によって詳述する。 Embodiments of the present invention will be described in detail below with reference to the drawings.
第1図は本発明の一実施例を示した図であって、オペ
ランドデータの指数部Eが最小値(E=0)であるか否
かを検出する回路(E1=0検出回路,E2=0検出回路)6
0,61,及び,その検出出力を指数演算回路2,仮数演算回
路3へ供給する手段7,8が本発明を実施するのに必要な
手段である。尚、全図を通して同じ符号を同じ対象物を
示している。FIG. 1 is a diagram showing an embodiment of the present invention, which is a circuit for detecting whether or not the exponent part E of the operand data is the minimum value (E = 0) (E 1 = 0 detection circuit, E 1 2 = 0 detection circuit) 6
0, 61 and means 7, 8 for supplying the detection output thereof to the exponential arithmetic circuit 2 and the mantissa arithmetic circuit 3 are means necessary for carrying out the present invention. The same reference numerals denote the same objects throughout the drawings.
以下、第2図(a)に示した浮動小数点表現形式の例
を参照しながら、第1図によって、本発明の非正規化数
の処理方式を説明する。Hereinafter, the denormalized number processing method of the present invention will be described with reference to FIG. 1 with reference to the example of the floating point representation format shown in FIG.
本実施例においても、説明の便宜上、乗算回路を例に
して説明する。Also in the present embodiment, for convenience of explanation, a multiplication circuit will be described as an example.
本発明を実施しても、浮動小数点データの乗算処理の
基本的な動作は特に変わることはないので省略し、ここ
では、指数演算回路2,及び仮数演算回路3へのオペラン
ドデータの入力方式を中心にして説明する。Even if the present invention is implemented, the basic operation of the multiplication processing of floating-point data does not change in particular, so it is omitted. Here, the input method of the operand data to the exponent arithmetic circuit 2 and the mantissa arithmetic circuit 3 is described. I will explain mainly.
本発明の浮動小数点乗算回路は、第2図の従来の浮動
小数点乗算回路に、前述のE1=0検出回路60,及びE2=
0検出回路61が付加され、該検出回路60,61の出力によ
って指数演算回路2,及び仮数演算回路3に供給されるオ
ペランドデータが制御される以外は従来と同じである。The floating-point multiplication circuit of the present invention is the same as the conventional floating-point multiplication circuit of FIG. 2 except that E 1 = 0 detection circuit 60 and E 2 =
It is the same as the conventional one except that the 0 detection circuit 61 is added and the operand data supplied to the exponent calculation circuit 2 and the mantissa calculation circuit 3 are controlled by the outputs of the detection circuits 60, 61.
先ず、オペランド1について、E1=0の場合には、本
発明のE1=0検出回路60の出力結果が‘1'になることに
より、指数演算回路2に供給されるE1はE1=1に強制さ
れ、仮数演算回路3に供給されるL1は、否定回路7によ
って、L1=0となる。First, with respect to operand 1, when E 1 = 0, the output result of the E 1 = 0 detection circuit 60 of the present invention becomes '1', so that E 1 supplied to the exponential calculation circuit 2 is E 1 L 1 which is forced to = 1 and is supplied to the mantissa arithmetic circuit 3 becomes L 1 = 0 by the negating circuit 7.
又、該オペランド1のE1≠0の場合は、上記E1=0検
出回路60の出力結果が‘0'になることにより、指数演算
回路2には、該E1の値がセレクト8を介してその侭供給
され、仮数演算回路3に供給されるL1は、否定回路7に
よって、L1=1となる。When E 1 ≠ 0 of the operand 1, the output result of the E 1 = 0 detection circuit 60 becomes '0', and thus the exponent calculation circuit 2 selects the value of E 1 as select 8. L 1 supplied to the mantissa calculation circuit 3 through the shadow circuit is L 1 = 1 by the negation circuit 7.
オペランド2についても同様に、E2=0の場合には、
本発明のE2=0検出回路61の出力結果が‘1'になること
により、指数演算回路2に供給されるE2はE2=1に強制
され、仮数演算回路3に供給されるL2は、否定回路7に
よって、L2=0となる。Similarly for operand 2, if E 2 = 0,
When the output result of the E 2 = 0 detection circuit 61 of the present invention becomes '1', E 2 supplied to the exponential calculation circuit 2 is forced to E 2 = 1 and supplied to the mantissa calculation circuit 3. 2 becomes L 2 = 0 by the negation circuit 7.
又、該オペランド2のE2≠0の場合は、上記のE2=0
検出回路61の出力結果が‘0'になることにより、指数演
算回路2には、該E2の値がセレクト8を介してその侭供
給され、仮数演算回路3に供給されるL2は、否定回路7
によって、L2=1となる。If E 2 ≠ 0 of the operand 2, the above E 2 = 0
When the output result of the detection circuit 61 becomes “0”, the value of E 2 is supplied to the exponential calculation circuit 2 via the select 8 and L 2 supplied to the mantissa calculation circuit 3 is Negation circuit 7
Therefore, L 2 = 1.
この結果、前述の、IEEE規格等で定義されている正規
化数,非正規化数が、演算前処理を行うことなく生成さ
れて、従来の、例えば、浮動小数点乗算回路に入力さ
れ、演算される。As a result, the above-described normalized numbers and denormalized numbers defined by the IEEE standard are generated without performing pre-processing, and are input to a conventional floating-point multiplication circuit and operated. It
上記の乗算においては、正規化数だけを対象とした場
合には、仮数演算結果Zは、上記の定義から4>Z≧1
である(例えば、4>1.XXXX…×1.XXXX>1である)の
で、演算後正規化処理は、Z≧2の場合には、高々右へ
1ビットシフトするのみで事足りるが、非正規化数をも
演算対象とすると、4>Z>0となる為、1>Z>0の
場合(即ち、1>0.1XXXX…×0.1XXXX…>0であること
による)の左シフト機構が必要となる。即ち、この場合
には、該乗算結果Zが、例えば、0.0001XXXであると、
3ビットの左シフトが必要となる。In the above multiplication, when only the normalized number is targeted, the mantissa operation result Z is 4> Z ≧ 1 from the above definition.
Since (for example, 4> 1.XXXX ... × 1.XXXX> 1), the post-computation normalization process is sufficient if at most Z is shifted by 1 bit to the right, but not. If the normalized number is also a calculation target, 4>Z> 0, and therefore the left shift mechanism in the case of 1>Z> 0 (that is, 1> 0.1XXXX ... × 0.1XXXX ...> 0) Will be needed. That is, in this case, if the multiplication result Z is, for example, 0.0001XXX,
A 3-bit left shift is required.
この左シフト機構として、当該乗算器の上記仮数部演
算後正規化回路5には、該左シフト機構を持たせない
で、該演算後正規化による左シフトが必要な場合には、
該乗算器の演算後正規化前の中間結果Zを読み出し、例
えば、汎用シフタ機構と、汎用指数演算器を用いて演算
後正規化処理を行う方法が考えられるが、このような場
合でも、本発明を適用できることはいう迄もないことで
ある。As the left shift mechanism, if the mantissa post-operation normalization circuit 5 of the multiplier is not provided with the left shift mechanism, and a left shift by the post-operation normalization is required,
A method of reading the intermediate result Z after the operation of the multiplier and before the normalization and performing the post-operation normalization processing by using, for example, a general-purpose shifter mechanism and a general-purpose exponential arithmetic unit can be considered. It goes without saying that the invention can be applied.
又、上記の例では非正規化数に対する演算を例にして
説明したが、非正規化数以外の「無限大」「非数」「ゼ
ロ」についても、特に非正規化数と区別することなく、
本発明の浮動小数点演算器に投入し、別途ファームウェ
ア等で処理した結果(この場合の演算結果は、該IEEE規
格により、明確に決定することができる)に基づいて、
該演算器の結果に対する扱い、例えば、無視するか否か
を決定することで、全てのケースについて該IEEE規格に
よる浮動小数点演算を高速に行うことができる。Further, in the above example, the operation for denormalized numbers has been described as an example, but "infinity", "not a number", and "zero" other than denormalized numbers are not particularly distinguished from denormalized numbers. ,
Based on the result of being thrown into the floating point arithmetic unit of the present invention and separately processed by firmware or the like (the arithmetic result in this case can be definitely determined by the IEEE standard),
By handling the result of the arithmetic unit, for example, deciding whether or not to ignore it, the floating point arithmetic according to the IEEE standard can be performed at high speed in all cases.
このように、本発明は、IEEE規格,或いはこれに準拠
した2進浮動小数点表現形式を用いる浮動小数点処理装
置における非正規化数の処理方式において、該IEEE規格
では正規化数,及び非正規化数等が厳密に定義されてお
り、オペランドデータが非正規化数であっても、中間結
果の精度を十分に確保すれば、演算前正規化処理を行わ
ずに演算した結果を演算後正規化することで正しい結果
を得ることができることに着目し、非正規化数であるか
否かを検出する為の、オペランドデータの指数部が最少
値(E=0)であるか否かを検出して、その結果出力に
よって浮動小数点演算器へのオペランドデータの入力を
制御し、正規化数以外のオペランドについても演算前正
規化処理を行うことなく統一的に浮動小数点演算をでき
るようにした所に特徴がある。As described above, the present invention relates to a denormalized number processing method in a floating point processing apparatus that uses the IEEE standard or a binary floating point representation format based on the IEEE standard. Even if the numbers are strictly defined and the operand data is a denormalized number, if the precision of the intermediate result is sufficiently secured, the result calculated without the pre-operation normalization processing will be normalized after the operation. Paying attention to the fact that a correct result can be obtained by doing so, it is detected whether the exponent part of the operand data is the minimum value (E = 0) for detecting whether it is a denormalized number or not. The output of the result controls the input of operand data to the floating-point arithmetic unit, and it is possible to perform unified floating-point arithmetic without performing pre-operation normalization processing on operands other than normalized numbers. Characteristic A.
以上、詳細に説明したように、本発明の非正規化数の
処理方式は、IEEE規格,或いはこれに準拠した2進浮動
小数点表現形式を用い、オペランドデータが上記非正規
化数のケースであっても無限の指数範囲をもつものとし
て演算する機構を備えた2進数浮動小数点処理装置にお
いて、 2つの入力オペランドデータのそれぞれについて、そ
の指数部Eを構成する全ビットが‘0'であるか否かを検
出する手段を設け、該指数部Eが‘0'であると検出され
た場合には、相応するオペランドデータ側について、指
数演算部に供給される指数部の値を強制的に‘1'とし、
且つ仮数演算部に供給される1ビットの整数部を‘0'と
し、該指数部Eの少なくとも1ビットが‘1'である場合
には、対応するオペランドデータ側について、オペラン
ドデータの指数部をその侭上記指数演算部へ供給し,且
つ仮数演算部に供給される1ビットの整数部を‘1'とし
て演算するようにしたものであるので、正規化数の処理
に最適に設計された演算器を大幅に改造することなく、
非正規化数のオペランドを処理することができるので、
演算前正規化処理に必要なハードウェア量,及び処理時
間を節約することができ、IEEE規格等での正規化演算モ
ードにおける非正規化数に対する演算処理がハードウェ
ア量的にも、時間的にも大幅に改善できる効果がある。As described above in detail, the denormalized number processing method of the present invention uses the IEEE standard or the binary floating point representation format conforming to the IEEE standard, and the operand data is the above denormalized number. However, in a binary floating-point processor having a mechanism for operating as having an infinite exponent range, whether or not all the bits forming the exponent part E of each of the two input operand data are "0". If the exponent E is detected to be "0", the exponent value supplied to the exponent calculator is forcibly set to "1" for the corresponding operand data side. 'age,
Further, when the 1-bit integer part supplied to the mantissa operation unit is set to '0' and at least 1 bit of the exponent part E is '1', the exponent part of the operand data is set to the corresponding operand data side. Since the 1-bit integer part supplied to the exponent operation part and the mantissa operation part is operated as '1', the operation designed optimally for the processing of normalized numbers is performed. Without major remodeling of the vessel,
It can handle denormalized operands, so
The amount of hardware required for pre-computation normalization processing and the processing time can be saved, and the arithmetic processing for denormalized numbers in the normalization arithmetic mode in the IEEE standard etc. can be performed in terms of both hardware volume and time. There is an effect that can be greatly improved.
第1図は本発明の一実施例を示した図, 第2図は従来の非正規化数の処理方式を説明する図, である。 図面において、 1は符号演算回路(∀),2は指数演算回路, 3は仮数演算回路, 4は指数部演算後正規化回路,又は、演算後正規化補正
回路, 5は仮数部演算後正規化回路, 60はE1=0検出回路,61はE2=0検出回路, 7は否定回路,8はセレクタ, S1,S2,Sは符号ビット, E1,E2,Eは指数部, F1,F2,Fは仮数部,又は、その小数部, L1,L2は仮数部の整数部, をそれぞれ示す。FIG. 1 is a diagram showing an embodiment of the present invention, and FIG. 2 is a diagram for explaining a conventional denormalized number processing system. In the drawings, 1 is a sign arithmetic circuit (∀), 2 is an exponential arithmetic circuit, 3 is a mantissa arithmetic circuit, 4 is a post-exponential arithmetic normalization circuit, or a post-arithmetic normalization correction circuit, 5 is a post-mantissa arithmetic normal Circuit, 60 is an E 1 = 0 detection circuit, 61 is an E 2 = 0 detection circuit, 7 is a negation circuit, 8 is a selector, S 1 , S 2 , S are sign bits, E 1 , E 2 , E are exponents Parts, F 1 , F 2 , and F represent the mantissa part, or the fractional part thereof, and L 1 and L 2 represent the integer part of the mantissa part, respectively.
Claims (1)
と,nビットの仮数部Fとによって、 E=2m−1,且つF≠0のとき、非数(NAN), E=2m−1,且つF=0のとき、(−1)5×∞ ……(±無限大) 0<E<2m−1のとき、 (−1)S×(1.F)×2E-bias ……(正規化数) E=0,且つF≠0のとき、 (−1)s×(0.F)×21-bias(非正規化数) E=0,且つF=0のとき、(−1)s×0(±0) ここで、biasはバイアス値を示す。 をそれぞれ表す浮動小数点形式を持ち、 オペランドデータが上記非正規化数のケースであっても
無限の指数範囲をもつものとして演算する機構を備えた
2進数浮動小数点処理装置において、 2つの入力オペランドデータのそれぞれについて、その
指数部Eを構成する全ビットが‘0'であるか否かを検出
する手段(60,61)を設け、 該手段(60,61)において、指数部Eが‘0'であると検
出された場合には、対応するオペランドデータ側におい
て、指数演算部(2)に供給される指数部の値を強制的
に‘1'とし、且つ仮数演算部(3)に供給される1ビッ
トの整数部を‘0'とし、 該指数部Eの少なくとも1ビットが‘1'である場合に
は、対応するオペランドデータ側について、オペランド
データの指数部をその侭上記指数演算部(2)へ供給
し,且つ仮数演算部(3)に供給される1ビットの整数
部を‘1'として、 浮動小数点の演算をすることを特徴とする非正規化数の
処理方式。1. A 1-bit sign part S and an m-bit exponent part E
, And the n-bit mantissa F, if E = 2 m −1 and F ≠ 0, not a number (NAN), if E = 2 m −1, and F = 0, (−1) 5 × ∞ …… (± infinity) 0 <E <2 m −1, (−1) S × (1.F) × 2 E-bias …… (normalized number) E = 0 and F ≠ When 0, (−1) s × (0.F) × 2 1-bias (unnormalized number) When E = 0 and F = 0, (−1) s × 0 (± 0) where , Bias indicates a bias value. In the binary floating-point processor, which has a floating-point format that represents each of the two, and has a mechanism that operates as if the operand data had an infinite exponent range even in the case of the above denormalized number, two input operand data Means (60, 61) for detecting whether or not all the bits constituting the exponent part E are '0', and the exponent part E is '0' in the means (60, 61). If it is detected that the value of the exponent part supplied to the exponent operation part (2) is forced to be “1” on the corresponding operand data side, and is also supplied to the mantissa operation part (3). When the 1-bit integer part is 0, and at least 1 bit of the exponent part E is '1', the exponent part of the operand data for the corresponding operand data side is the exponent operation part 2) and mantissa performance Part of the integer part of 1 bit supplied to (3) as '1', a denormalized number of processing method characterized by the floating-point operation.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP63113166A JP2517064B2 (en) | 1988-05-10 | 1988-05-10 | Denormalized number processing method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP63113166A JP2517064B2 (en) | 1988-05-10 | 1988-05-10 | Denormalized number processing method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH01282633A JPH01282633A (en) | 1989-11-14 |
| JP2517064B2 true JP2517064B2 (en) | 1996-07-24 |
Family
ID=14605225
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP63113166A Expired - Fee Related JP2517064B2 (en) | 1988-05-10 | 1988-05-10 | Denormalized number processing method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2517064B2 (en) |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2622012B2 (en) * | 1990-05-17 | 1997-06-18 | 甲府日本電気株式会社 | Shift circuit |
| JP2513354B2 (en) * | 1990-10-17 | 1996-07-03 | 日本電気株式会社 | Floating point arithmetic auxiliary circuit |
| US5513362A (en) * | 1992-04-23 | 1996-04-30 | Matsushita Electric Industrial Co., Ltd. | Method of and apparatus for normalization of a floating point binary number |
| US7346643B1 (en) * | 1999-07-30 | 2008-03-18 | Mips Technologies, Inc. | Processor with improved accuracy for multiply-add operations |
-
1988
- 1988-05-10 JP JP63113166A patent/JP2517064B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPH01282633A (en) | 1989-11-14 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP3076046B2 (en) | Exception detection circuit | |
| US8626813B1 (en) | Dual-path fused floating-point two-term dot product unit | |
| US8402078B2 (en) | Method, system and computer program product for determining required precision in fixed-point divide operations | |
| US5010508A (en) | Prenormalization for a floating-point adder | |
| JP3178746B2 (en) | Format converter for floating point numbers | |
| US5341320A (en) | Method for rapidly processing floating-point operations which involve exceptions | |
| JP3313560B2 (en) | Floating point processor | |
| US7720898B2 (en) | Apparatus and method for adjusting exponents of floating point numbers | |
| CN118819465B (en) | Floating-point data floating-point multiplication and addition operation method, device, electronic device and storage medium | |
| EP3647939A1 (en) | Arithmetic processing apparatus and controlling method therefor | |
| US5337265A (en) | Apparatus for executing add/sub operations between IEEE standard floating-point numbers | |
| JP4388543B2 (en) | 3-input floating-point adder / subtracter | |
| JP2517064B2 (en) | Denormalized number processing method | |
| US20070038693A1 (en) | Method and Processor for Performing a Floating-Point Instruction Within a Processor | |
| US5838601A (en) | Arithmetic processing method and arithmetic processing device | |
| JP3174974B2 (en) | Floating point arithmetic device and method | |
| JPS63158626A (en) | Arithmetic processing unit | |
| JP2723707B2 (en) | Normalization circuit | |
| JP3229057B2 (en) | Exception handling device | |
| JPH0498524A (en) | Floating point arithmetic unit | |
| JPH05204606A (en) | Floating point arithmetic system and unit | |
| JP3124286B2 (en) | Floating point arithmetic unit | |
| JP3522387B2 (en) | Pipeline arithmetic unit | |
| JPH0383126A (en) | Floating-point multiplier | |
| JP2530504B2 (en) | Floating point arithmetic unit |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| LAPS | Cancellation because of no payment of annual fees |