JPH01245328A - Floating-point normalization rounding device - Google Patents

Floating-point normalization rounding device

Info

Publication number
JPH01245328A
JPH01245328A JP63073587A JP7358788A JPH01245328A JP H01245328 A JPH01245328 A JP H01245328A JP 63073587 A JP63073587 A JP 63073587A JP 7358788 A JP7358788 A JP 7358788A JP H01245328 A JPH01245328 A JP H01245328A
Authority
JP
Japan
Prior art keywords
bit
mantissa
rounding
normalization
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.)
Granted
Application number
JP63073587A
Other languages
Japanese (ja)
Other versions
JP2558799B2 (en
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 JP63073587A priority Critical patent/JP2558799B2/en
Publication of JPH01245328A publication Critical patent/JPH01245328A/en
Application granted granted Critical
Publication of JP2558799B2 publication Critical patent/JP2558799B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PURPOSE:To previously prevent the generation of overflow by unitedly processing the normalization processing and rounding processing of mantissas in a floating-point normalization rounding device, and when the mantissa part of a rounded part flows over, adjusting the normalization processing. CONSTITUTION:A barrel shifter 10 of the floating-point normalization rounding device inputs a mantissa fu 51, executes normalization shifting processing and outputs a mantissa 60 constituted so that the most significant bit is a bit having 2<0> weight, 3 bits on the least significant bit side are a guard bit Gn, a round bit Rn and a sticky bit Sn. On the other hand, a preceding zero detecting circuit 11 inputs all bits having 2<1> weight and excluding the bits Gu, Ru, Su, counts up the number of preceding zeros and outputs the counted result. Pattern A and B detecting circuits 12, 13 detect bit patterns A, B. A control circuit 14 and a round deciding circuit 15 inputting a round mode signal and a code bit simultaneously execute respective processing, the circuit 14 controls the shifting of a shifter 10 and an adder 16 normalizes a rounded result.

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.

従来の技術 演算後に正規化とそれに続く丸め処理を行なう浮動小数
点演算では、正規化された仮数部を丸めた時点で仮数部
オーバーフローが発生する場合がある。この場合、ざら
に仮数部右シフト及び指数インクリメント操作による補
正が必要になり、高速演算の妨げとなる。そこでこの補
正を高速化することを実現した従来の浮動小数点正規化
丸め装置としては、例えば特開昭60−97436号公
報に示されている。本従来例は、正規化した結果が1.
111・・・11でありかつ丸めを行なう場合を検出し
、この場合、仮数部の丸めは実際には行なわず、別に設
けたレジスタ内に予め設定した1、000・・・00を
出力し、指数部は実際にlインクリメントして補正を行
なうものである。
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, correction by roughly shifting the mantissa to the right and incrementing the exponent is required, which impedes high-speed calculation. Therefore, a conventional floating point normalization rounding device that realizes speeding up this correction is disclosed in, for example, Japanese Patent Laid-Open No. 60-97436. In this conventional example, the normalized result is 1.
111...11 and rounding is to be performed, in this case, the mantissa is not actually rounded, but outputs 1,000...00 preset in a separately provided register, The exponent part is actually incremented by l to perform correction.

発明が解決しようとする課題 しかしながら本従来例では、補正が必要な場合を検出し
た時、仮数部はすぐに補正結果が出力できるが、指数部
はこの時点からさらに補正演算が必要であり、また補正
結果の仮数1.000・・・00を格納しておくための
レジスタも必要である、という問題点を有していた。
Problem to be Solved by the Invention However, in this 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. There was a problem in that a register was also required to store the mantissas 1.000...00 of the correction results.

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

課題を解決するための手段 正規化されていない仮数部及びこれに対応する指数部か
らなる浮動小数点数のうち、仮数部を入力とし正規化に
必要なシフト数を求める第1の手段と、前記仮数部を入
力とし、前記仮数部の正規化及びその後の丸め処理を行
なうと仮数部オーバーフローが発生することを検出する
第2の手段と、前記第1の手段、前記第2の手段の出力
から、前記仮数部を丸めた状態で正規化数とするのに必
要なシフト数を決定しこれ出力する第3の手段と、前記
仮数部を入力とし、前記第3の手段の出力に1、Yっで
シフトを行なうシフト手段と、前記第3の手段の主力に
従って前記指数部を補正する補正手段と、前記シフト手
段の出力である仮数部に丸め処理を施す丸め手段とを備
えた演算装置である。
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 for detecting that a mantissa overflow occurs when the mantissa is input and the mantissa is normalized and then rounded; and from the outputs of the first means and the second means. , a third means for determining and outputting the number of shifts necessary to make the mantissa part into a normalized number in a state where the mantissa part is rounded; an arithmetic device comprising: a shift means for performing a shift; a correction means for correcting the exponent part according to the main power of the third means; and a rounding means for rounding the mantissa part that is the output of the shift means. be.

作   用 本発明は前記した構成により、第1の手段で仮数正規化
に必要なシフト数をもとめ、シフト手段で仮数の正規化
を、補正手段で指数の補正を行ない、正規化された仮数
はさらに丸め手段で丸め処理を行なうが、丸めた結果が
仮数部オーバーフローとなる場合については、第2の手
段で予め検出しておき、第3の手段からは常に、丸め手
段の出力が正規化数となるのに必要なシフト数をシフト
手段に出力することができるものである。
According to the above-described configuration, the present invention uses the first means to obtain the shift number necessary for mantissa normalization, the shift means to normalize the mantissa, the correction means to correct the exponent, and the normalized mantissa is Further, the rounding means performs rounding processing, but if the rounding result causes a mantissa overflow, the second means detects it in advance, and the third means always makes sure that the output of the rounding means is a normalized number. It is possible to output to the shift means the number of shifts necessary to achieve the following.

実施例 第1図は本発明の一実施例のブロック図を示すものであ
る。本実施例の浮動小数点正規化丸め装置に入力される
浮動小数点数のフォーマットを、第5図に示す。第5図
のフォーマットはI EEEP754規格に従って加減
算され、次に正規化及び丸め処理を受ける単精度の浮動
小数点数であり、50は、バイアス表現された8ビツト
の指数eu、51は、最上位ビットは21の重みをもつ
ビット、最下位側3ビツトはガードビット(以下GUビ
ットと記す)、ラウンドビット(以下Ruビットと記す
)、ステイッキビット(以下Suビットと記す)であり
、28ビツトの幅をもつ仮数fuである。52は、仮数
の符号を示す符号ビットであり、0で正数を、lで負数
を示す。
Embodiment FIG. 1 shows a block diagram of an embodiment of the present invention. The format of the floating point number input to the floating point normalization rounding device of this embodiment is shown in FIG. The format in Figure 5 is a single-precision floating point number that is added and subtracted according to the IEEEP754 standard, then normalized and rounded, where 50 is the biased 8-bit exponent eu, and 51 is the most significant bit. is a bit with a weight of 21, and the lowest three bits are a guard bit (hereinafter referred to as GU bit), a round bit (hereinafter referred to as Ru bit), and a sticky bit (hereinafter referred to as Su bit). The mantissa fu has a width. 52 is a sign bit indicating the sign of the mantissa; 0 indicates a positive number, and l indicates a negative number.

第1図において、IOは、仮数fu51を入力として正
規化シフト処理を行なうバレルシフタであり、第6図に
示した最上位ビットが21!の重みをもつビット、最下
位側3ビツトはガードピット(以下Gnビットと記す)
、ラウンドビット(以下Rnビットと記す)、ステイッ
キビット(以下Snビットと記す)である仮数f n6
0を出力する。11は、仮数fu51の21の重みを持
つビットとGu、  Ru、Suビットを除く全てのピ
ッを入力とし、第7図に示すように先行する零の数をカ
ウントしその結果αを2進数で出力する先行零検出回路
、12は、仮数fuの21の重みを持つビットとCu、
  Ru、  SUビットを除くビットパターンが第8
図に示すビットパターンである場合、パターンA検出信
号を出力するパターンA検出回路、13は、仮数fuの
21の重みを持つビットとGu、  Ru、  SL1
ビットを除くビットパターンが第9図に示すビットパタ
ーンである場合、パターンB検出信号を出力するパター
ンB検出回路、14は、先行零検出回路11、パターン
A検出回路12、パターンB検出回路13の出力、仮数
fu51の21の重みを持つビット、仮数fu51の符
号ビット52、Gus  Ru、  Suビット、外部
から与えられる丸めモード信号から、第10図に示す関
係をもつ制御信号L+6、L8、L4、L2、I、1、
CMP、Cを出力する制御回路、15は、バレルシフタ
IOの出力である仮数f n60の、2−23の重みを
持つビット、Gn、Rn、Snビット、仮数fu51の
符号ビット52、外部から与えられる丸めモード信号を
入力とし、IEEEP754規格に基づき、第11図に
示rjj係で丸め信号を出力する丸め判定回路である。
In FIG. 1, IO is a barrel shifter that performs normalization shift processing with the mantissa fu51 as input, and the most significant bit shown in FIG. 6 is 21! The lowest 3 bits are guard pits (hereinafter referred to as Gn bits).
, a round bit (hereinafter referred to as Rn bit), and a sticky bit (hereinafter referred to as Sn bit), mantissa f n6
Outputs 0. 11 inputs all the bits except the bit with a weight of 21 of the mantissa fu51 and the Gu, Ru, and Su bits, counts the number of leading zeros as shown in Figure 7, and calculates the result α in binary. The leading zero detection circuit 12 outputs a bit having a weight of 21 of the mantissa fu and Cu,
The bit pattern excluding Ru and SU bits is the 8th bit pattern.
In the case of the bit pattern shown in the figure, the pattern A detection circuit 13 that outputs the pattern A detection signal is a bit with a weight of 21 of the mantissa fu, and Gu, Ru, SL1.
When the bit pattern other than the bit is the bit pattern shown in FIG. From the output, the bit with a weight of 21 of the mantissa fu51, the sign bit 52 of the mantissa fu51, the Gus Ru, Su bits, and the rounding mode signal given from the outside, control signals L+6, L8, L4, having the relationship shown in FIG. L2, I, 1,
Control circuit 15 outputs CMP, C, bits with a weight of 2-23 of mantissa f n60 which is the output of barrel shifter IO, Gn, Rn, Sn bits, sign bit 52 of mantissa fu51, given from the outside. This is a rounding determination circuit which receives a rounding mode signal as an input and outputs a rounding signal according to the rjj ratio shown in FIG. 11 based on the IEEE P754 standard.

16は、バレルシフタ10出力である仮数fn60の、
28から2−23の重みをもつビットに、丸め判定回路
15の出力を2−23の重みをもつビットとして加算し
、丸めを行なう加算器であり、第12図に示した少なく
とも2aの重みを持つビットが1である正規化仮数f「
19を出力する。17は、制御回路14の出力のCMP
が1の時、同じく制御回路14の出力のLl6、L8、
L4、L2、Llをインバートするコンプリメンタ、1
8は、制御回路14の出力のCを最下位へのキャリ入力
とし、指数eu50とコンプリメンタ17の出力の加算
を行なう加算器であり、補正された指数er20を出力
する。
16 is the mantissa fn60 which is the output of the barrel shifter 10,
This is an adder that performs rounding by adding the output of the rounding determination circuit 15 to bits having a weight of 2-23 from 28 to 2-23. The normalized mantissa f' whose bit is 1
Outputs 19. 17 is a CMP output of the control circuit 14;
When is 1, Ll6, L8, which is the output of the control circuit 14,
Complementor that inverts L4, L2, Ll, 1
Reference numeral 8 denotes an adder which uses the output C of the control circuit 14 as a carry input to the lowest order, adds the exponent eu50 and the output of the complementer 17, and outputs the corrected exponent er20.

第2図は、バレルシフタlOの構造を示すブロック図で
ある。第2図において20は仮数f’u51の21から
2−23の重みを持つビット、Gu、Ruビットを入力
としrrirm回路14の出力R1が1の時、右1ビツ
トシフトを行なう右1ビツトシフタ、21.22.23
.24.25は、制御回路14の出力L1、L2、L4
、L8、Ll6が1の時それぞれ左1.2.4.8.1
6ビツトシフトを行なうシフタ、26は、右1ビツトシ
フタ2oで右1ビツトシフトを行なった時、シフトアウ
トされる1ビ、  ットと仮数fu51のSυビットの
論理和をとり、新たなステイッキビットであるSnビッ
トを生成する論理和ゲートである。
FIG. 2 is a block diagram showing the structure of the barrel shifter IO. In FIG. 2, reference numeral 20 denotes a right 1-bit shifter which inputs the bits having weights 21 to 2-23 of the mantissa f'u51, Gu, and Ru bits, and performs a 1-bit shift to the right when the output R1 of the rrrim circuit 14 is 1. .22.23
.. 24.25 are the outputs L1, L2, L4 of the control circuit 14
, when L8 and Ll6 are 1, left 1.2.4.8.1 respectively
The shifter 26 that performs a 6-bit shift is a new sticky bit by calculating the OR of the 1 bit shifted out and the Sυ bit of the mantissa fu51 when the right 1-bit shifter 2o performs a 1-bit shift to the right. This is an OR gate that generates the Sn bit.

第3図はパターンA検出回路の論理図である。FIG. 3 is a logic diagram of the pattern A detection circuit.

第3図において、300から323は排他的論理和ゲー
トであり、211から2−23の重みを持つ入力信号の
夫々のビットが第8図に示したビットに一致するか否か
を検出し、全て一致した場合は論理積ゲート31出力の
パターンA検出信号が1となる。
In FIG. 3, 300 to 323 are exclusive OR gates, which detect whether each bit of the input signal having a weight of 2-23 from 211 matches the bit shown in FIG. If they all match, the pattern A detection signal output from the AND gate 31 becomes 1.

第4図はパターンB検出回路の論理図である。FIG. 4 is a logic diagram of the pattern B detection circuit.

第4図において400から423は排他的論理和ゲート
であり、211から2−23の重みを持つ入力信号の夫
々のビットが第9図に示したビットに一致するか否かを
検出し、全て一致した場合は論理積ゲー)41出力のパ
ターンB検出信号が1となる。
In FIG. 4, 400 to 423 are exclusive OR gates, which detect whether or not each bit of the input signal having a weight of 2-23 from 211 matches the bit shown in FIG. If they match, the pattern B detection signal output from the AND game) 41 becomes 1.

