JPH02267625A - Integer part take-out system using floating point arithmetic - Google Patents

Integer part take-out system using floating point arithmetic

Info

Publication number
JPH02267625A
JPH02267625A JP1089242A JP8924289A JPH02267625A JP H02267625 A JPH02267625 A JP H02267625A JP 1089242 A JP1089242 A JP 1089242A JP 8924289 A JP8924289 A JP 8924289A JP H02267625 A JPH02267625 A JP H02267625A
Authority
JP
Japan
Prior art keywords
rounding
operand
adder
shift
mantissa
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP1089242A
Other languages
Japanese (ja)
Inventor
Itsumi Sugiyama
五美 杉山
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP1089242A priority Critical patent/JPH02267625A/en
Publication of JPH02267625A publication Critical patent/JPH02267625A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To perform an integer part take-out arithmetic with use of a floating point adder by adding a simple hard circuit to the adder. CONSTITUTION:When an operand 1 is added to an operand 2, a floating point adder 20 puts the operand 1 containing a constant 0 of its mantissa part into one of both inputs of the adder 20 together with the operand 2 put into the other input to take out an integer part. Then the adder 20 carries out a floating point addition arithmetic up to an intermediate point and decides whether a rounding operation should be carried out or not during the arithmetic operation. When the rounding operation is carried out by a rounding part 8, a normalizing shift part 7 performs a left shift and 1 is buried into a right shift-in part. At the same time, a 1-addition part 13 adds 1 to the normalized output. As a result, the rounding operation is always carried out at the position of a decimal point. Thus it is just required to add a simple hard circuit to the adder 20. Then an integer part take-out arithmetic is attained with use of the adder 20.

Description

【発明の詳細な説明】 [概要] オペランド1とオペランド2を浮動小数点演算を用いて
加算するシーケンスを用いて整数取出し演算を行う浮動
小数点演算を用いた整数取出し方式に関し、 浮動小数点加算器を用いて整数部取出し演算を行うよう
にすることを目的とし、 オペランド1に仮数部が0の定数を、オペランド2に整
数部取出し用のオペランドをセットし、指数の小さい方
のオペランドの仮数に対して桁合わせシフトを行い、仮
数加算時にデータの一方の入力を抑止し、加算結果を基
に正規化用の左シフトを行い、加算出力及び正規化シフ
ト出力を基にまるめを行うかどうかを決定し、まるめを
行う時には左シフトの右側より1を埋め、正規化シフト
出力に1を加えるまるめ処理を行うように構成する。
[Detailed Description of the Invention] [Summary] This invention relates to an integer retrieval method using a floating point arithmetic operation in which an integer retrieval operation is performed using a sequence in which operands 1 and 2 are added using a floating point arithmetic operation, using a floating point adder. The purpose of this is to perform an operation to extract an integer part, and set a constant whose mantissa part is 0 to operand 1, and an operand for extracting an integer part to operand 2. Performs a digit alignment shift, suppresses one input of data during mantissa addition, performs a left shift for normalization based on the addition result, and determines whether to perform rounding based on the addition output and normalization shift output. , when performing rounding, 1 is filled from the right side of the left shift, and 1 is added to the normalized shift output.

[産業上の利用分野] 本発明はオペランド1とオペランド2を浮動小数点演算
を用いて加算するシーケンスを用いて整数部取出し演算
を行う浮動小数点演算を用いた整数部取出し方式に関す
る。
[Field of Industrial Application] The present invention relates to an integer part retrieval method using floating point arithmetic, which performs an integer part retrieval operation using a sequence in which operands 1 and 2 are added using floating point arithmetic.

計算機の科学技術計算の分野において、データ及び処理
の互換性を保つためIEEE (Institute 
 of  Electrical  and  Ele
ctronics  EngineerS 米国電気電
子技術者協会)が作成した標準形式をサポートするシス
テムが多くなった。その規格の中に整数部取出し演算が
規定されている。
In order to maintain compatibility of data and processing in the field of scientific and technical computing, IEEE
of Electrical and Ele
Many systems now support the standard format created by the American Institute of Electrical and Electronics Engineers (Ctronics Engineers). The standard specifies an operation for extracting the integer part.

