JPH02115926A - Floating point normalizing and rounding device - Google Patents

Floating point normalizing and rounding device

Info

Publication number
JPH02115926A
JPH02115926A JP63269895A JP26989588A JPH02115926A JP H02115926 A JPH02115926 A JP H02115926A JP 63269895 A JP63269895 A JP 63269895A JP 26989588 A JP26989588 A JP 26989588A JP H02115926 A JPH02115926 A JP H02115926A
Authority
JP
Japan
Prior art keywords
mantissa
rounding
signal
pattern
output
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP63269895A
Other languages
Japanese (ja)
Inventor
Katsuhiko Ueda
勝彦 上田
Mikako Yamauchi
山内 美加子
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 JP63269895A priority Critical patent/JPH02115926A/en
Publication of JPH02115926A publication Critical patent/JPH02115926A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To accelerate processing speed and to compress the scale of hardware by generating data for rounding in parallel with the normalization processing of a mantissa. CONSTITUTION:The normalization processing is performed by counting the number of preceding zeros of the mantissa fu111 at a preceding zero detection circuit 11. A barrel shifter 10 is operated based on a counted result, and the mantissa fn120 is generated by performing the normalization processing of the mantissa fu111. Also, the complement of an exponent is performed by operating an adder 23 and a complementor 22, then, the exponent er131 is generated. Also, a rounding processing is performed by generating a bit required for the judgement of rounding from the mantissa fu111 before normalization in a form corresponding to destination size at an LSB/R/S generation circuit 18. Then, the judgement of rounding is performed at a rounding judging circuit 19 based on those bits, and the addition of a rounding signal generated in the above judgement on the mantissa fn120 is performed at an adder 20.

Description

【発明の詳細な説明】 産業上の利用分野 本発明は浮動小数点演算において、演算結果の正規化処
理と丸め処理を行なう浮動小数点正規化丸め装置に関す
るものである。
DETAILED DESCRIPTION OF THE INVENTION FIELD OF INDUSTRIAL APPLICATION The present invention relates to a floating-point normalization and rounding device that performs normalization and rounding of operation results in floating-point arithmetic.

従来の技術 演算後に正規化とそれに続く丸め処理を行なう浮動小数
点演算では、正規化された仮数部を丸めた時点で仮数部
オーバーフローが発生する場合がある。この場合、さら
に仮数部右シフト及び指数。
In conventional floating point operations in which normalization and subsequent rounding are performed after an operation, a mantissa overflow may occur when the normalized mantissa is rounded. In this case, further right shift the mantissa and exponent.

インクリメント操作による補正が必要になり、高速演算
の妨げとなる。そこでこの補正を高速化することを実現
した従来の浮動小数点丸め正規化装置としては、例えば
特開昭Ego−97438号公報に示されている。本従
来例は、正規化した結果が1.111・φ・11であり
かつ丸めを行なう場合を検出し、この場合、仮数部の丸
めは実際には行なわず、別に設けたレジスタ内に予め設
定した1、000・・・00を出力し、指数部は実際に
1インクリメントして補正を行なうものである。
Correction by increment operation is required, which hinders high-speed calculation. A conventional floating-point rounding and normalization device that can speed up this correction is disclosed, for example, in Japanese Patent Laid-Open No. Sho Ego-97438. This conventional example detects a case where the normalized result is 1.111・φ・11 and rounding is to be performed, and in this case, the mantissa is not actually rounded, but is set in advance in a separately provided register. 1,000...00 is output, and the exponent part is actually incremented by 1 for correction.

また丸め処理に必要なデータの生成は、仮数部正規化手
段の後にこの正規化した仮数から生成する手段を設ける
ことで処理していた。この生成手段の従来例としては、
例えばから特開昭62−226226号公報の発明の一
構成要素として、正規用バレルシフタの直後におかれた
ビットパターン検出回路がある。この回路はディストネ
ーションサイズの仮数の最下位ビットより1ビツト下位
のビットから、丸め処理に必要なデータを生成するもの
である。
Furthermore, generation of data necessary for rounding processing has been performed by providing means for generating data from the normalized mantissa after the mantissa normalizing means. Conventional examples of this generation means include:
For example, one component of the invention disclosed in Japanese Patent Laid-Open No. 62-226226 is a bit pattern detection circuit placed immediately after the regular barrel shifter. This circuit generates data necessary for rounding processing from the bit one bit lower than the least significant bit of the mantissa of the destination size.

発明が解決しようとする課題 しかしながら前者の従来例では、補正が必要な場合を検
出した時、仮数部はすぐに補正結果が出力できるが、指
数部はこの時点からさらに補正演算が必要であり、また
補正結果の仮数1.000・・・00を格納しておくた
めのレジスタも必要である、という問題点を有していた
Problem to be Solved by the Invention However, in the former conventional example, when a case where correction is necessary is detected, the correction result can be output immediately for the mantissa part, but the exponent part requires further correction calculation from this point on. Another problem is that a register is also required to store the mantissas 1.000...00 of the correction results.

また、後者の従来例は、丸めデータ生成のためのアルゴ
リズムが簡単である場合にはその処理時間はさほど問題
にならない。しかし、アイ・イー・イー・イー ピー・
754 (IEEE  P754)規格にそった丸めア
ルゴリズムに従う場合は正規化された仮数の下位側複数
ビットの論理和をとる必要があり、丸めデータ生成に要
する処理時間は長くなる。そこで従来例のように正規化
後に丸めデータ生成を行なうと、この丸めデータ生成時
間により全体の処理時間が長くなるという問題点を有し
ていた。
Furthermore, in the latter conventional example, if the algorithm for generating rounded data is simple, the processing time is not a big problem. However, I.E.E.P.
When a rounding algorithm conforming to the G.754 (IEEE P754) standard is followed, it is necessary to OR the lower bits of the normalized mantissa, which increases the processing time required to generate rounded data. Therefore, when rounding data is generated after normalization as in the conventional example, there is a problem in that the overall processing time becomes longer due to the rounding data generation time.

本発明はかかる点に鑑み、処理速度が速くかつハードウ
ェア規模も小さい浮動小数点丸め正規化装置を提供する
ことを目的とする。
In view of this, an object of the present invention is to provide a floating-point rounding normalization device that has high processing speed and small hardware scale.

課題を解決するための手段 正規化されていない仮数部及びこれに対応する指数部か
らなる浮動小数点数のうち、仮数部を入力とし正規化に
必要なシフト数を求める第1の手段と、前記仮数部を入
力とし、丸め用データを出力する第2の手段と、前記仮
数部及び前記第2の手段の出力から、前記仮数部の正規
化及びその後の丸め処理を行なうと仮数部オーバーフロ
ーが発生ずる場合を検出する第3の手段と、前記第1の
手段、前記第3の手段の出力から、前記仮数部を丸めた
状態で正規化数とするのに必要なシフト数を決定しこれ
出力する第4の手段と、前記仮数部を入力とし、前記第
4の手段の出力に従ってシフトを行なうシフト手段と、
前記第4の手段の出力に従って前記指数部を補正する補
正手段と、前記第2の手段の出力に従って、前記シフト
手段の出力に丸め処理を施す丸め手段を備えた浮動小数
点正規化丸め装置である。
Means for Solving the Problem A first means for obtaining the shift number necessary for normalization by inputting the mantissa part of a floating point number consisting of an unnormalized mantissa part and an exponent part corresponding thereto; A second means takes the mantissa as input and outputs rounding data, and when the mantissa is normalized and the subsequent rounding process is performed from the mantissa and the output of the second means, mantissa overflow occurs. a third means for detecting a case in which the occurrence occurs, and from the outputs of the first means and the third means, determine the number of shifts necessary to make the mantissa rounded into a normalized number, and output this. a fourth means for inputting the mantissa part and shifting according to the output of the fourth means;
A floating point normalization rounding device comprising a correction means for correcting the exponent part according to the output of the fourth means, and a rounding means for rounding the output of the shift means according to the output of the second means. .