以上のように構成された浮動小数点正規化丸めH置につ
いて、その動作を説明する。動作の大筋の流れは、正規
化と丸め処理を行なう仮数fu51をバレルシフタ10
と先行零検出回路11に入力し、先行零検出回路11で
求めたビット数に従ってバレルシフタ10では仮数fu
の正規化シフト、加算器18では指数euの補正を行な
い、さらに丸め判定回路15で丸め処理が必要か否かを
判定しその結果に基づき、加算器16で丸め処理を行な
うものである。そしてさらに、正規化された仮数を丸め
ると仮数がオーバーフローする場合を、パターンA検出
回路12、パターンB検出回路13の出力、仮数fu5
1のGu、  RLJ%  Suビットをもとに制御回
路14で検出し、バレルシフタlOのシフト数を制御回
路14で制御することで、仮数部オーバーフローを防止
している。また丸め方法については、(EEE  P7
54規定に定められたものに従っているが、説明の簡単
化のため以下では最近値丸めモード(RNモードと記す
)について説明する。しかし、第1図に示した浮動小数
点正規化丸め装置は、規定で定められた全ての丸めモー
ドに対応している。ここでRNモードとは第1111f
flに示すように基本的にバレルシフタ1゜で正規化さ
れた仮数1口6oのGnビットが1の時、仮数f n6
0の2−23の重みをもつビットに1を加えて丸めを行
なう丸め方法である。
The operation of the floating point normalization rounding H arrangement configured as described above will be explained. The main flow of the operation is to transfer the mantissa fu51, which performs normalization and rounding processing, to the barrel shifter 10.
is input to the leading zero detection circuit 11, and the barrel shifter 10 calculates the mantissa fu according to the number of bits determined by the leading zero detection circuit 11.
The adder 18 corrects the exponent eu, and the rounding determination circuit 15 determines whether or not rounding is necessary. Based on the result, the adder 16 performs the rounding. Further, if the normalized mantissa is rounded and the mantissa overflows, the output of the pattern A detection circuit 12 and the pattern B detection circuit 13, the mantissa fu5
The control circuit 14 detects based on the Gu and RLJ% Su bits of 1, and controls the number of shifts of the barrel shifter 10 by the control circuit 14, thereby preventing mantissa overflow. Also, regarding the rounding method, see (EEE P7
However, to simplify the explanation, the nearest value rounding mode (referred to as RN mode) will be described below. However, the floating point normalization rounder shown in FIG. 1 is compatible with all the rounding modes defined by the regulations. Here, RN mode is 1111f
As shown in fl, when the Gn bit of the mantissa 6o normalized by the barrel shifter 1° is 1, the mantissa f n6
This is a rounding method that performs rounding by adding 1 to bits with a weight of 2-23 of 0.

本実施例の動作は、正規化のためバレルシフタ10に入
力される仮数fu51のビットパターンにより次の4つ
に分類できる。
The operations of this embodiment can be classified into the following four types depending on the bit pattern of the mantissa fu51 input to the barrel shifter 10 for normalization.

1)21の重みを持つビットが1の場合。1) If the bit with a weight of 21 is 1.