[従来の技術] 整数部取出し演算とは、符号(S)、指数(E)及び仮
数(F)より構成されるオペランド(演算の対象となる
数)から指数も加味した本当の整数部を取出すことをい
う。I EEEで規定する整数部取出し演算の大まかな
手順は、以下のとおりである。
[Prior art] An integer part extraction operation is to extract the real integer part, including the exponent, from an operand (number to be operated on) consisting of a sign (S), an exponent (E), and a mantissa (F). Say something. The general procedure for the integer part extraction operation specified by IEEE is as follows.

■データが数値がどうか判定する。■Determine whether the data is a numerical value.

■指数がまるめの必要範囲にあるかどうかの判定をする
■Determine whether the index is within the required range for rounding.

■指数がまるめの必要範囲にあれば、小数点位置にてま
るめを行い、小数点以下にOを埋める。指数がまるめの
必要範囲になければまるめをしない。
■If the exponent is within the required rounding range, round at the decimal point and fill in O's below the decimal point. If the exponent is not within the required rounding range, no rounding will be performed.

[発明が解決しようとする課題] 整数取出し演算は、前述したように小数点位置にてまる
めを行なわなければならない。このまるめ演算を高速に
実行しようとすると、小数点位置検出回路と小数点位置
にてまるめるまるめ回路が必要となり、ハード回路が増
えて価格も高くなってしまう。
[Problems to be Solved by the Invention] In the integer extraction operation, rounding must be performed at the decimal point position as described above. If this rounding operation is to be executed at high speed, a decimal point position detection circuit and a rounding circuit for rounding at the decimal point position are required, which increases the number of hardware circuits and increases the price.

本発明はこのような課題に鑑みてなされたものであって
、浮動小数点加算器を用いて整数部取出し演算を行うこ
とができるようにした浮動小数点演算を用いた整数部取
出し方式を提供することを目的としている。
The present invention has been made in view of the above-mentioned problems, and provides an integer part extraction method using floating point arithmetic, which enables integer part extraction operations to be performed using a floating point adder. It is an object.

[課題を解決するための手段] 第1図は本発明方式の原理を示すフローチャートである
。本発明は、 オペランド1とオペランド2とを加算演算する場合にお
いて、 オペランド1に仮数部が0の定数を、オペランド2に整
数部取出し用のオペランドをセットしくステップ1)、 指数の小さい方のオペランドの仮数に対して桁合わせシ
フトを行い(ステップ2)、 仮数加算時にデータの一方の入力を抑止しくステップ3
)、 加算結果を基に正規化用の左シフトを行い(ステップ4
)、 桁合わせ出力及び加算出力を基にまるめを行うかどうか
を決定しくステップ5)、 まるめを行う時には左シフトの右側より1を埋め(ステ
ップ6)、 正規化シフト出力に1を加えるまるめ処理を行う(ステ
ップ7)ようにしたことを特徴としている。
[Means for Solving the Problems] FIG. 1 is a flowchart showing the principle of the system of the present invention. In the present invention, when performing an addition operation between operand 1 and operand 2, set a constant whose mantissa part is 0 to operand 1, set an operand for extracting the integer part to operand 2, and use the operand with the smaller exponent. Performs digit alignment shift on the mantissa (Step 2), and suppresses input of one side of the data when adding the mantissa (Step 3)
), and performs a left shift for normalization based on the addition result (step 4
), Decide whether to perform rounding based on the digit alignment output and addition output. Step 5). When rounding, fill in 1 from the right side of the left shift (Step 6), and add 1 to the normalized shift output. (Step 7).