作   用 本発明は前記した構成により、前記第1の手段で仮数正
規化に必要なシフト数を求め、これと並行して前記第2
の手段で正規化されていない仮数部から丸め用データを
求める。また前記第3の手段で、前記仮数部のビットパ
ターン及び前記第2の手段の出力から仮数正規化後に丸
め処理を行なうと仮数部オーバーフローが発生する場合
を検出する。そして前記第4の手段で、前記第1の手段
、前記第3の手段の出力から、前記仮数部を丸めた状態
で正規化数とするのに必要なシフト数を決定し、これに
基づき前記シフト手段では仮数のシフトを、前記補正手
段では指数の補正を行なう。そして前記丸め手段で、前
記第2の手段の出力により前記シフト手段の出力を丸め
、最終的に正規化数である丸められた仮数を…力するこ
とができるものである。
Operation The present invention has the above-described configuration, in which the first means calculates the shift number necessary for mantissa normalization, and in parallel with this, the second means calculates the shift number necessary for mantissa normalization.
Find the rounding data from the unnormalized mantissa using the following method. Further, the third means detects, from the bit pattern of the mantissa and the output of the second means, a case where a mantissa overflow occurs when rounding is performed after mantissa normalization. Then, the fourth means determines, from the outputs of the first means and the third means, the number of shifts necessary to obtain a normalized number with the mantissa rounded, and based on this, the The shift means shifts the mantissa, and the correction means corrects the exponent. The rounding means rounds the output of the shifting means using the output of the second means, and finally outputs a rounded mantissa which is a normalized number.

実施例 第1図は本発明の一実施例のブロック図を示すものであ
る。
Embodiment FIG. 1 shows a block diagram of an embodiment of the present invention.

本実施例の浮動小数点正規化丸め装置に入力される浮動
小数点数のフォーマットを、第11図に示す。第11図
のフォーマットはアイ・イー・イー・イー ビーフ54
 (IEEE  P754)規格に従って演算され、次
に正規化及び丸め処理を受ける倍精度浮動小数点数であ
り、110は、・バイアス表現された11ビツトの指数
e、111は、21〜2−62の重みをもつビットf+
”f−saと、2−63 2−64の重みをもつガード
ビット(以下Guと記す)、ラウンドビット(以下R,
と記す)、及びステイッキビット(以下S。と記す)の
57ビツトから構成される仮数fuである。112は、
仮数の符号を示す符号ビットSuであり、0で正数を−
1で負数を示す。
FIG. 11 shows the format of the floating point number input to the floating point normalization rounding device of this embodiment. The format of Figure 11 is IEE Beef 54
(IEEE P754) is a double-precision floating point number that is operated according to the standard and then normalized and rounded, where 110 is an 11-bit exponent e expressed as a bias, and 111 is a weight of 21 to 2-62. bit f+ with
``f-sa, a guard bit (hereinafter referred to as Gu) with a weight of 2-63 2-64, and a round bit (hereinafter referred to as R,
This is a mantissa fu consisting of 57 bits (hereinafter referred to as S) and sticky bits (hereinafter referred to as S). 112 is
The sign bit Su indicates the sign of the mantissa, and 0 indicates a positive number -
1 indicates a negative number.

第1図において、10は、仮数部Ll 11を入力とし
て正規化シフト処理を行なうバレルシフタであり、第1
2図に示した最上位ビットが2−の重みをもつビット、
最下位ビットが2°62の重みをもつビットとなる仮数
f、120を出力する。11は、仮数部fu111のf
llo、JlRulSuを除く全てのビットを入力とし
、第3図に示すように先行する零の数をカウントしその
結果αを2進数で出力する先行零検出回路である。12
は、第14図に示すように、仮数部f、111のf1〜
f−s+が全て1である場合にのみ・lとなるパターン
As検出信号と、f、〜f−82が全て1である場合に
のみ1となるパターンAs検出信号を出力するパターン
A検出回路、13は、第15図に示すように、仮数部f
、111のflが0、T O” f−112が全て1で
ある場合にのみ1となるパターンBD検出信号、flが
01f s” f−23が全て1である場合にのみ1と
なるパターンBSIe4出信号を出力するパターンB検
出回路、14は、第16図に示すように、仮数部f、1
11のf4、fsが01f’−+〜f−st及びGUが
全て1である場合にのみ1となるパターンCD検出信号
、f+、feが01f−+〜f−警aが全て1である場
合にのみ1となるパターンC8検出信号を出力するパタ
ーンC検出回路である。15は、第7図に示すように、
外部から与えられるディストネーシ日ソサイズ信号が単
精度を指示している場合は、パターンA検出回路12か
らはパターンAs検出信号、パターンB検出回路13か
らはパターンAs検出信号、パターンC検出回路14か
らはパターンC8検出信号を選択して、それぞれパター
ンA検出信号、パターンB検出信号、パターンC検出信
号として出力し、外部から与えられるディストネーシ日
ソサイズ信号が倍精度を指示している場合は、パターン
A検出回路12からはパターンAs検出信号、パターン
C検出回路13からはパターンBD検出信号、パターン
C検出回路14からはパターンCD1o4出信号を選択
し、それぞれパターンA検出信号、パターンB検出信号
、パターンC検出信号として出力するマルチプレクサで
ある。16は、仮数部f、111の上位3ビツトである
f11f@、f−+を入力としf1=1である場合にの
み1となるセレクトA信号、(f+−f++)=(0,
1)である場合にのみ1となるセレクトB信号、(f+
、fa、f−+)=(0,0,1)である場合にのみ1
となるセレクトC信号を出力する上位3ビツトパターン
検出回路、17は、仮数部f、111のf−26〜Sl
、の論理和を求めステイッキビット信号SSを出力する
ステイッキビット生成回路、18は、仮数部fu111
のf−ass  f−*a、f−36、f−s*、G工
、Ru、Sul  ステイッキビット生成回路17の出
力であるステイッキビット信号S、、及び上位・3ビ・
ットパターン検出回路16の出力であるセレクトA、 
 81Cを信号を入力とし、外部から与えられるディス
トネーシeンサイズ信号に沿って、第8図に示すように
LSBl R,Sの信号を出力するLSB、R,S生成
回路である。19は、LSB。
In FIG. 1, 10 is a barrel shifter that performs normalization shift processing with the mantissa part Ll 11 as input;
The most significant bit shown in Figure 2 has a weight of 2-,
A mantissa f, 120, whose least significant bit is a bit with a weight of 2°62 is output. 11 is f of the mantissa part fu111
This is a leading zero detection circuit which receives all bits except llo and JlRulSu as input, counts the number of leading zeros as shown in FIG. 3, and outputs the result α in binary form. 12
As shown in FIG. 14, the mantissa part f, 111 f1~
a pattern A detection circuit that outputs a pattern As detection signal that becomes l only when f−s+ is all 1, and a pattern As detection signal that becomes 1 only when f, to f−82 are all 1; 13 is the mantissa part f, as shown in FIG.
, pattern BD detection signal that becomes 1 only when fl of 111 is 0 and T O" f-112 is all 1, pattern BSIe4 that becomes 1 only when fl is 01f s" f-23 is all 1. The pattern B detection circuit 14 that outputs the output signal has a mantissa part f, 1, as shown in FIG.
Pattern CD detection signal that becomes 1 only when f4 and fs of 11 are 01f'-+ to f-st and GU are all 1, when f+ and fe are 01f-+ to f-alarm a are all 1 This is a pattern C detection circuit that outputs a pattern C8 detection signal that becomes 1 only when 15, as shown in FIG.
When the externally given Distone/Nissosize signal indicates single precision, the pattern A detection circuit 12 outputs a pattern As detection signal, the pattern B detection circuit 13 outputs a pattern As detection signal, and the pattern C detection circuit 14 outputs a pattern As detection signal. selects the pattern C8 detection signal and outputs it as the pattern A detection signal, pattern B detection signal, and pattern C detection signal, respectively, and if the externally given Distone/Nissosize signal indicates double precision, the pattern The pattern As detection signal is selected from the A detection circuit 12, the pattern BD detection signal is selected from the pattern C detection circuit 13, and the pattern CD1o4 output signal is selected from the pattern C detection circuit 14, respectively. This is a multiplexer that outputs a C detection signal. 16 is a select A signal that inputs the mantissa part f, the upper 3 bits of 111, f11f@, f−+, and becomes 1 only when f1=1, (f+−f++)=(0,
1), the select B signal becomes 1 only if (f+
, fa, f-+) = (0, 0, 1) if and only if 1
The upper 3-bit pattern detection circuit 17 outputs the select C signal which becomes
A sticky bit generation circuit 18 calculates the logical sum of , and outputs a sticky bit signal SS.
f-ass f-*a, f-36, f-s*, G, Ru, Sul The sticky bit signal S, which is the output of the sticky bit generation circuit 17, and the upper 3 bits
Select A, which is the output of the cut pattern detection circuit 16,
This is an LSB, R, S generation circuit which receives a signal from 81C and outputs LSBl R, S signals as shown in FIG. 19 is LSB.

R,S生成回路18の出力であるLSB、  RlS。LSB and RlS are the outputs of the R, S generation circuit 18.

仮数部Llllの符号ピッ)S、112、外部か・ら与
えられる丸めモード信号、ディストネーシーンサイズ信
号を入力としアイ・イーΦイ・イービーフ54 (IE
EE  P754)規格に基づき、第9図に示す関係で
丸めを行なう場合に1となる丸め信号Rs(単精度丸め
)、丸め信号Re(倍精度丸め)、及びこれらの信号の
論理和をとった信号で丸めが発生した場合ごとを示す丸
め発生信号RNDを出力する丸め判定回路である。20
は、バレルシフタ10の出力に丸め判定回路1θの出力
である信号R5は2−23の重みをもつビット位置に、
RDは2−62の重みをもつビット位置に加算すること
により丸め処理を行ない、第13図に示すような少なく
とも2−の重みをもつビットが1である正規化された仮
数f、130出力する加算器である。21は、先行零検
出回路11、マルチプレクサ15の出力であるパターン
A検出信号、パターンB検出信号、パターンC検出信号
、上位3ピツトパタ一ン検出回路の出力であるセレクト
A1B1C信号、丸め判定回路19の出力である丸め発
生信号RNDから、第10図に示す関係をもつバレルシ
フタ10制御信号L*z、L+s、LI、L4、LI、
LLlRl、、Rib、及び指数e、112補正用信号
C6、C4、C3、C2、C1、C1、Cを出力する制
御回路である。22は、制御回路21の出力のCが1の
時、同じく制御回路21の出力Cs1C4、C3、C2
、CI、Cmを反転するコンプリメンタ、23は、制御
回路21の出力のCを最下位へのキャリ入力とし、指数
e。110とコンプリメンタ22の出力の加算を行なう
加算器であり、補正された指数e、131を出力する。
The sign pip of the mantissa part Lllll) S, 112, the rounding mode signal given from the outside, and the distone scene size signal are input, and I
Based on the EE P754) standard, the rounding signal Rs (single-precision rounding), the rounding signal Re (double-precision rounding), which becomes 1 when rounding is performed according to the relationship shown in Figure 9, and the logical sum of these signals are calculated. This is a rounding determination circuit that outputs a rounding occurrence signal RND indicating each case where rounding occurs in a signal. 20
is the output of the barrel shifter 10, and the signal R5, which is the output of the rounding judgment circuit 1θ, is at the bit position with a weight of 2-23,
RD performs rounding by adding to bit positions with a weight of 2-62, and outputs a normalized mantissa f, 130, in which bits with a weight of at least 2-62 are 1, as shown in Figure 13. It is an adder. 21 are the leading zero detection circuit 11, the pattern A detection signal, the pattern B detection signal, the pattern C detection signal which are the outputs of the multiplexer 15, the select A1B1C signal which is the output of the upper 3 pit pattern detection circuit, and the rounding judgment circuit 19. From the output rounding generation signal RND, the barrel shifter 10 control signals L*z, L+s, LI, L4, LI, having the relationship shown in FIG.
This is a control circuit that outputs LLlRl, , Rib, and exponent e, 112 correction signals C6, C4, C3, C2, C1, C1, and C. 22 is the output Cs1C4, C3, C2 of the control circuit 21 when the output C of the control circuit 21 is 1.
, CI, and Cm, a complementer 23 uses the output C of the control circuit 21 as a carry input to the lowest order, and has an index e. This is an adder that performs addition of the outputs of 110 and the complementer 22, and outputs a corrected exponent e, 131.