制御回路14は第10図のタイプlと記した行の制御信
号を出力する。すなわちR1=1によりバレルシフタ1
0で仮数fu51の右1ビツトシフトを行ない、C=t
により加算器18で指数eu50に1を加え指数補正を
行なう。ここでシフト結果がGnビットを含めて全て1
である第13図に示すものになる事はない。何故なら、
このような数の右1ビツトシフト前の状態は第14図に
示すものであるが、このビットパターンは、 N]=22−2〜23 である数Nlを示している。一方、24ビツトで表現で
きる最大数を加算した場合でもその結果N2は、N2−
 (2+   2−23)+  (2+   2−23
):= 22  2−22 であり、 Nl>N2 が成り立つ。すなわち第14図に示した数は存在しない
。すなわち、右シフト後のGnビットが1である数は存
在せず、従って丸め判定回路15の出力はO1加算器1
6の加算は0との加算となり、仮数オーバーフローが発
生することはない。
The control circuit 14 outputs the control signal of the row labeled type 1 in FIG. In other words, due to R1=1, barrel shifter 1
Shift the mantissa fu51 to the right by 1 bit with 0, and get C=t
Accordingly, the adder 18 adds 1 to the exponent eu50 to perform exponent correction. Here, the shift result is all 1 including the Gn bit.
The result will never be as shown in Figure 13. Because,
The state of such a number before being shifted one bit to the right is shown in FIG. 14, and this bit pattern indicates a number Nl where N]=22-2 to 23. On the other hand, even if the maximum number that can be expressed in 24 bits is added, the result N2 will be N2-
(2+ 2-23)+ (2+ 2-23
):=22 2-22, and Nl>N2 holds true. That is, the numbers shown in FIG. 14 do not exist. That is, there is no number whose Gn bit is 1 after the right shift, and therefore the output of the rounding judgment circuit 15 is output to the O1 adder 1.
Addition of 6 is addition to 0, and no mantissa overflow occurs.