[作用] 浮動小数点加算器の一方に仮数部が0の定数を入れて、
他方の入力に整数部取出しを行うオペランドを入れ、途
中まで浮動小数点加算演算を行い、演算途中でまるめを
行うかどうかを決定する。まるめを行う場合には、正規
化シフトの左シフトを行った後、その右側のシフトイン
部に1を埋め、正規化出力に1を加える。この結果、小
数点位置で必ずまるめが行われることになる。本発明に
よれば浮動小数点加算器にハード回路を少し追加するだ
けですみ、ハード回路が増えて価格が高くなってしまう
こともない。
[Operation] Put a constant whose mantissa part is 0 in one side of the floating-point adder,
An operand for extracting the integer part is input to the other input, a floating point addition operation is performed halfway through the operation, and it is determined whether or not to perform rounding in the middle of the operation. When performing rounding, after performing a left shift of the normalization shift, 1 is filled in the shift-in section on the right side, and 1 is added to the normalization output. As a result, rounding is always performed at the decimal point. According to the present invention, it is only necessary to add a small amount of hardware circuitry to the floating-point adder, and the cost does not increase due to an increase in the number of hardware circuits.

[実施例] 以下、図面を参照して本発明の実施例を詳細に説明する
[Example] Hereinafter, an example of the present invention will be described in detail with reference to the drawings.

第2図は本発明を実施するための回路ブロック図である
。図において、20は標準の浮動小数点加算器である。
FIG. 2 is a circuit block diagram for implementing the present invention. In the figure, 20 is a standard floating point adder.

オペランド1の指数をa1仮数をb1オペランド2の指
数を01仮数をdとする。
Let the exponent of operand 1 be a1, the mantissa be b1, the exponent of operand 2 be 01, and the mantissa be d.

図において、1は指数aとCの大小関係を比較する指数
比較部、2は指数aとCのいずれか一方をセレクトする
セレクタ、3は仮数す、dのいずれか一方をセレクトす
るセレクタ、4も仮数す。
In the figure, 1 is an index comparison unit that compares the magnitude relationship between exponents a and C, 2 is a selector that selects either one of exponents a or C, 3 is a selector that selects either mantissa or d, and 4 is a selector that selects one of exponents a and C. is also a mantissa.

dのいずれ・か一方をセレクトするセレクタである。This is a selector that selects either one of d.

5はセレクタ4から出力される仮数を桁合わせシフトす
る桁合わせシフト部、6はセレクタ3から出力される仮
数と、桁合わせシフト部5から出力される仮数の加算を
行う仮数加算部である。
Reference numeral 5 denotes a digit alignment shifter for digit alignment shifting of the mantissa output from the selector 4, and numeral 6 a mantissa addition unit for adding the mantissa output from the selector 3 and the mantissa output from the digit alignment shifter 5.

7は仮数加算部6の出力を受けて正規化のための小数点
のシフトを行う正規化シフト部、8は正規化シフト部7
の出力に対してまるめ処理を行うまるめ部、9はセレク
タ2よりセレクトされた指数に対して正規化時の補正を
行う指数補正部である。以上説明した部分がオペランド
1とオペランド2の浮動小数点加算を行う浮動小数点加
算器20である。まるめ部8からは仮数が出力され、指
数補正部9から指数が出力され、指数と仮数とで加算結
果としての出力となる。
7 is a normalization shift unit that receives the output of the mantissa addition unit 6 and shifts the decimal point for normalization; 8 is a normalization shift unit 7
A rounding unit 9 performs rounding processing on the output of , and 9 is an exponent correction unit that performs correction on the exponent selected by the selector 2 during normalization. The part described above is the floating point adder 20 that performs floating point addition of operands 1 and 2. A mantissa is output from the rounding unit 8, an exponent is output from the exponent correction unit 9, and the exponent and the mantissa are output as an addition result.