第2図は、バレルシフタ10の構造を示すブロック図で
ある。第2図において20. 21.22.23.24
.25は、制御回路21の出力L+1L2、La、Le
、Las、La2が1の時、それぞれ左1.2.4.8
.16.32ビツトシフトを行なう左シフタ、26.2
7は、制御回路21の出力R+a、R+ bが1の時、
それぞれ右1ビツトシフトを行なう右1ビツトシフタで
ある。
FIG. 2 is a block diagram showing the structure of the barrel shifter 10. In Figure 2, 20. 21.22.23.24
.. 25 is the output L+1L2, La, Le of the control circuit 21
, when Las and La2 are 1, left 1.2.4.8 respectively
.. 16.3 Left shifter that performs a 2-bit shift, 26.2
7 is when the outputs R+a and R+b of the control circuit 21 are 1,
Each of these is a right 1-bit shifter that performs a 1-bit shift to the right.

第4図はパターンA検出回路12の論理図である。第4
図において、400から407は排他的論理和ゲートで
あり、f+〜f−22のビットが第14図に示したビッ
トパターン141に一致した場合、論理積ゲート40出
力のパターンAs検出信号が1となる。また、f+〜f
−6,のビットが第14図に示したビットパターン14
0に一致した場合、論理積ゲート41出力のパターンA
s検出信号が1となる。
FIG. 4 is a logic diagram of the pattern A detection circuit 12. Fourth
In the figure, 400 to 407 are exclusive OR gates, and when the bits f+ to f-22 match the bit pattern 141 shown in FIG. 14, the pattern As detection signal of the AND gate 40 output becomes 1. Become. Also, f+~f
-6, bit is the bit pattern 14 shown in FIG.
If it matches 0, pattern A of AND gate 41 output
The s detection signal becomes 1.

第5図はパターンB検出回路13の論理図である。第5
図において、500から507は排他的論理和ゲートで
あり、f+〜f−23のビットが第14図に示したビッ
トパターン151に一致した場合、論理積ゲート50出
力のパターンAs検出信号が1となる。また、f+〜f
−52のビットが第15図に示したビットパターン15
0に一致した場合、論理積ゲート51出力のパターンA
s検出信号が1となる。
FIG. 5 is a logic diagram of the pattern B detection circuit 13. Fifth
In the figure, 500 to 507 are exclusive OR gates, and when the bits f+ to f-23 match the bit pattern 151 shown in FIG. 14, the pattern As detection signal of the AND gate 50 output becomes 1. Become. Also, f+~f
-52 bits are bit pattern 15 shown in FIG.
If it matches 0, pattern A of AND gate 51 output
The s detection signal becomes 1.

第6図はパターンC検出回路14の論理図である。第6
図において、600から607は排他的論理和ゲートで
あり、f+〜f−24のビットが第15図に示したビッ
トパターン161に一致した場合、論理積ゲート60出
力のパターンC8検出信号が1となる。また、f+〜G
uのビットが第18図に示したビットパターン160に
一致した場合、論理積ゲート61出力のパターンCD検
出信号が1となる。
FIG. 6 is a logic diagram of the pattern C detection circuit 14. 6th
In the figure, 600 to 607 are exclusive OR gates, and when the bits f+ to f-24 match the bit pattern 161 shown in FIG. 15, the pattern C8 detection signal output from the AND gate 60 becomes 1. Become. Also, f+~G
When the bits of u match the bit pattern 160 shown in FIG. 18, the pattern CD detection signal output from the AND gate 61 becomes 1.

以上のように構成された浮動小数点正規化丸め装置につ
いて、その動作を説明する。
The operation of the floating point normalization rounding device configured as above will be explained.

本装置では正規化処理と丸め処理を行なうが、先ず正規
化処理の動作概略を述べる。正規化処理の基本動作は、
先行零検出回路11で仮数f、111の先行する零の数
を第3図に示したようにカウントし、このカウント結果
によりバレルシフタ10を動作させ仮数f。111の正
規化を行ない仮数f、、120を生成し、また加算器2
3、コンプリメンタ22を動作させ指数補数を行ない指
数e、131を生成することである。また丸め処理の基
本動作は、丸め判定に必要なビットを、LSB、  R
This device performs normalization processing and rounding processing, and first an outline of the operation of normalization processing will be described. The basic operation of normalization processing is
The leading zero detection circuit 11 counts the number of leading zeros of the mantissa f, 111 as shown in FIG. 3, and operates the barrel shifter 10 based on the count result to detect the mantissa f. 111 to generate mantissa f, , 120, and adder 2
3. Operate the complementer 22 to perform exponent complement and generate the exponent e,131. In addition, the basic operation of rounding processing is to convert the bits necessary for rounding judgment into LSB, R
.

S生成回路8でディストネーションサイズに応じた形で
正規化前の仮数fu111から生成し、これらのビット
を基に、丸め判定回路19で第9図に示したように丸め
判定を行ない、この判定で生成された丸め信号Rs1 
Rnと仮数f。120の加算を加算器20で行なうこと
である。また、丸め処理でディストネーションサイズを
考慮することで、サイズ変換も行なっている。
The S generation circuit 8 generates the mantissa fu111 before normalization according to the destination size, and based on these bits, the rounding determination circuit 19 performs rounding determination as shown in FIG. The rounded signal Rs1 generated by
Rn and mantissa f. 120 additions are performed by the adder 20. Size conversion is also performed by taking the destination size into consideration during rounding.

