JPH0799496B2 - Floating point mantissa digit matching circuit - Google Patents

Floating point mantissa digit matching circuit

Info

Publication number
JPH0799496B2
JPH0799496B2 JP61265999A JP26599986A JPH0799496B2 JP H0799496 B2 JPH0799496 B2 JP H0799496B2 JP 61265999 A JP61265999 A JP 61265999A JP 26599986 A JP26599986 A JP 26599986A JP H0799496 B2 JPH0799496 B2 JP H0799496B2
Authority
JP
Japan
Prior art keywords
bit
floating
point data
mantissa
shifter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP61265999A
Other languages
Japanese (ja)
Other versions
JPS63118933A (en
Inventor
勝彦 上田
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 JP61265999A priority Critical patent/JPH0799496B2/en
Publication of JPS63118933A publication Critical patent/JPS63118933A/en
Publication of JPH0799496B2 publication Critical patent/JPH0799496B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】 産業上の利用分野 本発明は、浮動小数点データの加減算に先だって必要
な、仮数部桁合わせを行なう、浮動小数点仮数部桁合わ
せ回路に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a floating point mantissa digit alignment circuit for performing mantissa digit alignment required before addition and subtraction of floating point data.

従来の技術 従来の浮動小数点仮数部桁合わせ回路としては、例えば
特開昭60−263230号公報に、発明構成要素の一つとして
示されている。第4図はこの発明の実施例の中から、浮
動小数点仮数部桁合わせ回路のみを抜きだしたものであ
る。1,2は、浮動小数点データを保持する入力レジス
タ、3は入力レジスタ1,2に保持されている浮動小数点
データの指数部の大小関係と両者の差の絶対値とを出力
する指数部比較回路、4,5は指数部比較回路3の出力を
保持するレジスタ、6はレジスタ4の出力により、レジ
スタ1,2に保持されている浮動小数点データの一方の仮
数部を選択する仮数部セレクタ、7はレジスタ5の出力
に従って仮数部セレクタ6の出力を右にシフトする桁合
わせ右シフタである。
2. Description of the Related Art A conventional floating point mantissa digit matching circuit is disclosed as one of the constituent elements of the invention in, for example, Japanese Patent Laid-Open No. 60-263230. FIG. 4 shows only the floating point mantissa digit aligning circuit extracted from the embodiment of the present invention. 1 and 2 are input registers that hold floating-point data, and 3 is an exponent comparison circuit that outputs the magnitude relationship between the exponents of the floating-point data held in the input registers 1 and 2 and the absolute value of the difference between them. , 4,5 are registers for holding the output of the exponent comparison circuit 3, 6 is a mantissa selector for selecting one mantissa of the floating point data held in the registers 1, 2 by the output of the register 4, 7 Is a digit alignment right shifter for shifting the output of the mantissa selector 6 to the right according to the output of the register 5.

以上のように構成された、従来の浮動小数点桁仮数部合
わせ回路においては、指数部比較回路3により入力レジ
スタ1,2に保持されている浮動小数点データの指数部を
比較し、レジスタ4の出力で示される大小関係判定結果
で小さいほうの指数部を持つ浮動小数点データの仮数部
を仮数部セレクタ6で取り出し、さらに、レジスタ5の
出力で示される指数差の絶対値分だけ、桁合わせ右シフ
トを行なう。
In the conventional floating-point digit mantissa part matching circuit configured as above, the exponent parts of the floating-point data held in the input registers 1 and 2 are compared by the exponent part comparison circuit 3, and the output of the register 4 is compared. The mantissa part of the floating-point data having the smaller exponent part is taken out by the mantissa part selector 6 in the magnitude relationship judgment result shown by and the digit shift right shift is performed by the absolute value of the exponent difference indicated by the output of the register 5. Do.

発明が解決しようとする問題点 しかしながら上記のような構成では、指数部比較回路3
で求めた指数差は絶対値である必要があり、指数部比較
回路3は単純な減算器では構成できずその回路規模は大
きくなる。また絶対値計算を必要とするため、桁合わせ
右シフタ7に与えるシフト数指示用データを、高速に供
給できないという問題点を有していた。
Problems to be Solved by the Invention However, in the above configuration, the exponent comparison circuit 3
The exponent difference calculated in step 1 needs to be an absolute value, and the exponent part comparison circuit 3 cannot be configured by a simple subtractor, so that the circuit scale becomes large. Further, since the absolute value calculation is required, there is a problem that the shift number instruction data given to the digit alignment right shifter 7 cannot be supplied at high speed.

本発明はかかる点に鑑み、簡単な指数部比較回路を持
ち、高速に仮数部桁合わせを行なう浮動小数点仮数部桁
合わせ回路を提供することを目的とする。
In view of this point, the present invention has an object to provide a floating-point mantissa digit aligning circuit which has a simple exponential part comparing circuit and performs mantissa digit aligning at high speed.

問題点を解決するための手段 本発明はnビットの指数部、及び仮数部から構成される
第1,第2の浮動小数点データで、前記第1の浮動小数点
データの指数部から前記第2の浮動小数点データの指数
部を減算しその差を2の補数体系で求める減算器と、前
記減算器出力の最上位ビットが“0"の時には前記第2の
浮動小数点データの仮数部を、“1"の時には前記第1の
浮動小数点データの仮数部を出力するマルチプレクサ
と、前記減算器出力の最上位ビットが“1"の時右1ビッ
トシフトを行なう右1ビットシフタと、前記右1ビット
シフタに従属接続され、それぞれ右2kビットシフト{k
=0〜(n−1)}を行なうn段の右2kビットシフト
と、前記減算器出力の最上位ビットが“0"の時には2k
重みを持つ前記減算器出力ビットを前記右2kビットシフ
タの制御入力とし、前記減算器出力の最上位ビットが
“1"の時には2kの重みを持つ前記減算器出力ビットを反
転して前記右2kビットシフタの制御入力とする制御部と
を備えた浮動小数点仮数部桁合わせ回路である。
Means for Solving the Problems The present invention provides first and second floating-point data composed of an n-bit exponent part and a mantissa part, and the exponent part of the first floating-point data to the second floating-point data. A subtracter that subtracts the exponent part of floating-point data and finds the difference by a two's complement system; and a mantissa part of the second floating-point data is "1" when the most significant bit of the subtractor output is "0". When ", a multiplexer that outputs the mantissa part of the first floating-point data, a right 1-bit shifter that shifts right 1 bit when the most significant bit of the subtractor output is" 1 ", and a subordinate to the right 1-bit shifter Connected and shifted right 2 k bits {k
= 0 to (n-1)} n stages of right 2 k bit shifts, and when the most significant bit of the subtractor output is "0", the subtractor output bit having a weight of 2 k is set to the right 2 the control input of the k bit shifter, and a control unit to control the input of the subtractor output bit inversion to the right 2 k bit shifter having a weight of 2 k when the most significant bit is "1" of the subtraction output This is a floating point mantissa digit matching circuit provided.