11は桁合わせシフト部5及び仮数加算部6の出力を受
けてまるめを行うかどうかを決定するまるめ決定部、1
2は正規化の左シフトを行った場合に、まるめを行う場
合にその右側に1を、まるめを行わない場合には0を埋
合わせる埋合わせ部、13はまるめを行う場合に正規化
シフト部7の出力のLSBに1を加える1加算部である
。このように構成された回路の動作を第3図に示すフロ
ーチャートを参照しつつ説明すれば、以下のとおりであ
る。
11 is a rounding determination unit that receives the outputs of the digit alignment shift unit 5 and the mantissa addition unit 6 and determines whether or not rounding is to be performed;
2 is a filling part that fills in 1 to the right side when performing a left shift of normalization, and 0 when rounding is not performed, and 13 is a normalization shift part when performing rounding. This is a 1 adder that adds 1 to the LSB of the output of 7. The operation of the circuit configured as described above will be explained below with reference to the flowchart shown in FIG.

先ず、オペランド1.2にセットを行う(Sl)。オペ
ランド1には仮数の最下位桁が2の0乗になるような指
数であって、仮数部が全て0であるような浮動小数点数
をもつ定数がセットされる。
First, operand 1.2 is set (Sl). Operand 1 is set to a constant having a floating point number whose exponent is such that the least significant digit of the mantissa is 2 to the power of 0, and whose mantissa part is all 0.

オペランド2には、指数取出し演算用のオペランドがセ
ットされる。指数比較部1はオペランド1の指数aとオ
ペランド2の指数Cとを比較する(S2)。比較の結果
、arcの場合には、指数比較部1はセレクタ2〜4に
セレクト信号を与え、セレクタ2はaをセレクトし、セ
レクタ3はb(−〇)をセレクトし、セレクタ4は暗に
示された最上位仮数を含むdをセレクトする(S3)。
Operand 2 is set to an operand for exponent extraction calculation. The index comparator 1 compares the index a of the operand 1 and the index C of the operand 2 (S2). As a result of the comparison, in the case of arc, the index comparator 1 gives select signals to selectors 2 to 4, selector 2 selects a, selector 3 selects b(-〇), and selector 4 implicitly Select d that includes the indicated most significant mantissa (S3).

比較の結果、a≦Cの場合には、指数比較部1はセレク
タ2〜4にセレクト信号を与え、セレクタ2はCをセレ
クトし、セレクタ3は暗に示された最上位仮数を含むd
をセレクトし、セレクタ4はb (−〇)をセレクトす
る(S4)。桁合わせシフト部5は指数比較部1で求め
られた指数差分だけセレクタ4出力を右シフトし、左か
ら0を埋める(S5)。更に、桁合わせシフト部5はま
るめ判定のために、保護桁、まるめ桁、粘着桁等を求め
る(S6)。
As a result of the comparison, if a≦C, the exponent comparison unit 1 gives select signals to selectors 2 to 4, selector 2 selects C, and selector 3 selects d containing the implied highest mantissa.
, and the selector 4 selects b (-0) (S4). The digit alignment shift unit 5 shifts the output of the selector 4 to the right by the index difference determined by the index comparison unit 1, and fills it with 0 from the left (S5). Further, the digit alignment shift unit 5 obtains a guard digit, a rounding digit, an adhesive digit, etc. for rounding determination (S6).

第4図は保護桁、まるめ桁、粘着桁の説明図である。図
に示す仮数F1とF2は桁合わせが行われているものと
する。FlとF2の加算を行った結果がF3である。F
lの最少位桁よりも小さいF2の部分はI EEE形式
では、保護桁G、まるめ桁R及び粘着桁にとして3ビツ
トのデータが保存される。ここで、粘着桁にとは自己よ
り下の桁(図の斜線領域)に1個でも1が含まれている
場合に1となる。これらG、R,にデータを基にまるめ
の必要性が判定されることになる。
FIG. 4 is an explanatory diagram of the protection girder, rounding girder, and adhesive girder. It is assumed that the digits of the mantissas F1 and F2 shown in the figure are aligned. The result of adding Fl and F2 is F3. F
In the IEEE format, the portion of F2 smaller than the least significant digit of l is stored as 3-bit data as a guard digit G, a rounding digit R, and a sticky digit. Here, an adhesive digit is 1 if at least one 1 is included in the digits below it (the shaded area in the figure). The necessity of rounding is determined based on these G, R, data.