しかし、正規化した仮数fn120のビットパターンが
、 1.111・・・111     ・・・(パターン1
)となる場合、これを加算器20で丸めると仮数f、は
、 10.000・・・000 となり、仮数部オーバーフローが発生し再び正規化が必
要となる。そこで本発明では、この正規化、丸め処理で
仮数部オーバーフローが発生することを次のようにして
防いでいる。即ち、正規化処理を行なうとそのビットパ
ターンが上記のパターン1となる、第14.15.16
図に示したビットパターンを、パターンC検出回路、パ
ターンB検出回路、パターンC検出回路で検出しておき
、このパターンが検出され、かつ丸め判定回路19で丸
めを行なうことが判定された場合(丸め判定回路19出
力の丸め発生信号RNDが1)は、制御回路21はバレ
ルシフタ10の右1ビツトシフタ27にシフトを指示す
ることで、f、120のビットパターンを正規化数では
なく、 0.111・・・111 とし、加算器20で丸めた段階で仮数f、130が、1
.000・・・000 となるように制御し、丸めによる仮数部オーバーフロー
を防ぐ。
However, the bit pattern of the normalized mantissa fn120 is 1.111...111...(pattern 1
), when this is rounded by the adder 20, the mantissa f becomes 10.000...000, which causes a mantissa overflow and requires normalization again. Therefore, in the present invention, the occurrence of mantissa overflow in this normalization and rounding processing is prevented as follows. In other words, when normalization processing is performed, the bit pattern becomes the above pattern 1.
If the bit pattern shown in the figure is detected by a pattern C detection circuit, a pattern B detection circuit, and a pattern C detection circuit, and this pattern is detected and the rounding determination circuit 19 determines that rounding is to be performed ( When the rounding generation signal RND output from the rounding judgment circuit 19 is 1), the control circuit 21 instructs the right 1-bit shifter 27 of the barrel shifter 10 to shift, so that the bit pattern of f, 120 becomes 0.111 instead of the normalized number. ...111, and when rounded by the adder 20, the mantissa f, 130 becomes 1
.. 000...000 to prevent mantissa overflow due to rounding.

また、仮数のこの動作と対応した指数補正に必要なデー
タを制御回路21から出力し、指数eullOと加算し
最終的な指数e、131を得る。
Further, data necessary for exponent correction corresponding to this operation of the mantissa is outputted from the control circuit 21 and added to the exponent eullO to obtain the final exponent e, 131.

次に、上記の動作の詳細について述べるが、動作はマル
チプレクサ15出力(パターンA検出信号、パターンB
検出信号、パターンC検出信号)と上位3ビツトパター
ン検出回路16出力(セレクトA信号、セレクトB信号
、セレクトC信号)により次の7つに分類できる。
Next, the details of the above operation will be described.
The signals can be classified into the following seven types based on the outputs of the upper 3-bit pattern detection circuit 16 (select A signal, select B signal, select C signal).

(al) セレクトA信号=1、パターンA検出信号=
0の場合。
(al) Select A signal = 1, pattern A detection signal =
If 0.

この2つの信号は、ディストネーシ1ンサイズ信号が単
精度を指定しているなら、仮数f、111の上位24ビ
ツトのビットパターンが、(f+、fa、f−+、f−
窒、・”、f−*+、f−i2)=  (1,0,11
0,凰10.・・・ 、!10.110)もしくは、 = (1,1,110,110,・・・、110.11
0)(注: Iloは、1もしくは0であることを示す
。)であることを、ディストネーシーンサイズ信号が倍
精度なら仮数f’、111の上位53ビツトのビットパ
ターンが、 (f+、fs、f−+、f−as”、f−s@、f−s
t)=  (1,0,110,110,・・・ 、 I
lo 、菫10)もしくは、 = (1,1,110,110,・・・、110.11
0)であることを示しており、共にf I=1であるの
で正規化処理は右1ビツトシフトとなる。また、単精度
なら上位24ビツト、倍精度なら上位53ビツト、1が
連続していることはないので丸めを行なっても仮数部オ
ーバーフローは発生しない。以上のことに注目し、次の
ように制御を行なう。
For these two signals, if the distortion size signal specifies single precision, the bit pattern of the upper 24 bits of the mantissa f, 111 is (f+, fa, f-+, f-
Nitrogen,・”,f−*+,f−i2)=(1,0,11
0, 凰10. ...,! 10.110) or = (1,1,110,110,...,110.11
0) (Note: Ilo indicates 1 or 0.) If the distone scene size signal is double precision, the bit pattern of the upper 53 bits of the mantissa f', 111 is (f+, fs , f-+, f-as", f-s@, f-s
t)=(1,0,110,110,...,I
lo, violet 10) or = (1, 1, 110, 110,..., 110.11
0), and since f I = 1 in both cases, the normalization process is a one-bit shift to the right. Furthermore, since there are no consecutive 1's in the upper 24 bits for single precision and the upper 53 bits for double precision, no mantissa overflow occurs even if rounding is performed. Paying attention to the above, control is performed as follows.

セレク)A信号=1、パターンA検出信号二〇であるこ
とから制御回路21の出力は、第10図のタイプa1の
欄となる。そこで、制御回路21の出力信号R1aによ
りバレルシフタ10の右1ビツトシフタ26を動作させ
、正規化された仮数f、120を生成する。また加算器
23で、制御回路21の1である出力信号COと指数e
u110との加算を行ない補正された指数er131を
得る。
Since the select) A signal is 1 and the pattern A detection signal is 20, the output of the control circuit 21 is in the type a1 column of FIG. Therefore, the right 1-bit shifter 26 of the barrel shifter 10 is operated by the output signal R1a of the control circuit 21 to generate a normalized mantissa f,120. In addition, the adder 23 combines the output signal CO, which is 1, of the control circuit 21 with the index e.
The corrected index er131 is obtained by addition with u110.

また、L S B 、R、S生成回路18はセレクトA
信号が1であることから、右1ビツトシフト前の仮数f
u111から第8図のタイプaの欄が示すように、ディ
ストネーシロンサイズに沿ったL S B。
Furthermore, the LSB, R, S generation circuit 18 is connected to the select A
Since the signal is 1, the mantissa f before shifting by 1 bit to the right
As shown in the type a column of FIG. 8 from u111, L S B along the distance length size.

R1Sを生成し、丸め判定回路19はこのデータから、
各丸めモード応じた丸め信号Rs、Reを、ディストネ
ーシ日ンサイズ信号に応じて第9図に示すように出力す
る。そして、加算器20で丸め信号R51R11と仮数
f、120の加算を行ない、正規化及び丸められた仮数
L130を得る。
From this data, the rounding judgment circuit 19 generates R1S,
Rounding signals Rs and Re corresponding to each rounding mode are output as shown in FIG. 9 according to the distortion date size signal. Then, the adder 20 adds the rounding signal R51R11 and the mantissa f, 120 to obtain a normalized and rounded mantissa L130.

(a2)セレクトA信号=1、パターンA検出信号=1
の場合。
(a2) Select A signal = 1, pattern A detection signal = 1
in the case of.

この2つの信号は、ディストネーシーンサイズ信号が単
精度を指定しているなら、仮数r、tttの上位24が
、 (f+、fi、f−+、f−*、・・・、 f −as
’)=(1,l、1.1.・・・、l、1)であり、デ
ィストネーシUンサイズ信号が倍精度を指定しているな
ら、仮数r、t t tの上位53ビツトが、 CB、fa、f−I、f−tr、・・・+ f −st
 * f −st )=(1,1,1,l、・・・、1
.1)であることを示しており、f+=1であるので正
規化処理は右1ビツトシフトとなる。また、仮数は1が
連続していることから、正規化後にさらに丸めを行なう
と仮数部オーバーフローが発生する。
For these two signals, if the distone scene size signal specifies single precision, the upper 24 of the mantissa r, ttt are (f+, fi, f-+, f-*, ..., f -as
') = (1, l, 1.1..., l, 1), and if the distortion U size signal specifies double precision, then the upper 53 bits of the mantissa r, t t t are CB, fa, f-I, f-tr, ...+ f-st
* f −st ) = (1, 1, 1, l, ..., 1
.. 1), and since f+=1, the normalization process is a one-bit shift to the right. Furthermore, since the mantissa has consecutive 1s, further rounding after normalization will cause a mantissa overflow.

以上のことに注目し、次のように制御を行なう。Paying attention to the above, control is performed as follows.