2)2′″の重みを持つビットからCuビットが全て1
の場合。
2) All Cu bits are 1 from bits with a weight of 2''
in the case of.

第15図に示したこの数は、パターンA検出回路とCu
ビットでにより制御回路14で検出される。
This number shown in FIG. 15 is based on the pattern A detection circuit and Cu
The bit is detected by the control circuit 14.

モしてセ!御回路14は第10図のタイプ2と記した行
の制御信号を出力する。すなわちR1=1によりバレル
シフタ10で右1ビツトシフトを行ない、C=1により
加算器18で指数euにlを加える。
Mote se! The control circuit 14 outputs the control signal of the row labeled type 2 in FIG. That is, when R1=1, the barrel shifter 10 shifts one bit to the right, and when C=1, the adder 18 adds l to the exponent eu.

ここで右1ビツトシフトを行なう理由は次の通りである
。このパターンの数は第15図に示したように、Cuビ
ットが1であることから丸め処理を行なうが、その結果
はオーバーフローが発生し、第16図に示したような2
1の重みを持つビットのみがlである仮数となってしま
い再び右シフトが必要になる。しかし仮数fu51をバ
レルシフタ10で予め右1ビツトシフトを行なっておく
と、シフト結果は第17図に示すようにGnビットが1
である数となる。そこで丸め判定回路15の出力はlと
なりシフトしない場合と同様に、加算器16で1との加
算が行なわれるが、オーバーフローは発生せず、第18
図に示したような2″の重みを持つビットのみが1であ
る正規化された仮数fr19が得られる。
The reason for performing the right 1-bit shift here is as follows. As shown in Fig. 15, the number of this pattern is rounded because the Cu bit is 1, but as a result, an overflow occurs and the number is 2 as shown in Fig. 16.
Only the bit with a weight of 1 becomes the mantissa of l, and a right shift is required again. However, if the mantissa fu51 is shifted to the right by 1 bit in advance using the barrel shifter 10, the shift result will be such that the Gn bit is 1 as shown in FIG.
becomes a number. Therefore, the output of the rounding judgment circuit 15 becomes l, and addition with 1 is performed in the adder 16 as in the case of no shift, but no overflow occurs and the 18th
A normalized mantissa fr19 is obtained in which only the bit with a weight of 2'' is 1 as shown in the figure.