次に、仮数加算部6によりオペランド1と2の仮数の加
算を行なう(S7)。具体的には、セレクタ3の出力と
桁合わせシフト部5の出力の加算を行う。この場合にお
いて、仮数加算部6は定数側の入力を抑止し、0とみな
して加算を行う。これにより、仮数加算部6の出力は、
整数部取出し演算のオペランド(オペランド2)が定数
(オペランド1)よりも小さい時は右端が2の0乗に揃
えられた数になり、整数部取出し演算のオペランド(オ
ペランド2)が定数(オペランド1)よりも大きい時は
オペランドの数になる。
Next, the mantissa addition unit 6 adds the mantissas of operands 1 and 2 (S7). Specifically, the output of the selector 3 and the output of the digit alignment shift section 5 are added. In this case, the mantissa addition unit 6 suppresses input on the constant side, assumes it to be 0, and performs addition. As a result, the output of the mantissa addition unit 6 is
When the operand (operand 2) of the integer part extraction operation is smaller than the constant (operand 1), the right end is aligned to the 0th power of 2, and the operand (operand 2) of the integer part extraction operation is smaller than the constant (operand 1). ), it becomes the number of operands.

仮数加算部6の加算結果を基に、指数補正部9の指数補
正を行う(S8)。つまり、2つの仮数の加算結果によ
り桁上がりが発生する可能性があるので、若し桁上がり
が発生したら、その分だけ指数補正部9の指数を増やし
てやる必要があるからである。正規化シフト部7では、
仮数加算部6の加算結果を基に正規化量を求め左シフト
する(S9)。この時、第4図に示したG、 R,K桁
は含めない。
Based on the addition result of the mantissa addition unit 6, the exponent correction unit 9 performs exponent correction (S8). In other words, since there is a possibility that a carry may occur as a result of the addition of two mantissas, if a carry occurs, it is necessary to increase the exponent of the exponent correction unit 9 by that amount. In the normalization shift section 7,
A normalized amount is determined based on the addition result of the mantissa addition unit 6 and shifted to the left (S9). At this time, the G, R, and K digits shown in Figure 4 are not included.

まるめ決定部11は、桁合わせシフト部5及び仮数加算
部6の出力を基にまるめを行うかどうか決定する(S 
10)。まるめを行う場合には、埋合わせ部12から正
規化シフト部7にデータを与え、左シフトの右側より1
を埋め(Sll)、1加算部13はまるめ部8のLSB
に1を加える(S 12)。この結果、まるめ部8でま
るめを行う時に、2の0乗まで桁上がりが伝搬して2の
0乗でのまるめが行われる。
The rounding determination unit 11 determines whether to perform rounding based on the outputs of the digit alignment shift unit 5 and the mantissa addition unit 6 (S
10). When performing rounding, data is given from the filling unit 12 to the normalization shift unit 7, and data is rounded by 1 from the right side of the left shift.
is filled in (Sll), and the 1 addition section 13 fills in the LSB of the rounding section 8.
1 is added to (S12). As a result, when rounding is performed in the rounding unit 8, the carry propagates to the 0th power of 2, and rounding is performed to the 0th power of 2.

一方、S10においてまるめの必要がなかった場合には
、埋合わせ部12は正規化シフト部7にデータを与え、
左シフトの右側より0を埋め(813)、まるめ処理を
行わずそのまま出力する(S14)。このようにして、
指数補正部9からは補正された指数がまるめ部8からは
必要に応じてまるめ処理された仮数が出力される。これ
ら指数と仮数で表されるデータが整数部取出し演算の結
果となる。
On the other hand, if there is no need for rounding in S10, the filling unit 12 provides data to the normalization shift unit 7,
Zeros are filled from the right side of the left shift (813), and the data is output as is without rounding (S14). In this way,
The exponent correction section 9 outputs a corrected exponent, and the rounding section 8 outputs a mantissa rounded as necessary. The data represented by these exponents and mantissas becomes the result of the integer part extraction operation.