−セレクトA信号=1、パターンAM出信号=1である
ので、制御回路21の出力は第10図のタイプa2の欄
となり、少なくとも出力信号R1aは1となりバレルシ
フタlOの右1ビツトシツク26を動作させるが、さら
に出力信号R1bも1とし、バレルシフタ10の右1ビ
ツトシフタ27も動作させるかどうかは、丸め判定回路
19の出力信号である丸め発生信号RNDに依存する。
- Since the select A signal = 1 and the pattern AM output signal = 1, the output of the control circuit 21 is in the column of type a2 in FIG. However, whether the output signal R1b is also set to 1 and the right 1-bit shifter 27 of the barrel shifter 10 is also operated depends on the rounding generation signal RND which is the output signal of the rounding determination circuit 19.

即ち丸め発生信号RNDが1ならば丸めが行なわれるの
で、丸めによる仮数部オーバーフローを防ぐため、制御
回路21出力のRlbを1としてバレルシフタ10の右
1ビツトシフタ27を動作させ、バレルシフタ10から 0.111・・・111 なる仮数f、120を出力する。また指数補正データも
この動作に対応し、丸め発生信号RNDがOならばCO
を1に、丸め発生信号RNDが1ならばC1を1にし、
これらの信号と指数eu110との加算を加算器23で
行ない、補正された指数e r 131を得る。
That is, if the rounding generation signal RND is 1, rounding is performed, so in order to prevent the mantissa overflow due to rounding, the right 1-bit shifter 27 of the barrel shifter 10 is operated with Rlb of the control circuit 21 output set to 1, and 0.111 is output from the barrel shifter 10. . . . outputs a mantissa f, 120, which is 111. The exponent correction data also corresponds to this operation, and if the rounding generation signal RND is O, CO
is set to 1, and if the rounding generation signal RND is 1, C1 is set to 1,
The adder 23 adds these signals and the index eu110 to obtain a corrected index e r 131.

また、LSB、R,S生成回路18はセレクトA信号が
1であることから、右1ビツトシフト前の仮数fu11
1から第8図のタイプaの欄が示すように、ディストネ
ーションサイズに沿ったL S BlR,Sを生成し、
丸め判定回路19はこのデータから、各丸めモード応じ
て第9図に示すように丸め信号R8、RDを、ディスト
ネーションサイズ信号に応じて出力する。そして、加算
320で丸め信号Rs1 Reと仮数f。120の加算
を行なうことで正規化及び丸められた仮数f、130を
得る。また丸め判定回路19は、丸めを行なう場合、1
である丸め発生信号RNDを制御回路21に出力する。
In addition, since the select A signal is 1, the LSB, R, S generation circuit 18 outputs the mantissa fu11 before shifting by one bit to the right.
As shown in the type a column in FIGS. 1 to 8, L S BlR,S is generated according to the destination size,
From this data, the rounding determination circuit 19 outputs rounding signals R8 and RD according to the destination size signal as shown in FIG. 9 according to each rounding mode. Then, in addition 320, the rounding signal Rs1 Re and the mantissa f are added. By performing the addition of 120, a normalized and rounded mantissa f, 130 is obtained. Further, the rounding determination circuit 19 performs 1 when rounding is performed.
A rounding generation signal RND is output to the control circuit 21.

(bl) セレクトB信号=1、パターンB検出信号=
0の場合。
(bl) Select B signal = 1, pattern B detection signal =
If 0.

この2つの信号は、ディストネーションサイズ信号が単
精度を指定しているなら、仮数f、111の上位25ビ
ツトは、 (f+、f@、f−+、f−2.°°°、f−2z)=
(0,1,110,110,・・・、110.110)
であり、ディストネーションサイズ信号が倍精度を指定
しているなら、仮数r、i 1 tの上位54ビツトは
、 (f+、Ls、f−+、f−ss°・+ f −s+ 
+ f−s2):(0,1,110,110,・・・、
110.110)であることを示している。またfI=
01 f口コミであるので、このデータはすでに正規化
されており正規化シフトは不要であり、また単精度の場
合もfII=f−2gまで1が24ビツト連続しておら
ず、倍精度の場合でもf@〜f−$2まで1が53ビツ
トが連続していないので、丸めを行なっても仮数部オー
バーフローは発生しない。以上のことに注目し次のよう
に制御を行なう。
For these two signals, if the destination size signal specifies single precision, the upper 25 bits of the mantissa f, 111 are (f+, f@, f-+, f-2.°°°, f- 2z)=
(0,1,110,110,...,110.110)
If the destination size signal specifies double precision, the upper 54 bits of the mantissa r, i 1 t are (f+, Ls, f-+, f-ss°・+ f-s+
+ f-s2): (0, 1, 110, 110,...,
110.110). Also, fI=
Since this is a 01 f review, this data has already been normalized and no normalization shift is required.Also, in the case of single precision, 24 bits of 1 are not consecutive until fII=f-2g, and in the case of double precision However, since the 53 bits of 1 are not consecutive from f@ to f-$2, no mantissa overflow occurs even if rounding is performed. Paying attention to the above, control is performed as follows.

セレク)B信号=1、パターンB検出信号二〇であるこ
とから制御回路21の出力は、第10図のタイプb1の
欄となり、バレルシフタ10を構成するどのシフタも動
作させず、また指数eullOの補正も、加算器23で
指数eullOと0との加算を行なうことで、実質上指
数e、J110をそのまま指数e r 131として出
力する。
Select) B signal = 1, pattern B detection signal 20, so the output of the control circuit 21 is in the column of type b1 in FIG. For correction, the adder 23 adds the exponent eullO and 0, thereby essentially outputting the exponent e, J110 as it is as the exponent e r 131.

また、LSB、R,S生成回路18はセレクトB信号が
1であることから、第8図のタイプbの欄が示すように
、仮数fu111からLSB、  R,Sを生成し、丸
め判定回路19はこのデータから、各丸めモード応じた
丸め信号R8、RDを、ディストネーションサイズ信号
に応じて第9図に示すように出力する。そして、加算器
20で丸め信号Rs、Rnと仮数f。120の加算を行
なうことで正規化及び丸められた仮数f、IJOを得る
Furthermore, since the select B signal is 1, the LSB, R, S generation circuit 18 generates the LSB, R, S from the mantissa fu111, as shown in the type b column in FIG. From this data, rounding signals R8 and RD corresponding to each rounding mode are output as shown in FIG. 9 according to the destination size signal. Then, an adder 20 generates rounding signals Rs, Rn and a mantissa f. By performing the addition of 120, the normalized and rounded mantissa f, IJO is obtained.

(b2) セレクトB信号=1、パターンB検出信号=
1の場合。
(b2) Select B signal = 1, pattern B detection signal =
In case of 1.

この2つの信号は、ディストネーションサイズ信号が単
精度を指定しているなら、仮数fulllの上位25ビ
ツトは、 (f+、fs、f−+、f−2s”、f−2g): (
0,1,1,l、・・・、1.1)であり、ディストネ
ーションサイズ信号が倍精度を指定しているなら、仮数
fu111の上位54ピツ トは、 (f +、f@、f−+、f−*、・・・、f−s+、
f−sa): (0,1,1,I、・・・、1.l)で
あることを示している。またfI=0、f・=1である
ので、このデータはすでに正規化されており正規化シフ
トは不要である。また、仮数は1が連続していることか
ら、正規化後にさらに丸めを行なうと仮数部オーバーフ
ローが発生する。以上のことに注目し次のように制御を
行なう。
For these two signals, if the destination size signal specifies single precision, the upper 25 bits of the mantissa full are (f+, fs, f-+, f-2s'', f-2g): (
0, 1, 1, l, ..., 1.1), and if the destination size signal specifies double precision, the upper 54 pits of the mantissa fu111 are (f +, f@, f −+, f−*, ..., f−s+,
f-sa): (0, 1, 1, I, ..., 1.l). Furthermore, since fI=0 and f.=1, this data has already been normalized and no normalization shift is necessary. Furthermore, since the mantissa has consecutive 1s, further rounding after normalization will cause a mantissa overflow. Paying attention to the above, control is performed as follows.

セレクトB信号=1、パターンB検出信号=1であるこ
とから制御回路21の出力は、第10図のタイプb2の
欄となりi 丸め判定回路19の出力信号である丸め発
生信号RNDが1の場合のみ、丸めによる仮数部オーバ
ーフローを防ぐため制御回路21出力のRlbを1とし
、バレルシフタ10の右1ビツトシフタ27を動作させ
バレルシフタ10から o、itt・・・111 なる仮数fl1120を出力する。また指数補正データ
もこの動作に対応し、丸め発生信号RNDがOならばC
OをOに、丸め発生信号RNDが1ならばCOを1にし
、これらの信号と指数e、110との加算を加算器23
で行ない、補正された指数e、131を得る。
Since the select B signal = 1 and the pattern B detection signal = 1, the output of the control circuit 21 becomes the column of type b2 in FIG. In order to prevent mantissa overflow due to rounding, Rlb of the control circuit 21 output is set to 1, and the right 1-bit shifter 27 of the barrel shifter 10 is operated to output a mantissa fl1120 of o, itt . . . 111 from the barrel shifter 10. The exponent correction data also corresponds to this operation, and if the rounding generation signal RND is O, then C
O is set to O, and if the rounding generation signal RND is 1, CO is set to 1, and these signals and the exponent e, 110 are added to the adder 23.
A corrected index e, 131 is obtained.