作用 本発明は前記した構成により、前記減算器で、第1の浮
動小数点データの指数部から第2の浮動小数点データの
指数部を減算し、減算結果の最上位ビットが“0"の時に
は、第2の浮動小数点データの仮数部を、前記減算器の
出力ビットに従って前記右2kビットシフタでシフトし、
減算結果の最上位ビットが“1"の時には、第1の浮動小
数点データの仮数部を、前記右1ビットシフタで右1ビ
ットシフトし、さらに前記減算器の出力ビットを反転し
たビットに従って前記右2kビットシフタでシフトし、仮
数部桁合わせを行なう。
With the above-described configuration, the present invention subtracts the exponent part of the second floating-point data from the exponent part of the first floating-point data by the subtracter, and when the most significant bit of the subtraction result is "0", The mantissa part of the second floating point data is shifted by the right 2 k- bit shifter according to the output bits of the subtractor,
When the most significant bit of the subtraction result is "1", the mantissa part of the first floating-point data is shifted right 1 bit by the right 1-bit shifter, and the right 2 bit is shifted according to the bit obtained by inverting the output bit of the subtracter. Shift with a k- bit shifter to align mantissa digits.

実 施 例 第1図は本発明の一実施例における浮動小数点仮数部桁
合わせ回路の構成図を示すものである。第1図において
10,11は浮動小数点データを保持する入力レジスタであ
る。また、浮動小数点データのフォーマットは第2図に
示すようなものを考える。即ち、指数部eは2の補数表
現で、仮数部fは絶対値表示で、符号は符号ビットsで
表現し、全体として、(−1)・2e・fの数を表現す
る。しかし、指数部の表現方法をバイアス表示にしても
本発明の構成には何らの変更を行なう必要はない。また
説明の簡単化のため、指数部eを3ビットとする。そこ
で、指数部eの3ビットはそのビットパターンにより、
表1に示す値をとり、±2-4・fから±23・fの数、及
び0が表現できる。
Practical Example FIG. 1 shows the configuration of a floating point mantissa digit matching circuit in an embodiment of the present invention. In Figure 1
Input registers 10 and 11 hold floating-point data. Also, consider the format of floating-point data as shown in FIG. That is, the exponent part e is represented by 2's complement, the mantissa part f is represented by an absolute value, and the sign is represented by the sign bit s. As a whole, the number of (−1) s · 2 e · f is represented. However, it is not necessary to make any changes to the configuration of the present invention even if the expression method of the exponent part is biased. Further, for simplification of description, the exponent part e has 3 bits. Therefore, the 3 bits of the exponent part e are
Taking the values shown in Table 1, the numbers from ± 2 −4 · f to ± 2 3 · f and 0 can be expressed.