第5図はまるめ制御を示すフローチャートで、第3図に
示したまるめ制御シーケンスを更に詳細に示したもので
ある。先ず、整数部取出し演算であるかどうかがチエツ
クされ(sl)、整数部取出し演算の場合に図に示すシ
ーケンスとなる。ここでは、桁合わせシーケンス以降の
シーケンスが示されている。桁合わせシフト部5による
桁合わせの結果が出力される(S2)。ここで、符号を
S、有効数字の最下位桁をI、保護桁をG、まるめ桁を
R1粘着桁をKとする。
FIG. 5 is a flowchart showing rounding control, which shows the rounding control sequence shown in FIG. 3 in more detail. First, it is checked (sl) whether or not it is an integer part extraction operation, and in the case of an integer part extraction operation, the sequence shown in the figure is obtained. Here, the sequence after the digit alignment sequence is shown. The result of digit alignment by the digit alignment shifter 5 is output (S2). Here, the code is S, the least significant digit is I, the guard digit is G, the rounding digit is R1, and the sticky digit is K.

次に、まるめ決定部11によりまるめの種類が判定され
る(S3)。まるめの種類には、図に示すように最近値
まるめ、ゼロ方向まるめ、正方向まるめ及び負方向まる
めの4種類がある。これらまるめのうち、ゼロ方向まる
めの場合にはまるめは行われない。この場合には、埋合
わせ部12により正規化シフトインデータに“0”を埋
め(S4)、有効桁の最下位に“0”を加えるまるめ加
算を行う(S5)。つまり、この場合には、まるめを行
わずそのまま出力することになる。
Next, the type of rounding is determined by the rounding determination unit 11 (S3). As shown in the figure, there are four types of rounding: nearest rounding, zero rounding, positive rounding, and negative rounding. Among these roundings, in the case of zero direction rounding, no rounding is performed. In this case, the filling unit 12 fills the normalized shift-in data with "0" (S4), and performs round addition to add "0" to the least significant digit (S5). In other words, in this case, the data will be output as is without rounding.

まるめが最近値まるめであった場合には、まるめ決定部
11はG−1でかっr、 R,Kビットのいずれか1つ
が1であるかどうかチエツクする(S6)。そうであっ
た場合には、埋合わせ部12により正規化シフトのシフ
トインデータに“1″を埋め(S7)、1加算部13に
より有効桁の最下位に“1”を加え、まるめ加算を行う
(S8)。
If the rounding is the nearest value rounding, the rounding determining unit 11 checks whether any one of the R, R, and K bits in G-1 is 1 (S6). If so, the filler 12 fills the shift-in data of the normalized shift with "1" (S7), the 1 adder 13 adds "1" to the lowest significant digit, and rounding addition is performed. Execute (S8).

そうでない場合、つまりG−1でかっI、R,にビット
のいずれか1つが1であるという条件が成立しない場合
にはS4.S5の処理を行う。
If this is not the case, that is, if the condition that any one of the bits in G-1 is 1 is not satisfied, S4. Perform the process of S5.

まるめが正方向まるめであった場合には、まるめ決定部
11はS−1でかっG、R,にビットのいずれか1つが
1であるかどうかチエツクする(S9)。そうであった
場合には、埋合わせ部12により正規化シフトのシフト
インデータに“1”を埋め(S7)、1加算部13によ
り有効桁の最下位に“1”を加え、まるめ加算を行う(
S8)。
If the rounding is positive rounding, the rounding determining unit 11 checks whether any one of the bits G, R, in S-1 is 1 (S9). If so, the filler 12 fills the shift-in data of the normalized shift with "1" (S7), the 1 adder 13 adds "1" to the lowest significant digit, and rounding addition is performed. conduct(
S8).