また、LSB、R,S生成回路18はセレクトB信号が
1であることから、第8図のタイプbの欄が示すように
、仮数f、111からLSB、  RlSを生成し、丸
め判定回路19はこのデータから、各丸めモード応じた
丸め信号Rs1 Rmを、ディストネーシ鱈ンサイズ信
号に応じて第9図に示すように出力する。そして、加算
器20で丸め信号Rs1 Rnと仮数f、120の加算
を行なうことで正規化及び丸められた仮数fr130を
得る。また丸め判定回路19は、丸めを行なう場合、1
である丸め発生信号RNDを制御回路21に出力する。
Furthermore, since the select B signal is 1, the LSB, R, S generation circuit 18 generates the LSB and RlS from the mantissa f, 111, as shown in the type b column in FIG. From this data, the rounding signals Rs1 to Rm corresponding to each rounding mode are output as shown in FIG. 9 in accordance with the distortion cod size signal. Then, the adder 20 adds the rounding signal Rs1 Rn and the mantissa f, 120, thereby obtaining a normalized and rounded mantissa fr130. Further, the rounding determination circuit 19 performs 1 when rounding is performed.
A rounding generation signal RND is output to the control circuit 21.

(cl) セレクトC信号=1、パターンC検出信号二
〇の場合。
(cl) When select C signal = 1 and pattern C detection signal 20.

この2つの信号は、ディストネーシジンサイズ信号が単
精度を指定しているなら、仮数f、111の上位26ビ
ツトは、 (f’+、fs、f−+、f−2,”・、f−s4):
 (0,0,1,110,・・・、110.110)で
あり、ディストネーシ日ンサイズ信号が倍精度を指定し
ているなら、仮数f、111の上位55ピツ トは、 (f+、f@、f−7,f−2,”・、f−sa、Gu
): (0,0,1,110,・・・、110.110
)であることを示しており、f+=O1fs=o、f−
+=1であるので、このデータの正規化処理は左1ビツ
トシフトとなる。また、単精度の場合はf−+〜f−s
aまで24ビツト、倍精度の場合はf−+〜G、まで5
3ビツト、1が連続していないので、正規化後の仮数を
丸めても仮数部オーバーフローは発生しない。以上のこ
とに注目し次のように制御する。
For these two signals, if the distortion size signal specifies single precision, the upper 26 bits of the mantissa f, 111 are (f'+, fs, f-+, f-2,''・,f -s4):
(0,0,1,110,...,110.110), and if the distone date size signal specifies double precision, then the upper 55 pits of the mantissa f, 111 are (f+, f @, f-7, f-2,”・, f-sa, Gu
): (0,0,1,110,...,110.110
), and f+=O1fs=o, f−
Since +=1, the normalization process for this data is a 1-bit shift to the left. Also, in the case of single precision, f-+ ~ f-s
24 bits up to a, 5 up to f-+ to G for double precision
Since 3 bits of 1 are not consecutive, no mantissa overflow occurs even if the mantissa after normalization is rounded. Paying attention to the above points, control is performed as follows.

セレク)C信号=1、パターンC検出信号=0であるこ
とから制御回路21は、第10図のタイプc1のとなり
、制御信号L1によりバレルシフタ10を構成する左1
ビツトシフタ20を動作させ正規化を行なう。また指数
eulloの補正も、1である制御信号Cによりコンプ
リメンタ22を動作させ、加算器23で指数eul°1
0から1である制御信号COを減算することで処理する
Since the select) C signal = 1 and the pattern C detection signal = 0, the control circuit 21 is of type c1 in FIG.
The bit shifter 20 is operated to perform normalization. Also, correction of the exponent eullo is performed by operating the complementer 22 with the control signal C which is 1, and using the adder 23 to correct the exponent eul°1.
Processing is performed by subtracting the control signal CO, which is 1, from 0.

また、LSB、R,S生成回路18はセレクトB信号が
1であることから、第8図のタイプCの欄が示すように
、仮数f、111からLSBl R1Sを生成し、丸め
判定回路19はこのデータから、各丸めモード応じた丸
め信号Rs、RDを、ディストネーシ日ソサイズ信号に
応じて第9図に示すように出力する。そして、加算器2
0で丸め信号Rs、Roと仮数f、120の加算を行な
うことで正規化及び丸められた仮数f、130を得る。
Furthermore, since the select B signal is 1, the LSB, R, S generation circuit 18 generates LSBl R1S from the mantissa f, 111, as shown in the type C column in FIG. From this data, rounding signals Rs and RD corresponding to each rounding mode are outputted as shown in FIG. 9 in accordance with the distortion and date size signal. And adder 2
By adding the rounding signals Rs, Ro and the mantissa f, 120 at 0, a normalized and rounded mantissa f, 130 is obtained.

(c2) セレクトC信号=t、  パターンC検出信
号=1の場合。
(c2) When select C signal = t, pattern C detection signal = 1.