第1図の12は、入力レジスタ10に保持されている浮動小
数点データ中の指数部e1から入力レジスタ11に保持され
ている浮動小数点データ中の指数部e2を減算しその結果
を負数は2の補数で示す減算器、13は減算器12の最上位
ビットd3が、“1"の時には、入力レジスタ10に保持され
ている浮動小数点データ中の仮数部f1を、“0"の時に
は、入力レジスタ11に保持されている浮動小数点データ
中の仮数部f2を選択するマルチプレクサである。14は、
減算器12の最上位ビットd3が“1"の時、マルチプレクサ
13の出力を右1ビットシフトを行なう右1ビットシフタ
である。15は右に1ビットシフトを行なう右1ビットシ
フタ、16は右に2ビットシフタを行なう右2ビットシフ
タ、17は右に4ビットシフトを行なう右4ビットシフタ
である。18はシフタ15,16,17を制御線R1,R2,R4を通して
制御する制御部であり、その構成を第3図に示す。
12 in FIG. 1 subtracts the exponent part e 2 in the floating point data held in the input register 11 from the exponent part e 1 in the floating point data held in the input register 10 A subtracter indicated by 2's complement, 13 indicates the mantissa part f 1 in the floating point data held in the input register 10 when the most significant bit d 3 of the subtractor 12 is “1”. Sometimes it is a multiplexer that selects the mantissa part f 2 in the floating point data held in the input register 11. 14 is
When the most significant bit d 3 of the subtractor 12 is “1”, the multiplexer
It is a right 1-bit shifter that shifts the output of 13 right 1-bit. Reference numeral 15 is a right 1-bit shifter for performing a 1-bit shift to the right, 16 is a right 2-bit shifter for performing a 2-bit shift to the right, and 17 is a right 4-bit shifter for performing a 4-bit shift to the right. Reference numeral 18 denotes a control unit for controlling the shifters 15, 16 and 17 through the control lines R 1 , R 2 and R 4 , the configuration of which is shown in FIG.

以上のように構成された本実施例の浮動小数点仮数部桁
合わせ回路について、以下その動作を説明する。
The operation of the floating point mantissa digit aligning circuit of the present embodiment having the above configuration will be described below.

先ず、次式に示す浮動小数点データ、N1,N2をそれぞれ
入力レジスタ10,11に格納する。
First, the floating point data, N 1 and N 2 shown in the following equations are stored in the input registers 10 and 11, respectively.

N1=(−1)s1・2e1・f1N1=(−1)s2・2e2・f2 次に、減算器12でe1−e2の減算を行なう。減算結果はビ
ットパターン(d3,d2,d1,d0)用いて、 と表現される。そして仮数部f1あるいはf2を、|e1−e2|
ビットだけ、シフタ14,15,16,17で右にシフトを行ない
仮数部桁合わせを行なう。シフタ14,15,16,17の制御
は、d3の状態により異なる。
N 1 = (− 1) s1 · 2 e1 · f 1 N 1 = (− 1) s2 · 2 e2 · f 2 Next, the subtracter 12 subtracts e1−e2. The subtraction result is a bit pattern (d 3 , d 2 , d 1 , d 0 ), Is expressed as The mantissa f 1 or f 2 is then | e 1 −e 2 |
Only the bits are shifted to the right by the shifters 14, 15, 16 and 17, and the mantissa digits are aligned. The control of the shifters 14, 15, 16, 17 differs depending on the state of d 3 .