3)少なくとも2°、2−1の重みをもつビットがOで
ある場合。
3) If the bit with a weight of at least 2°, 2-1 is O.

この場合は正規化に必要なシフト数は先行零検出回路l
lで得られ、制御回路14は第1O図のタイプ3と記し
た行の制御信号を出力する。すなわち先行零検出回路1
1で第7図に従って得られた数αはそのまま、 α=L16・24+L8・23+L4・22+L2・2
1+L1・20 の関係を持つ、Li2、L、8、L4、L2.Ll信号
として出力される。そして制御信号Ll、  L2、L
4、L8、Li2は対応する左シック21〜25を動作
させ仮数fuの左シフトを行ない正規化された仮数fn
60を出力する。また、指数の補正eU−αは、制御信
号CMPでコンプリメンタ17を動作させαの1の補数
をとりさらに、制御信号C=1により最下位ビットに1
を加えることで加算器18で処理する。
In this case, the number of shifts required for normalization is determined by the leading zero detection circuit l
1, and the control circuit 14 outputs the control signal of the row labeled type 3 in FIG. 1O. In other words, the leading zero detection circuit 1
The number α obtained according to Figure 7 in 1 is as it is, α=L16・24+L8・23+L4・22+L2・2
Li2, L, 8, L4, L2. with the relationship of 1+L1・20. It is output as an Ll signal. and control signals Ll, L2, L
4, L8, and Li2 operate the corresponding left thicks 21 to 25 to shift the mantissa fu to the left and obtain the normalized mantissa fn.
Outputs 60. Further, the exponent correction eU-α is obtained by operating the complementer 17 using the control signal CMP, taking the 1's complement of α, and adding 1 to the least significant bit using the control signal C=1.
is processed by the adder 18 by adding .