そうでない場合、つまりS−1でかっG、R,にビット
のいずれか1つが1であるという条件が成立しない場合
にはS4.S5の処理を行う。
If this is not the case, that is, if the condition that one of the bits in G, R, and S-1 is not satisfied, S4. Perform the process of S5.

まるめが負方向まるめであった場合には、まるめ決定部
11はS−1でかつG、 R,Kビットのいずれか1つ
が1であるかどうかチエツクする(S 10)。そうで
あった場合には、埋合わせ部12により正規化シフトの
シフトインデータに“1”を埋め(S7)、1加算部1
3により有効桁の最下位に“1“を加え、まるめ加算を
行う(S8)。そうでない場合、つまりS−1でかっG
、 R,Kビットのいずれか1つが1であるという条件
が成立しない場合にはS4.S5の処理を行う。
If the rounding is negative rounding, the rounding determining unit 11 checks whether S-1 and any one of the G, R, and K bits is 1 (S10). If so, the filler 12 fills the shift-in data of the normalized shift with "1" (S7), and the 1 adder 1
3, "1" is added to the lowest significant digit and rounded addition is performed (S8). If not, that is S-1 big G
, If the condition that one of the R and K bits is 1 is not satisfied, step S4. Perform the process of S5.

上述の説明では、オペランド1として定数を浮動小数点
加算器20の一方の入力に入れる場合について説明した
。本発明はこれに限るものではなく、制御回路によって
自動的に定数を発生させるようにしてもよい。
In the above description, a case has been described in which a constant is input as operand 1 to one input of the floating point adder 20. The present invention is not limited to this, and the constant may be automatically generated by the control circuit.

[発明の効果] 以上、詳細に説明したように、本発明によれば浮動小数
点加算器に簡単なハード回路を付加することにより浮動
小数点加算器を用いて整数部取出し演算を行うことがで
きるようにした浮動小数点演算を用いた整数部取出し方
式を提供することができ、ハード回路も簡単で価格も低
く抑えることができる。
[Effects of the Invention] As described above in detail, according to the present invention, by adding a simple hardware circuit to the floating-point adder, it is possible to perform integer part extraction operations using the floating-point adder. It is possible to provide an integer part extraction method using floating point arithmetic, and the hardware circuit is simple and the cost can be kept low.

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

第1図は本発明方式の原理を示すフローチャート、 第2図は本発明を実施するための回路ブロック図、 第3図は第2図回路の動作を示すフローチャート、 第4図は保護桁、まるめ桁、粘着桁の説明図、第5図は
まるめ制御を示すフローチャートである。 第2図において、 1は指数比較部、 2〜4はセレクタ、 5は桁合わせシフト部、 6は仮数加算部、 7は正規化シフト部、 8はまるめ部、 9は指数補正部、 11はまるめ決定部、 12は埋め合わせ部、 13は1加算部である。
Fig. 1 is a flowchart showing the principle of the method of the present invention, Fig. 2 is a circuit block diagram for implementing the invention, Fig. 3 is a flowchart showing the operation of the circuit shown in Fig. 2, and Fig. 4 is a guard girder, rounding. FIG. 5, which is an explanatory diagram of the girder and the adhesive girder, is a flowchart showing the rounding control. In Fig. 2, 1 is an exponent comparison section, 2 to 4 are selectors, 5 is a digit alignment shift section, 6 is a mantissa addition section, 7 is a normalization shift section, 8 is a rounding section, 9 is an exponent correction section, and 11 is an exponent correction section. A rounding determination section, 12 a filling section, and 13 a 1 addition section.

Claims (1)