d3=0の場合 d3=0は、e1≧e2を示している。そこで、マルチプレク
サ13でレジスタ11にある浮動小数点データの仮数部f2
選択する。また、桁合わせに必要なシフト数はe1−e2
は、 で与えられる。そこで、d0,d1,d2の各ビットで、それぞ
れシフタ15,16,17を動作させればよい。このため、第3
図の制御回路18は、R1=d0,R2=d1,R4=d2を出力する。
When d 3 = 0 d 3 = 0 indicates e1 ≧ e2. Therefore, the multiplexer 13 selects the mantissa part f 2 of the floating point data in the register 11. Also, the number of shifts required for digit alignment is e1−e2
Is Given in. Therefore, the shifters 15, 16 and 17 may be operated with the bits d 0 , d 1 and d 2 , respectively. Therefore, the third
The control circuit 18 in the figure outputs R 1 = d 0 , R 2 = d 1 , and R 4 = d 2 .

d3=1の場合 d3=1は、e1<e2を示している。そこで、マルチプレク
サ13でレジスタ10にある浮動小数点データの仮数部f1
選択する。また、桁合わせに必要なシフト数はe2−e1
は、 となる。そこで、d0,d1,d2の各ビットを反転したもの
で、それぞれシフタ15,16,17を動作させればよい。この
ため、第3図の制御回路18は、 R10,R21,R4 を出力する。また上式の定数項1は、更に右1ビットシ
フトを行なう必要が有ることを示しているので、“1"で
あるd3ビットで右1ビットシフタ14を動作させる。
When d 3 = 1 d 3 = 1 means that e1 <e2. Therefore, the multiplexer 13 selects the mantissa part f 1 of the floating point data in the register 10. The number of shifts required for digit alignment is e2-e1.
Is Becomes Therefore, it is sufficient to operate the shifters 15, 16 and 17, respectively, by inverting each bit of d 0 , d 1 and d 2 . Therefore, the control circuit 18 in FIG. 3 outputs R 1 = 0 , R 2 = 1 and R 4 = 2 . Further, the constant term 1 in the above equation indicates that it is necessary to further shift the right 1 bit, so that the right 1 bit shifter 14 is operated by d 3 bits which is "1".

以上のように、本実施例によれば、指数部の計算を行な
う減算器12と、2の補数で示される減算結果をそのまま
使用して右シフトが実現出来るように構成されたシフタ
14,15,16,17と、これらのシフタを制御する簡単な制御
部とを設けることにより、指数部比較のため減算器12で
減算した結果を絶対値化することなく、シフタ14,15,1
6,17を制御でき、高速に仮数部桁合わせを行なうことが
できる。
As described above, according to the present embodiment, the shifter configured to realize the right shift by using the subtracter 12 for calculating the exponent part and the subtraction result represented by the complement of 2 as it is.
By providing 14,15,16,17 and a simple control unit for controlling these shifters, the shifter 14,15, 1
6 and 17 can be controlled, and mantissa digit alignment can be performed at high speed.

発明の効果 以上説明したように、本発明によれば、指数部の比較は
単純な減算器で実現でき、しかもその減算結果を効率良
く利用してシフタを制御し、浮動小数点データの高速仮
数部桁合わせを実現することができ、その実用的効果は
大きい。
EFFECTS OF THE INVENTION As described above, according to the present invention, comparison of exponent parts can be realized by a simple subtractor, and moreover, the result of the subtraction is efficiently used to control the shifter, so that the high-speed mantissa part of floating-point data can be controlled. Digit alignment can be realized, and its practical effect is great.

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