正規化された仮数1口は、さらに丸め判定回路15及び
加算器16で丸め処理が施されるが、少なくとも左2ビ
ツトシフトが行なわれているのでGnビットは常に0で
あり、加算器16ではOとの加算が行なわれ、仮数オー
バーフローが発生することはない。
One normalized mantissa is further rounded by the rounding determination circuit 15 and the adder 16, but since at least a 2-bit shift to the left has been performed, the Gn bit is always 0, and the adder 16 is added, and no mantissa overflow occurs.

4)28の重みを持つビットが012−1の重みを持つ
ビットからRuビットまで全て1の場合。
4) When the bits with a weight of 28 are all 1 from the bit with a weight of 012-1 to the Ru bit.

第19図に示したこの数は、パターンB検出回路13と
Gu、Ruビットから制御回路14で検出される。そし
て制御回路14は第10図のタイプ4と記した行のfi
11御信号左信号する。すなわち仮数の正規化も、指数
の補正もしない。そこでバレルシフタIOから出力され
た仮数f n60のOnビットは第19図に示すように
1であることから、加算器16で必ず丸め処理が行なわ
れ、第18因に示した2θの重みを持つビットだけが1
である仮数fr19が得られる。
This number shown in FIG. 19 is detected by the control circuit 14 from the pattern B detection circuit 13 and the Gu and Ru bits. The control circuit 14 is connected to the fi in the row labeled type 4 in FIG.
11 signal to the left. In other words, neither the mantissa nor the exponent is corrected. Therefore, since the On bit of the mantissa fn60 output from the barrel shifter IO is 1 as shown in FIG. Only 1
A mantissa fr19 is obtained.

ここで、仮数fuをバレルシフタ10で左1ビツトシフ
トし正規化しない理由は次の通りである。
Here, the reason why the mantissa fu is not normalized by shifting it by one bit to the left by the barrel shifter 10 is as follows.

第19図に示した数を左1ビツトシフトして正規化する
と、第20図に示した数となる。しかしこの数のGnビ
ットは1であることから、加算器16で必ず丸め処理が
行なわれ仮数fr19は、第16図に示した21の重み
を持つビットだけが1であるオーバーフローした数とな
り、再び右1ビツトシフトが必要となる。
When the numbers shown in FIG. 19 are normalized by shifting one bit to the left, the numbers shown in FIG. 20 are obtained. However, since the Gn bit of this number is 1, rounding is always performed in the adder 16, and the mantissa fr19 becomes an overflow number where only the bit with a weight of 21 is 1, as shown in FIG. A 1-bit shift to the right is required.

以北のように本実施例に発明によれば、パターンA検出
回路12、パターンB検出回路13、制御回路14を設
け、正規化及びその後の丸め処理の画処理を行なった時
点で仮数部オーバーフローが発生する場合を制御回路1
4で予め検出しておき、制御回路14でバレルシフタ1
0でのシフト数を制御することで、加算器16で丸めを
行なった結果を常に正規化数とすることができる。また
、指数の補正も゛仮数の丸めと並行して加算器18での
1回の加減算で処理することができる。さらに、これら
の処理の実現に必要な新たなハードウェアは、パターン
A検出回路12、パターンB検出回路13、制御回路1
4、だけでありこれらは簡単な絹合せ回路で構成するこ
とができる。
As described above, according to the present embodiment, the pattern A detection circuit 12, the pattern B detection circuit 13, and the control circuit 14 are provided, and the mantissa overflow occurs when normalization and subsequent rounding processing are performed. Control circuit 1
4 in advance, and the control circuit 14 detects the barrel shifter 1.
By controlling the number of shifts at 0, the result of rounding by the adder 16 can always be a normalized number. Further, the correction of the exponent can be processed in parallel with the rounding of the mantissa by one addition/subtraction in the adder 18. Furthermore, new hardware required to realize these processes includes a pattern A detection circuit 12, a pattern B detection circuit 13, and a control circuit 1.
4, and these can be constructed with a simple silk-combining circuit.