この2つの信号は、ディストネーシeンサイズ信号が単
精度を指定しているなら、仮数fu1・11゜の上位2
6ビツトは、 (f+、f’i、f−+、f−as°・、f−+a)=
(0+0+1+++・・・、I、l)であり、ディスト
ネーシ日ソサイズ信号が倍精度を指定しているなら、仮
数f、111の上位55ビツトは、 (f+、f*、f−+、f−as”、f’−it、G、
、)=(0,0,1,1,・・・、1.1)であること
を示しており、f、=0、f1=0、r−、=1である
ので、このデータの正規化処理(ま基本的には左1ビツ
トシフトで行なえる。しかし、単精度の場合はf−+〜
f−24まで24ビツト、倍精度の場合はf−+ 〜G
utで53ビ・ソト、1力(連続しているので、正規化
後に仮数を丸めた場合1虚仮数部オーバーフローが発生
する。以上のこと番こ注目し次のように制御する。
If the distoneness e size signal specifies single precision, these two signals will be
The 6 bits are (f+, f'i, f-+, f-as°・, f-+a)=
(0+0+1+++..., I, l), and if the distance size signal specifies double precision, then the upper 55 bits of the mantissa f, 111 are (f+, f*, f-+, f- as", f'-it, G,
, ) = (0, 0, 1, 1, ..., 1.1), and since f, = 0, f1 = 0, r-, = 1, the normality of this data is (Basically, this can be done by shifting 1 bit to the left. However, in the case of single precision, f-+ ~
24 bits up to f-24, f-+ to G for double precision
In ut, there are 53 bits and 1 power (because it is continuous, if the mantissa is rounded after normalization, an imaginary mantissa overflow of 1 will occur. Paying attention to the above, control is performed as follows.

セレクトC信号=1、パターンC検出信号=1であるこ
とから制御回路21の出力は、第10図のタイプC2の
欄となり、制御回路21出力のLlは丸め判定回路19
の出力信号である丸め発生信号RNDに依存する。すな
わち丸め発生信号RNDがOの場合、丸めによる仮数部
オーバーフロ:を発生しないため、Llを1としバレル
シフタ10の左1ビツトシフタ20を動作させ、バレル
シフタ10から 1.000・・・000 なる仮数f、120を出力する。また、制御回路21出
力のco、ctを1とすることで、加算器23で指数e
。110から1を減算し補正された指数er131を得
る。丸め発生信号RNDがOの場合は、丸めによる仮数
部オーバーフローが発生するため、バレルシフタ10で
のシフタは行なわず、バレルシフタ10から 0.111・・・111 なる仮数f。120を出力する。
Since the select C signal = 1 and the pattern C detection signal = 1, the output of the control circuit 21 is in the column of type C2 in FIG.
It depends on the rounding generation signal RND which is the output signal of . That is, when the rounding generation signal RND is O, in order to prevent mantissa overflow due to rounding, Ll is set to 1, the left 1-bit shifter 20 of the barrel shifter 10 is operated, and the mantissa f of 1.000...000 is generated from the barrel shifter 10. , 120 are output. Also, by setting co and ct of the control circuit 21 output to 1, the adder 23 outputs the index e.
. Subtract 1 from 110 to obtain the corrected index er131. When the rounding generation signal RND is O, mantissa overflow occurs due to rounding, so the barrel shifter 10 does not shift, and the barrel shifter 10 generates a mantissa f of 0.111...111. Outputs 120.

そして、加算器23からは指数e、110をそのまま指
数e r 131として出力する。
Then, the adder 23 outputs the exponent e, 110 as it is as an exponent e r 131.

また、LSB、R,S生成回路18はセレクトC信号が
1であることから、第8図のタイプCの欄が示すように
、仮数f工111からLSBlR,Sを生成し、丸め判
定回路19はこのデータから、各丸めモード応じた丸め
信号Rs1 Roを、ディストネーシeンサイズ信号に
応じて第9図に示すように出力する。そして、加算器2
0で丸め信号Rs1 Rnと仮数f。120の加算を行
なうことで正規化及び丸められた仮数f’、130を得
る。また丸め判定回路19は、丸めを行なう場合、1で
ある丸め発生信号RNDを制御回路21に出力する。
Furthermore, since the select C signal is 1, the LSB, R, S generation circuit 18 generates LSBlR,S from the mantissa f 111, as shown in the type C column in FIG. From this data, outputs a rounding signal Rs1 Ro corresponding to each rounding mode, as shown in FIG. 9, according to the distortion e size signal. And adder 2
Round signal Rs1 Rn and mantissa f with 0. By performing the addition of 120, a normalized and rounded mantissa f' of 130 is obtained. Further, the rounding determination circuit 19 outputs a rounding generation signal RND of 1 to the control circuit 21 when rounding is to be performed.

(d)  セレクトA信号、B信号、C信号=Oこれら
の信号は、仮数f、J111の上位ビットが、(f +
、fi、f−+、f−*s・・)=(0,0,0,11
0,・=)であり、このデータの正規化処理は基本的に
2ビット以上の左シフトとなる。従ってGu%  R1
11SuビツトもOとなり、ディストネーションサイズ
指定信号が倍精度を指示している場合は、丸め判定回路
19出力の丸め信号RnはOであり丸めによる仮数部オ
ーバーフローは発生しない。以上のことに注目し次のよ
うに制御する。
(d) Select A signal, B signal, C signal = O In these signals, the mantissa f and the upper bit of J111 are (f +
, fi, f-+, f-*s...)=(0,0,0,11
0, . Therefore, Gu% R1
If the 11Su bit is also O and the destination size designation signal indicates double precision, the rounding signal Rn output from the rounding determination circuit 19 is O, and no mantissa overflow occurs due to rounding. Paying attention to the above points, control is performed as follows.

セレクトA信号、B信号、C信号=0であるので、制御
回路21の出力は第1O図のタイプd欄となり、すなわ
ち先行零検出回路11で第3図に従って得られた数αは
そのまま、 α=L32・26+1.+a・2’+Ls・23+La
・22+L2・2++L+・2の の関係を持つ、L32、LeelLm、L4、L2、L
Since the select A signal, B signal, and C signal = 0, the output of the control circuit 21 becomes the type d column in FIG. =L32・26+1. +a・2'+Ls・23+La
・L32, LeeLm, L4, L2, L with the relationship of 22+L2・2++L+・2
.

信号として出力される。そして制御信号Ll、L2、L
4、LII、L+a、L32は対応する左シフタ20〜
25を動作させ仮数f。の左シフトを行ない、正規化さ
れた仮数f、120を出力する。また、指数eu110
の補正は、 α”Cs・2S+C4・2’+C3・2 ’ + C2
・22+C+・2’+Cs・2θ の関係を持つ、制御信号C51C4、C3、C2、C8
、C@及び1であるCにより、加算器23でのeu−α
の実行で処理する。
Output as a signal. and control signals Ll, L2, L
4, LII, L+a, L32 are the corresponding left shifters 20~
25 and the mantissa f. , and outputs the normalized mantissa f, 120. Also, the index eu110
The correction is α”Cs・2S+C4・2′+C3・2′+C2
・Control signals C51C4, C3, C2, C8 with the relationship of 22+C+・2'+Cs・2θ
, C@ and C which is 1, eu-α in the adder 23
Process by executing.

また、L S B 、R、S生成回路18はセレクトA
1B1 C信号がOであることから、第8図のタイプD
の欄が示すように、全てOであるLSB、R。
Furthermore, the LSB, R, S generation circuit 18 is connected to the select A
1B1 Since the C signal is O, type D in Figure 8
As shown in the column, LSB and R are all O.

Sを生成し、丸め判定回路19はこのデータから、0で
ある丸め信号R51RDを出力する。そして、加算器2
0で0である丸め信号R81RDと仮数f’、、120
の加算を行なうことで正規化された仮数f、130を得
る。
The rounding determination circuit 19 outputs a rounding signal R51RD which is 0 from this data. And adder 2
Rounding signal R81RD which is 0 and mantissa f', 120
By performing the addition of , a normalized mantissa f, 130 is obtained.

但しこの場合、ディストネーシ日ソサイズ指定信号が単
精度を示している場合は、正規化前の仮数r、、itt
からは丸め判定に必要なビットを求めることは不可能な
ので、−旦、バレルシフタ10で正規化処理を行ない、
形式的に加算器2oで0との加算を行ない正規化された
仮数f、130を得た後、これを再度本装置に入力し、
丸め処理を行なうことになる。
However, in this case, if the distone size specification signal indicates single precision, the mantissa before normalization r,, itt
Since it is impossible to obtain the bits necessary for rounding judgment from
Formally, the adder 2o performs addition with 0 to obtain the normalized mantissa f, 130, and then inputs this into the device again,
Rounding will be performed.

以上のように本実施例に発明によれば、先行零検出回路
11、バレルシフタ1oを設は仮数ful11の正規化
を行なうが、上位3ビツトパターン検出回路1 B、ス
テイッキビット生成回路17、LSBl R,S生成回
路18、丸め判定回路19を設けることでバレルシフタ
1oでの正規化処理と並行して、正規化前の仮数f、1
11がら丸め用データを生成している。また、パターン
C検出回路12、パターンB検出回路13、パターンC
検出回路14、制御回路21を設けることで、正規化の
後に丸め処理を行なうと仮数部オ、−バーフローが発生
する場合を事前に検出し、バレルシフタ10でのシフト
数を制御することで、加算器20で丸め処理を施した結
果が常に正規化数としている。また、指数の補正も仮数
の丸めと並行して加算器23での1回の加減算で処理す
ることができる。さらに、これらの処理の実現に必要な
新たなハードウェアは、パターンA検出回路12、パタ
ーンB検出回路13、パターンC+yJ出回路14、上
位3ビツトパターン検出回路18、LSB1R1S生成
回路18、制御回路21、だけでありこれらは簡単な組
合せ回路で構成することができる。
As described above, according to the invention in this embodiment, the leading zero detection circuit 11 and the barrel shifter 1o are provided to normalize the mantissa ful11, but the upper 3 bit pattern detection circuit 1B, the sticky bit generation circuit 17, and the LSBl By providing the R, S generation circuit 18 and the rounding judgment circuit 19, the mantissa f, 1 before normalization can be calculated in parallel with the normalization process in the barrel shifter 1o.
11 to generate rounding data. In addition, pattern C detection circuit 12, pattern B detection circuit 13, pattern C
By providing the detection circuit 14 and the control circuit 21, it is possible to detect in advance the case where a mantissa part o, - barflow occurs when rounding processing is performed after normalization, and by controlling the number of shifts in the barrel shifter 10, The result of rounding by the adder 20 is always the normalized number. Furthermore, correction of the exponent can be processed in parallel with rounding of the mantissa by one addition/subtraction in the adder 23. Furthermore, new hardware required to realize these processes includes a pattern A detection circuit 12, a pattern B detection circuit 13, a pattern C+yJ output circuit 14, an upper 3-bit pattern detection circuit 18, an LSB1R1S generation circuit 18, and a control circuit 21. , and these can be constructed with simple combinational circuits.

発明の詳細 な説明したように本発明によれば、仮数の正規化処理と
並行して丸め用データを生成しており、アイ・イー・イ
ー−イー ビーフ54 (IEEEP754)規格に従
い、丸めデータ生成に時間を要する場合でも全体の処理
時間が長くなるということは無い。さらに、正規化した
結果を丸めた場合は仮数部オーバーフローとなる場合を
検出し、この場合正規化処理を調整することで、これを
未然に防ぐことができる。しかも仮数の正規化処理及び
丸め処理と、指数の補正処理は並行して処理することが
でき、仮数、指数をほぼ同時に得ることがことができ、
その実用的効果は大きい。
DETAILED DESCRIPTION OF THE INVENTION According to the present invention, rounding data is generated in parallel with the mantissa normalization process, and rounding data is generated in accordance with the IEEEP 754 standard. Even if it takes time, the overall processing time will not be long. Furthermore, if the normalized result is rounded, it is possible to detect the case where the mantissa overflow occurs, and in this case, by adjusting the normalization process, this can be prevented. Moreover, the mantissa normalization and rounding processing and the exponent correction processing can be processed in parallel, and the mantissa and exponent can be obtained almost simultaneously.
Its practical effects are great.

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

第1図は本発明の一実施例における浮動小数点正規化丸
め装置のブロック図、第2図はバレルシフタのブロック
図、第3図は先行零検出回路の入出力関係図、第4図は
パターンA検出回路の論理図、第5図はパターンB検出
回路の論理図、第6図はパターンC検出回路の論理図、
第7図はマルチプレクサの入出力関係図、第8図はLS
B1R1S生成回路の入出力関係図、第9図は丸め判定
回路の入出力関係図、第10図は制御回路の入出力関係
図、第11図は本装置へ入力される浮動小数点数のフォ
ーマット図、第12図はバレルシフタ出力のフォーマッ
ト図、第13図は丸め処理された仮数のピッドパターン
図、第14図はパターンA検出回路で検出するビットパ
ターン図、第16図はパターンB検出回路で検出するビ
ットパターン図、第18図はパターンC検出回路で検出
するビットパターン図である。 IO・・・バレルシフタ、11・・・先行零検出回路、
12・・・パターンA検出回路、 13・・・パターンB検出°回路、 14・・・パターンC検出回路、 16・・・上位3ビツトパタ一ン検゛出回路、17・・
・ステイッキビット生成回路、18・・・LSB、R1
S生成回路、 19・・・丸め判定回路、 20.23・・・加算器、21・・・制御回路。 代理人の氏名 弁理士 栗野重孝 ほか1名第 図 第 図 u n (foへf−ワ) 第 図 ノfg−“ソAs慢士r:号 ノでターンADf麺田r!号 第 図 ノf9−ン日5 伸出1菖号 ノでターン80 惰出1テ 第 図 清白It号 清白11号 第 図 弔 図 第 2図 第 3図
Fig. 1 is a block diagram of a floating point normalization rounding device in an embodiment of the present invention, Fig. 2 is a block diagram of a barrel shifter, Fig. 3 is an input/output relationship diagram of a leading zero detection circuit, and Fig. 4 is a pattern A Logic diagram of the detection circuit, FIG. 5 is a logic diagram of the pattern B detection circuit, FIG. 6 is a logic diagram of the pattern C detection circuit,
Figure 7 is the input/output relationship diagram of the multiplexer, Figure 8 is the LS
FIG. 9 is an input/output relationship diagram of the B1R1S generation circuit, FIG. 9 is an input/output relationship diagram of the rounding judgment circuit, FIG. 10 is an input/output relationship diagram of the control circuit, and FIG. 11 is a format diagram of floating point numbers input to this device. , Fig. 12 is a format diagram of the barrel shifter output, Fig. 13 is a pit pattern diagram of the rounded mantissa, Fig. 14 is a bit pattern diagram detected by the pattern A detection circuit, and Fig. 16 is a diagram of the bit pattern detected by the pattern B detection circuit. FIG. 18 is a diagram of the bit pattern detected by the pattern C detection circuit. IO... Barrel shifter, 11... Leading zero detection circuit,
12...Pattern A detection circuit, 13...Pattern B detection circuit, 14...Pattern C detection circuit, 16...Upper 3-bit pattern detection circuit, 17...
・Sticky bit generation circuit, 18...LSB, R1
S generation circuit, 19... Rounding judgment circuit, 20.23... Adder, 21... Control circuit. Name of agent: Patent attorney Shigetaka Kurino and one other person Fig. Fig. u n (fo to f-wa) Fig. No. - Day 5 Turn 80 on the 1st iris No. 1 exit 1st fig. Seishaku It No. 11

Claims (1)

【特許請求の範囲】[Claims] 正規化されていない仮数部及びこれに対応する指数部か
らなる浮動小数点数のうち、仮数部を入力とし正規化に
必要なシフト数を求める第1の手段と、前記仮数部を入
力とし、丸め用データを出力する第2の手段と、前記仮
数部及び前記第2の手段の出力から、前記仮数部の正規
化及びその後の丸め処理を行なうと仮数部オーバーフロ
ーが発生する場合を検出する第3の手段と、前記第1の
手段、前記第3の手段の出力から、前記仮数部を丸めた
状態で正規化数とするのに必要なシフト数を決定しこれ
出力する第4の手段と、前記仮数部を入力とし、前記第
4の手段の出力に従ってシフトを行なうシフト手段と、
前記第4の手段の出力に従って前記指数部を補正する補
正手段と、前記第2の手段の出力に従って、前記シフト
手段の出力に丸め処理を施す丸め手段とから構成される
ことを特徴とする浮動小数点正規化丸め装置。
A first means for calculating a shift number necessary for normalization by inputting the mantissa of a floating point number consisting of a non-normalized mantissa and a corresponding exponent; and a third means for detecting, from the mantissa and the output of the second means, a case where a mantissa overflow occurs when the mantissa is normalized and the subsequent rounding processing is performed. and a fourth means for determining and outputting the number of shifts necessary to make the mantissa rounded into a normalized number from the outputs of the first means and the third means; Shifting means that receives the mantissa as input and performs shifting according to the output of the fourth means;
A floating device comprising: a correction means for correcting the exponent part according to the output of the fourth means; and a rounding means for rounding the output of the shift means according to the output of the second means. Decimal normalization rounding device.
JP63269895A 1988-10-26 1988-10-26 Floating point normalizing and rounding device Pending JPH02115926A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63269895A JPH02115926A (en) 1988-10-26 1988-10-26 Floating point normalizing and rounding device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63269895A JPH02115926A (en) 1988-10-26 1988-10-26 Floating point normalizing and rounding device

Publications (1)

Publication Number Publication Date
JPH02115926A true JPH02115926A (en) 1990-04-27

Family

ID=17478715

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63269895A Pending JPH02115926A (en) 1988-10-26 1988-10-26 Floating point normalizing and rounding device

Country Status (1)

Country Link
JP (1) JPH02115926A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02294819A (en) * 1989-04-17 1990-12-05 Internatl Business Mach Corp <Ibm> Floating point arithmetic processor
JPH02294820A (en) * 1989-04-17 1990-12-05 Internatl Business Mach Corp <Ibm> Floating point arithmetic processor and arithmetic processing
JPH07191828A (en) * 1993-12-27 1995-07-28 Nec Corp Normalizing/rounding circuit

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02294819A (en) * 1989-04-17 1990-12-05 Internatl Business Mach Corp <Ibm> Floating point arithmetic processor
JPH02294820A (en) * 1989-04-17 1990-12-05 Internatl Business Mach Corp <Ibm> Floating point arithmetic processor and arithmetic processing
JPH07191828A (en) * 1993-12-27 1995-07-28 Nec Corp Normalizing/rounding circuit

Similar Documents

Publication Publication Date Title
EP0973089B1 (en) Method and apparatus for computing floating point data
JP3076046B2 (en) Exception detection circuit
US5568412A (en) Rounding-off method and apparatus of floating point arithmetic apparatus for addition/subtraction
JP4500358B2 (en) Arithmetic processing apparatus and arithmetic processing method
US10019231B2 (en) Apparatus and method for fixed point to floating point conversion and negative power of two detector
US5010508A (en) Prenormalization for a floating-point adder
EP0381403B1 (en) Pipelined floating point adder for digital computer
JPS62226226A (en) Rounding and normalizing circuit for floating point
JPH0544046B2 (en)
JPH05324270A (en) Method and device for converting format for floating point number
US7437400B2 (en) Data processing apparatus and method for performing floating point addition
JPH02115926A (en) Floating point normalizing and rounding device
US7401107B2 (en) Data processing apparatus and method for converting a fixed point number to a floating point number
US11366638B1 (en) Floating point multiply-add, accumulate unit with combined alignment circuits
US6571264B1 (en) Floating-point arithmetic device
US20180157463A1 (en) Leading zero anticipation
US5432727A (en) Apparatus for computing a sticky bit for a floating point arithmetic unit
US7003540B2 (en) Floating point multiplier for delimited operands
JP2517064B2 (en) Denormalized number processing method
US7386580B2 (en) Data processing apparatus and method for computing an absolute difference between first and second data elements
JP2558799B2 (en) Floating point normalized rounding device
JP3257278B2 (en) Normalizer using redundant shift number prediction and shift error correction
JP2723707B2 (en) Normalization circuit
US11429349B1 (en) Floating point multiply-add, accumulate unit with carry-save accumulator
GB2275355A (en) Detection of exponent underflow and overflow in a floating point adder