第1図は本発明における一実施例の浮動小数点仮数部桁
合わせ回路の構成図、第2図は浮動小数点データフォー
マットの一例を示す説明図、第3図はシフタ制御部の回
路図、第4図は従来の浮動小数部桁合わせ回路の構成図
である。 12……減算器、13……マルチプレクサ、14,15,16,17…
…シフタ、18……制御回路。
FIG. 1 is a configuration diagram of a floating point mantissa digit alignment circuit according to an embodiment of the present invention, FIG. 2 is an explanatory diagram showing an example of a floating point data format, FIG. 3 is a circuit diagram of a shifter control unit, and FIG. The figure is a block diagram of a conventional floating point digit matching circuit. 12 ... Subtractor, 13 ... Multiplexer, 14,15,16,17 ...
… Shifter, 18… Control circuit.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】nビットの指数部、及び仮数部から構成さ
れる第1,第2の浮動小数点データで、前記第1の浮動小
数点データの指数部から前記第2の浮動小数点データの
指数部を減算しその差を2の補数体系で求める減算器
と、前記第1,第2の浮動小数点データの仮数部を入力と
し前記減算器出力の最上位ビットが“0"の時には前記第
2の浮動小数点データの仮数部を、“1"の時には前記第
1の浮動小数点データの仮数部を出力するマルチプレク
サと、前記マルチプレクサ出力に接続され前記減算器出
力の最上位ビットが“1"の時右1ビットシフトを行なう
右1ビットシフタと、前記右1ビットシフタに従属接続
され、それぞれ右2kビットシフト{k=0〜(n−
1)}を行なうn段の右2kビットシフタと、前記減算器
出力の最上位ビットが“0"の時には、2kの重みを持つ前
記減算器出力ビットを前記右2kビットシフタの制御入力
とし、前記減算器出力の最上位ビットが“1"の時には2k
の重みを持つ前記減算器出力ビットを反転して前記右2k
ビットシフタの制御入力とする制御部とを備えたことを
特徴とする浮動小数点仮数部桁合わせ回路。
1. First and second floating-point data composed of an n-bit exponent part and a mantissa part, wherein the exponent part of the first floating-point data to the exponent part of the second floating-point data. And a subtractor for obtaining the difference between them by a two's complement system, and the mantissa part of the first and second floating point data as input, and the second bit when the most significant bit of the subtractor output is "0". A multiplexer that outputs the mantissa part of the floating-point data, when it is “1”, and a multiplexer that outputs the mantissa part of the first floating-point data, and right when the most significant bit of the subtractor output is “1”. A right 1-bit shifter for performing a 1-bit shift and a right connection to the right 1-bit shifter are cascade-connected, and right 2 k bit shifts {k = 0 to (n-
1)} and right 2 k bit shifter n stages performing, when the most significant bit is "0" of the subtraction output is the subtractor output bit having the weight of 2 k to a control input of the right 2 k-bit shifter , 2 k when the most significant bit of the subtractor output is "1"
The right 2 k inverts the subtracter output bit having the weight of
A floating point mantissa digit matching circuit, comprising: a control unit which is a control input of a bit shifter.
JP61265999A 1986-11-07 1986-11-07 Floating point mantissa digit matching circuit Expired - Fee Related JPH0799496B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP61265999A JPH0799496B2 (en) 1986-11-07 1986-11-07 Floating point mantissa digit matching circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP61265999A JPH0799496B2 (en) 1986-11-07 1986-11-07 Floating point mantissa digit matching circuit

Publications (2)

Publication Number Publication Date
JPS63118933A JPS63118933A (en) 1988-05-23
JPH0799496B2 true JPH0799496B2 (en) 1995-10-25

Family

ID=17424959

Family Applications (1)

Application Number Title Priority Date Filing Date
JP61265999A Expired - Fee Related JPH0799496B2 (en) 1986-11-07 1986-11-07 Floating point mantissa digit matching circuit

Country Status (1)

Country Link
JP (1) JPH0799496B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FI116473B (en) * 2004-07-16 2005-11-30 Wetend Technologies Oy A method and apparatus for feeding chemicals into a process fluid stream

Also Published As

Publication number Publication date
JPS63118933A (en) 1988-05-23

Similar Documents

Publication Publication Date Title
US4999803A (en) Floating point arithmetic system and method
US10019231B2 (en) Apparatus and method for fixed point to floating point conversion and negative power of two detector
US5111421A (en) System for performing addition and subtraction of signed magnitude floating point binary numbers
JPH04290122A (en) Numerical expression conversion device
JP3436994B2 (en) Shift device
JPH0346024A (en) Floating point computing element
JP2645422B2 (en) Floating point processor
JP2555577B2 (en) Arithmetic unit
JP2605848B2 (en) Non-restoring divider
JPS5960637A (en) Arithmetic device for floating decimal point
US4282582A (en) Floating point processor architecture which performs subtraction with reduced number of guard bits
JPS63118933A (en) Floating point mantissa digit alignment circuit
JP2856791B2 (en) Barrel shifter and floating point unit
JP3100868B2 (en) Arithmetic unit for floating point numbers
SU857992A1 (en) Arithmetic device in residual class system
JP2512939B2 (en) Fixed floating data conversion circuit
JPS60247781A (en) computing device
JPH0285922A (en) Arithmetic circuit
JP2792998B2 (en) Type conversion device using addition / subtraction circuit
JPH03245225A (en) Floating decimal-point addition/subtraction device
JPH04132538U (en) floating point arithmetic circuit
JPH04170636A (en) Normalizing circuit
JPH02267625A (en) Integer part take-out system using floating point arithmetic
JPS60181833A (en) Digit matching circuit for adder of floating decimal point
JPH02239325A (en) Division circuit

Legal Events

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