発明の詳細 な説明したように本発明によれば、仮数の正規化処理と
丸め処理を一体として制御し、丸めた結果の仮数部がオ
ーバーフローする場合は正規化処理を調整することで、
これを未然に防ぐことができる。しかも仮数の正規化処
理及び丸め処理と、指数の補正処理は並行して処理する
ことができ、仮数、指数をほぼ同時に得ることがことが
でき、その実用的効果は大きい。
DETAILED DESCRIPTION OF THE INVENTION According to the present invention, the normalization process and the rounding process of the mantissa are integrally controlled, and when the mantissa part of the rounded result overflows, the normalization process is adjusted.
This can be prevented. Moreover, the normalization process and rounding process of the mantissa and the correction process of the exponent can be processed in parallel, and the mantissa and exponent can be obtained almost simultaneously, which has a great practical effect.

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

第1図は本発明の一実施例における浮動小数点正規化丸
め装置のブロック図、第2図はバレルシフタのブロック
図、第3図はパターンA検出回路の論理図、第4図はパ
ターンB検出回路の論理図、第5図は本装置へ入力され
る浮動小数点数のフォーマットを示すパターン図、第6
図はバレルシフタ出力のフォーマットを示すパターン図
、第7図は先行零検出回路の人出力関係図、第8図はパ
ターンA検出回路で検出するビットパターンを示すパタ
ーン図、第9図はパターンB検出回路で検出するビット
パターンを示すパターン図、第10図は制御回路の人出
力関係図、第11図は丸め判定回路の入出力図、第12
図は丸められた仮数のフォーマットを示すパターン図、
第13図から第20図は正規化処理あるいは丸め処理さ
れた仮数のピッドパターンを示すパターン図である。 10・・・バレルシフタ、11・・・先行零検出回路、
12・・・パターンA検出回路、 13・・・パターンB検出回路、14・・・制御回路、
15・・・丸め判定回路、16・・・加算器、17・・
・コンプリメンタ、18・・・加算器。 代理人の氏名 弁理士 中尾敏男 はか1名第1図 第2図 5I fu/ z″” 2−? GnR−Sn 第3図 パターンAa出傳号 第4図 パターンB蘂田1宮号 第5図 第6図 第7図 第8図 2°z−’ ?−’ 2−’    z−” ?−” 
i” 2−”第11図 減      鵬
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 a logic diagram of a pattern A detection circuit, and FIG. 4 is a pattern B detection circuit. Figure 5 is a pattern diagram showing the format of floating point numbers input to this device, Figure 6 is a logic diagram of
The figure is a pattern diagram showing the format of the barrel shifter output, Figure 7 is a human output relationship diagram of the preceding zero detection circuit, Figure 8 is a pattern diagram showing the bit pattern detected by the pattern A detection circuit, and Figure 9 is pattern B detection. A pattern diagram showing the bit pattern detected by the circuit, Figure 10 is a human output relationship diagram of the control circuit, Figure 11 is an input/output diagram of the rounding judgment circuit, and Figure 12 is a diagram showing the human output relationship of the control circuit.
The figure is a pattern diagram showing the format of the rounded mantissa,
13 to 20 are pattern diagrams showing pit patterns of mantissas subjected to normalization processing or rounding processing. 10... Barrel shifter, 11... Leading zero detection circuit,
12... Pattern A detection circuit, 13... Pattern B detection circuit, 14... Control circuit,
15... Rounding judgment circuit, 16... Adder, 17...
- Complementor, 18...adder. Name of agent: Patent attorney Toshio Nakao 1 person Figure 1 Figure 2 5I fu/ z″” 2-? GnR-Sn Fig. 3 Pattern Aa Departure No. 4 Pattern B Tsuda 1 Palace No. 5 Fig. 6 Fig. 7 Fig. 8 Fig. 2°z-'? −'2−' z−” ?−”
i"2-"Figure 11 Reduced Peng

Claims (1)