【特許請求の範囲】 オペランド1とオペランド2とを加算演算する場合にお
いて、 オペランド1に仮数部が0の定数を、オペランド2に整
数部取出し用のオペランドをセットし(ステップ1)、 指数の小さい方のオペランドの仮数に対して桁合わせシ
フトを行い(ステップ2)、 仮数加算時にデータの一方の入力を抑止し(ステップ3
)、 加算結果を基に正規化用の左シフトを行い(ステップ4
)、 桁合わせ出力及び加算出力を基にまるめを行うかどうか
を決定し(ステップ5)、 まるめを行う時には左シフトの右側より1を埋め(ステ
ップ6)、 正規化シフト出力に1を加えるまるめ処理を行う(ステ
ップ7)ようにしたことを特徴とする浮動小数点演算を
用いた整数部取出し方式。
[Claims] When performing an addition operation between operand 1 and operand 2, set a constant whose mantissa part is 0 to operand 1, set an operand for extracting the integer part to operand 2 (step 1), and set a constant whose mantissa part is 0 to operand 1 (step 1). Performs a digit alignment shift on the mantissa of the other operand (step 2), and inhibits input of one of the data when adding the mantissa (step 3).
), and performs a left shift for normalization based on the addition result (step 4
), determines whether to perform rounding based on the digit alignment output and addition output (step 5), and when rounding, fills in 1 from the right side of the left shift (step 6), and adds 1 to the normalized shift output. An integer part extraction method using floating point arithmetic, characterized in that processing is performed (step 7).
JP1089242A 1989-04-07 1989-04-07 Integer part take-out system using floating point arithmetic Pending JPH02267625A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1089242A JPH02267625A (en) 1989-04-07 1989-04-07 Integer part take-out system using floating point arithmetic

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1089242A JPH02267625A (en) 1989-04-07 1989-04-07 Integer part take-out system using floating point arithmetic

Publications (1)

Publication Number Publication Date
JPH02267625A true JPH02267625A (en) 1990-11-01

Family

ID=13965281

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1089242A Pending JPH02267625A (en) 1989-04-07 1989-04-07 Integer part take-out system using floating point arithmetic

Country Status (1)

Country Link
JP (1) JPH02267625A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8874630B2 (en) 2010-11-17 2014-10-28 Samsung Electronics Co., Ltd. Apparatus and method for converting data between a floating-point number and an integer

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8874630B2 (en) 2010-11-17 2014-10-28 Samsung Electronics Co., Ltd. Apparatus and method for converting data between a floating-point number and an integer

Similar Documents

Publication Publication Date Title
EP0973089B1 (en) Method and apparatus for computing floating point data
EP0483864B1 (en) Hardware arrangement for floating-point addition and subtraction
US4941120A (en) Floating point normalization and rounding prediction circuit
US5317526A (en) Format conversion method of floating point number and device employing the same
JPH07210368A (en) Efficient handling method by hardware of positive and negative overflows generated as result of arithmetic operation
EP0464493A2 (en) High-radix divider
US7720898B2 (en) Apparatus and method for adjusting exponents of floating point numbers
US5677861A (en) Arithmetic apparatus for floating-point numbers
US6175851B1 (en) Fast adder/subtractor for signed floating point numbers
US4594680A (en) Apparatus for performing quadratic convergence division in a large data processing system
US6205462B1 (en) Digital multiply-accumulate circuit that can operate on both integer and floating point numbers simultaneously
US5867413A (en) Fast method of floating-point multiplication and accumulation
KR102639646B1 (en) Multi-input floating point adder
US7401107B2 (en) Data processing apparatus and method for converting a fixed point number to a floating point number
US4823300A (en) Performing binary multiplication using minimal path algorithm
Schwarz Binary Floating-Point Unit Design: the fused multiply-add dataflow
EP0332215B1 (en) Operation circuit based on floating-point representation
US6571264B1 (en) Floating-point arithmetic device
US7003540B2 (en) Floating point multiplier for delimited operands
JPH02267625A (en) Integer part take-out system using floating point arithmetic
US5798958A (en) Zero detect for binary sum
US6044391A (en) Method of generating the sticky-bit from the input operands
US5944773A (en) Floating-point multiplier circuit for generating the sticky-bit from the input operands
GB2275355A (en) Detection of exponent underflow and overflow in a floating point adder
JP2664750B2 (en) Arithmetic device and arithmetic processing method