【特許請求の範囲】[Claims] 正規化されていない仮数部及びこれに対応する指数部か
らなる浮動小数点数のうち、仮数部を入力とし正規化に
必要なシフト数を求める第1の手段と、前記仮数部を入
力とし、前記仮数部の正規化及びその後の丸め処理を行
なうと仮数部オーバーフローが発生することを検出する
第2の手段と、前記第1の手段、前記第2の手段の出力
から、前記仮数部を丸めた状態で正規化数とするのに必
要なシフト数を決定しこれ出力する第3の手段と、前記
仮数部を入力とし、前記第3の手段の出力に従ってシフ
トを行なうシフト手段と、前記第3の手段の主力に従っ
て前記指数部を補正する補正手段と、前記シフト手段の
出力である仮数部に丸め処理を施す丸め手段とから構成
されることを特徴とする浮動小数点正規化丸め装置。
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; a second means for detecting that a mantissa overflow occurs when the mantissa is normalized and the subsequent rounding process is performed; a third means for determining and outputting the number of shifts required to normalize the number in the state; a shifting means for receiving the mantissa part as an input and performing a shift according to the output of the third means; A floating point normalization rounding device comprising: a correction means for correcting the exponent part according to the main power of the means; and a rounding means for rounding the mantissa part which is the output of the shift means.
JP63073587A 1988-03-28 1988-03-28 Floating point normalized rounding device Expired - Fee Related JP2558799B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63073587A JP2558799B2 (en) 1988-03-28 1988-03-28 Floating point normalized rounding device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63073587A JP2558799B2 (en) 1988-03-28 1988-03-28 Floating point normalized rounding device

Publications (2)

Publication Number Publication Date
JPH01245328A true JPH01245328A (en) 1989-09-29
JP2558799B2 JP2558799B2 (en) 1996-11-27

Family

ID=13522592

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63073587A Expired - Fee Related JP2558799B2 (en) 1988-03-28 1988-03-28 Floating point normalized rounding device

Country Status (1)

Country Link
JP (1) JP2558799B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100465371B1 (en) * 2001-01-26 2005-01-13 학교법인연세대학교 apparatus and method for design of the floating point ALU performing addition and round operations in parallel

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62213927A (en) * 1986-03-11 1987-09-19 Sumitomo Electric Ind Ltd Machining method for thin wall cylindrical body made of fiber reinforced plastic
JPS62245433A (en) * 1986-04-18 1987-10-26 Oki Electric Ind Co Ltd Floating point arithmetic circuit

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62213927A (en) * 1986-03-11 1987-09-19 Sumitomo Electric Ind Ltd Machining method for thin wall cylindrical body made of fiber reinforced plastic
JPS62245433A (en) * 1986-04-18 1987-10-26 Oki Electric Ind Co Ltd Floating point arithmetic circuit

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100465371B1 (en) * 2001-01-26 2005-01-13 학교법인연세대학교 apparatus and method for design of the floating point ALU performing addition and round operations in parallel

Also Published As

Publication number Publication date
JP2558799B2 (en) 1996-11-27

Similar Documents

Publication Publication Date Title
EP0973089B1 (en) Method and apparatus for computing floating point data
US8185570B2 (en) Three-term input floating-point adder-subtractor
JPH0644225B2 (en) Floating point rounding normalization circuit
JP4500358B2 (en) Arithmetic processing apparatus and arithmetic processing method
KR950029924A (en) Method and device for rounding a floating point addition / subtraction operator
EP0381403A2 (en) Pipelined floating point adder for digital computer
JPH0695851A (en) Method and device for accurate prediction of preceding zero for floating point adder
JP3845009B2 (en) Product-sum operation apparatus and product-sum operation method
JPH05324270A (en) Method and device for converting format for floating point number
US20070038693A1 (en) Method and Processor for Performing a Floating-Point Instruction Within a Processor
JP4806453B2 (en) Arithmetic processing apparatus, information processing apparatus, and arithmetic method
JPH09204295A (en) Sticky bit detecting circuit
JPH01245328A (en) Floating-point normalization rounding device
JPH09114641A (en) Apparatus and method for decision of most significant digit
KR101922462B1 (en) A data processing apparatus and method for performing a shift function on a binary number
EP1282034A2 (en) Elimination of rounding step in the short path of a floating point adder
US5432727A (en) Apparatus for computing a sticky bit for a floating point arithmetic unit
JP2517064B2 (en) Denormalized number processing method
JP3174974B2 (en) Floating point arithmetic device and method
JP2723707B2 (en) Normalization circuit
JPH02115926A (en) Floating point normalizing and rounding device
JPH03217938A (en) Floating deciaml rounding normalizing device
JP3124286B2 (en) Floating point arithmetic unit
JP4428778B2 (en) Arithmetic device, arithmetic method, and computing device
JPS5960637A (en) Arithmetic device for floating decimal point

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees