[go: up one dir, main page]

JPH05167456A - Arithmetic operation circuit - Google Patents

Arithmetic operation circuit

Info

Publication number
JPH05167456A
JPH05167456A JP33541191A JP33541191A JPH05167456A JP H05167456 A JPH05167456 A JP H05167456A JP 33541191 A JP33541191 A JP 33541191A JP 33541191 A JP33541191 A JP 33541191A JP H05167456 A JPH05167456 A JP H05167456A
Authority
JP
Japan
Prior art keywords
bit
output
data
bits
circuit
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
JP33541191A
Other languages
Japanese (ja)
Inventor
Hirofumi Sakagami
弘文 阪上
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.)
Ricoh Co Ltd
Original Assignee
Ricoh 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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP33541191A priority Critical patent/JPH05167456A/en
Publication of JPH05167456A publication Critical patent/JPH05167456A/en
Pending legal-status Critical Current

Links

Landscapes

  • Complex Calculations (AREA)

Abstract

PURPOSE:To obtain a required arithmetic operation accuracy with small scale hardware configuration by providing a specific rounding circuit to implement rounding processing of symmetry in sign. CONSTITUTION:A rounding circuit 11 rounding data in N-bits of 2's complement form into data in (N-L) bits is provided with an N-bit adder (adder means) 12 and a data selector (output means) 13 which outputs L-bits bit pattern data (100...0) when a sign bit in the N-bit data indicates positive or 0 (0 or over) and outputs bit pattern data of L bits (011...1) when the sign bit indicates a negative data. In this case, N, L are both natural numbers and the relation of N>L is set. Then data in L bits (any bit pattern data) from the data selector 13 are adds 0s in (N-L) bits to a high-order at the adder 12 and the result is added to the N-bit data and rounded.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、IEEEフォーマット
を満たす浮動小数点プロセッサ、デジタル信号処理回路
中の画像データ圧縮等のために用いられる演算回路、特
に、2の補数形式の浮動小数点の丸め処理、正規化、乗
算ないしは加減算に適した2の補数形式のデータを扱う
演算回路に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a floating point processor satisfying the IEEE format, an arithmetic circuit used for image data compression in a digital signal processing circuit, and more particularly, a floating point rounding process of 2's complement format, The present invention relates to an arithmetic circuit which handles data in a two's complement format suitable for normalization, multiplication or addition / subtraction.

【0002】[0002]

【従来の技術】従来、この種の演算回路としては、例え
ば、特開平1−227770号公報に示されるようなも
のがある。図7はその構成を示すもので、直交変換演算
回路1と丸めROM2とよりなる直交変換器3とし、入
力されたN1 ビットのデータを直交変換演算回路1によ
りN2 ビットのデータに変換した後、このN2 ビットの
データを丸めROM2によりこれよりもビット数の少な
い(N2 −L)ビットに丸めるようにしたものである。
丸め処理は、0に対して対称な丸めとなるように正負対
称の丸めを行なうようにしている。
2. Description of the Related Art Conventionally, as an arithmetic circuit of this type, there is, for example, one disclosed in JP-A-1-227770. FIG. 7 shows the configuration thereof. The orthogonal transform arithmetic circuit 1 and the rounding ROM 2 are used as an orthogonal transformer 3, and the input N 1 bit data is converted to N 2 bit data by the orthogonal transform arithmetic circuit 1. After that, the N 2 bit data is rounded by the ROM 2 to be rounded to (N 2 −L) bits having a smaller number of bits than this.
In the rounding process, positive and negative symmetric rounding is performed so that the rounding is symmetrical with respect to 0.

【0003】また、特開平3−117918号公報に示
されるような浮動小数点(IEEEフォーマット)の正
規化回路がある。「正規化」とは、仮数部の上位の連続
する無効ビットをビットシフト操作によって消滅させ、
同時に、シフトしたビット数を指数部から引き、仮数部
の有効ビットを上位へ移動させることにより、演算時の
桁落ちを防止する処理をいうものとする。図8はその構
成を示すもので、仮数部と指数部とを入力し、仮数部に
おいて上位の連続する無効ビットの数をプライオリティ
エンコーダ4で計数し、計数されたそのビット数分だ
け、バレルシフタ5で仮数部を上位方向へシフト(左シ
フト)する。同時に、減算器6により指数部から計数さ
れたビット数分だけ減算する。
There is also a floating point (IEEE format) normalization circuit as disclosed in Japanese Patent Laid-Open No. 3-117918. "Normalization" means to eliminate consecutive high-order invalid bits of the mantissa by a bit shift operation,
At the same time, the number of shifted bits is subtracted from the exponent part, and the significant bit in the mantissa part is moved to the higher order to prevent a precision loss during calculation. FIG. 8 shows the configuration, in which the mantissa part and the exponent part are input, the number of consecutive high-order invalid bits in the mantissa part is counted by the priority encoder 4, and the barrel shifter 5 is counted by the counted number of bits. Shifts the mantissa part to the upper direction (shift left). At the same time, the subtractor 6 subtracts the number of bits counted from the exponent.

【0004】このような構成により、仮数部の有効ビッ
トを上位へ移動させ、乗算、加減算時の桁落ちを防止す
るようにしたものである。この時、仮数部の無効ビット
数分をシフトすると、指数部の減算結果がアンダーフロ
ーを起す場合がある。これを防止するために、仮数部の
無効ビット数を計数するプライオリティエンコーダ4に
比較機能を付加し、仮数部の無効ビット数と指数部のビ
ット数とを比較し、小さいほうの値を出力してバレルシ
フタ5によるビットシフト及び減算器6による減算を行
なうようにしている。
With such a configuration, the significant bit of the mantissa part is moved to the higher order to prevent the digit loss during multiplication and addition / subtraction. At this time, if the mantissa part is shifted by the number of invalid bits, the subtraction result of the exponent part may cause underflow. In order to prevent this, a comparison function is added to the priority encoder 4 that counts the number of invalid bits in the mantissa, the number of invalid bits in the mantissa is compared with the number of bits in the exponent, and the smaller value is output. The barrel shifter 5 performs bit shift and the subtractor 6 performs subtraction.

【0005】さらに、浮動小数点の乗算、加減算処理に
関しては、日本テキサスインスツルメンツ株式会社のユ
ーザーズ・マニュアル「TMS320C30」(第2世
代ディジタル・シグナル・プロセッサ)中に示されるも
のがある。まず、図9に浮動小数点の乗算処理を示す。
図中、a(man)は仮数部、a(exp)は指数部を示す。ま
ず、ステップ(1)で24ビットの仮数部の乗算を行な
い、50ビットの結果c(man)を得る。ついで、ステッ
プ(2)で指数部の加算を行ない、c(exp)を得る。これ
らの乗算、加算結果について、特殊ケースのチェックを
行なう。このチェックとしては、まず、ステップ(3)で
は拡張精度フォーマットでc(man)がゼロかどうかをチ
ェックし、ゼロであれば、ステップ(7)でc(exp) を−
128にセットし、ゼロ表現する。また、ゼロでない場
合には、ステップ(4)(5)でシフト処理による正規化を
行なう。即ち、1ビット右シフトする必要がある場合に
は、ステップ(8)でc(man)が1ビット右にシフトさ
れ、c(exp)には1が加算される。また、2ビット右シ
フトする必要がある場合には、ステップ(9)でc(man)
が2ビット右にシフトされ、c(exp) には2が加算され
る。結果が既に正規化されている場合には、ステップ
(6)に示すようにシフトなしとなる。
Further, regarding floating-point multiplication and addition / subtraction processing, there is one shown in a user's manual "TMS320C30" (second generation digital signal processor) of Texas Instruments Japan, Inc. First, FIG. 9 shows a floating point multiplication process.
In the figure, a (man) indicates a mantissa part and a (exp) indicates an exponent part. First, in step (1), a 24-bit mantissa part is multiplied to obtain a 50-bit result c (man). Then, in step (2), the exponent part is added to obtain c (exp). A special case check is performed on the results of these multiplications and additions. As this check, first, in step (3), it is checked whether c (man) is zero in the extended precision format, and if it is zero, c (exp) is changed to − in step (7).
It is set to 128 and is expressed as zero. If it is not zero, normalization by shift processing is performed in steps (4) and (5). That is, when it is necessary to shift right by 1 bit, c (man) is shifted right by 1 bit in step (8), and 1 is added to c (exp). Also, if it is necessary to shift right by 2 bits, in step (9) c (man)
Is shifted right by 2 bits, and 2 is added to c (exp). If the result is already normalized, step
There is no shift as shown in (6).

【0006】そして、ステップ(10)では、余分なビット
の削除により、c(man) が拡張精度浮動小数点フォーマ
ットにセットされる。更に、ステップ(11)〜(18)でc(e
xp)の特殊ケースについてチェックする。このチェック
において、ステップ(11)のようにc(exp)が正の方向に
オーバーフローを起している時には、c(exp)を拡張精
度フォーマットにおける最大の正数にセットし、負の方
向にオーバーフローを起している場合には、c(exp) を
拡張精度フォーマットにおける最小の負の数にセットす
る。一方、ステップ(12)に示すようにc(exp) がアンダ
ーフローを起している場合には、ステップ(15)に示すよ
うにc(exp) をゼロにセットする。即ち、c(man)=
0、かつ、c(exp)=−128となる。
Then, in step (10), c (man) is set to the extended precision floating point format by deleting the extra bits. Furthermore, in steps (11) to (18), c (e
Check for the special case of xp). In this check, when c (exp) overflows in the positive direction as in step (11), set c (exp) to the maximum positive number in the extended precision format and overflow in the negative direction. , C (exp) is set to the smallest negative number in extended precision format. On the other hand, if c (exp) underflows as shown in step (12), c (exp) is set to zero as shown in step (15). That is, c (man) =
0 and c (exp) =-128.

【0007】次に、図10に浮動小数点の加算処理のフ
ローチャートを示す。ここでは、符号付きのデータを仮
定しており、浮動小数点の減算の場合も該当する。ま
ず、ステップ(1)では2つの指数部a(exp),b(exp)の
内の大きいほうにx(exp) がセットされる。ここでは、
説明を簡単にするため、a(exp)≦b(exp)であると仮定
する。ついで、ステップ(2)ではこれらの指数部間の減
算処理により、差がセットされる。ステップ(3)では、
2つの仮数部a(man),b(man)については、その指数部
の小さなほう、ここでは、a(man) に関してこれを右に
dビット分だけシフトし、仮数部を揃える。仮数部を揃
えた後、ステップ(4)に示すように仮数部について加算
処理を行なう。
Next, FIG. 10 shows a flow chart of floating point addition processing. Here, signed data is assumed, and the case of floating-point subtraction is also applicable. First, in step (1), x (exp) is set to the larger one of the two exponents a (exp) and b (exp). here,
For simplicity of explanation, it is assumed that a (exp) ≦ b (exp). Then, in step (2), the difference is set by subtraction processing between these exponents. In step (3),
Regarding the two mantissas a (man) and b (man), the exponent is smaller, that is, a (man) is shifted rightward by d bits to align the mantissas. After the mantissas are aligned, addition processing is performed on the mantissas as shown in step (4).

【0008】この加算結果に基づき、ステップ(5)〜
(7)ではc(man) の特殊ケースのテストを行なう。この
テストには3つあり、まず、ステップ(5)ではc(man)
がゼロであり、ステップ(8)でc(exp) を最小の負の数
にセットし、ゼロ表現とする。一方、c(man)がオーバ
ーフローを起していれば、ステップ(9)でc(man)を1
ビット右にシフトし、c(exp) に1を加算する。ステッ
プ(10)では結果が正規化される。その後、ステップ(11)
(12)でc(exp) の特殊ケースのテストが行なわれる。こ
こに、c(exp)が正のオーバーフローを起している場合
にはc(exp)を拡張精度フォーマットにおける最大の正
数にセットし、それ以外の場合には、c(exp)を拡張精
度フォーマットにおける最小の負の値にセットする。
Based on this addition result, steps (5)-
In (7), a special case of c (man) is tested. There are three in this test. First, in step (5) c (man)
Is zero, and in step (8), c (exp) is set to the minimum negative number, and is represented as zero. On the other hand, if c (man) has overflowed, c (man) is set to 1 in step (9).
Shift right by bits and add 1 to c (exp). In step (10) the result is normalized. Then step (11)
In (12), the special case of c (exp) is tested. If c (exp) causes a positive overflow, set c (exp) to the maximum positive number in the extended precision format, otherwise, set c (exp) to the extended precision. Set to the smallest negative value in the format.

【0009】[0009]

【発明が解決しようとする課題】ところが、まず、特開
平2−227770号公報に示された丸め回路による場
合、0に対して対称な丸めとなるよう正負対称の丸めを
行なうために、ROM2を使用しており、ハードウエア
規模が大きくなってしまう。
However, first, in the case of the rounding circuit disclosed in Japanese Patent Laid-Open No. 2-227770, the ROM 2 is rounded in order to perform positive and negative symmetric rounding so that the rounding is symmetrical with respect to 0. I am using it, and the hardware scale becomes large.

【0010】また、特開平3−117918号公報に示
された浮動小数点正規化回路による場合、仮数部のビッ
トシフト処理における指数部のアンダーフローの発生は
防止されるものの、指数部がアンダーフローを起してい
る場合の処理については言及されていない。よって、例
えば乗算や加減算の結果、指数部がアンダーフローした
場合には、同公報方式の正規化回路を使用しても、アン
ダーフローのまま出力されてしまい、演算精度に問題を
生ずる。
In the floating point normalization circuit disclosed in Japanese Patent Laid-Open No. 3-117918, underflow of the exponent part is prevented even though the underflow of the exponent part is prevented in the bit shift processing of the mantissa part. No mention is made of what happens when it occurs. Therefore, for example, when the exponent part underflows as a result of multiplication or addition / subtraction, even if the normalization circuit of the publication is used, the underflow is output as it is, causing a problem in calculation accuracy.

【0011】さらに、図9に示した浮動小数点の乗算処
理の場合、入力される2つの浮動小数点データが正規化
されていることを前提としているので、乗算結果を正規
化するために「0」「1」「2」ビットのシフトで正規
化を行ない得るが、正規化されていない数値を入力する
と、乗算結果を正しく正規化できないものとなる。ま
た、指数部のアンダーフローの発生のみから乗算結果を
「0」としているため、演算精度が低下してしまう。
Further, in the case of the floating point multiplication process shown in FIG. 9, it is premised that the two input floating point data are normalized, so that the multiplication result is normalized to "0". Normalization can be performed by shifting "1" and "2" bits, but if an unnormalized numerical value is input, the multiplication result cannot be properly normalized. In addition, since the multiplication result is set to "0" only due to the occurrence of underflow in the exponent part, the calculation accuracy decreases.

【0012】図10に示した浮動小数点の加算処理の場
合、入力された2つの指数部を比較し、その差分を算出
し、両者の指数部が同一の値となるように、指数部の小
さいほうに対応する仮数部を下位方向へビットシフトさ
せ、この際、所定のビット数を超える下位ビットは切捨
てられ、その後、仮数部の加算を行なうものであり、こ
の加算処理において、両者の指数部を揃える時にシフト
された余分な下位ビットを切捨てるため、演算誤差が大
きくなってしまう。
In the case of the floating point addition process shown in FIG. 10, two input exponent parts are compared, the difference between them is calculated, and the exponent parts are small so that both exponent parts have the same value. The mantissa corresponding to one of them is bit-shifted in the lower direction. At this time, lower bits exceeding a predetermined number of bits are truncated, and then the mantissa is added. Since the extra low-order bits that have been shifted are truncated when aligning, the calculation error increases.

【0013】[0013]

【課題を解決するための手段】請求項1記載の発明で
は、2の補数形式のNビット(ただし、Nは自然数)の
2進データの符号ビットに応じてLビット(ただし、L
はL<Nなる関係に設定された自然数)の「100…
0」と「011…1」とのビットパターンデータを切換
え出力する出力手段と、前記Nビットの2進データの下
位Lビット分にこの出力手段から出力されるLビットの
ビットパターンデータを加算する加算手段とよりなる丸
め回路を設け、入力されたNビットの2進データを(N
−L)ビットのデータに丸めるようにした。
According to a first aspect of the present invention, L bits (however, L is required) corresponding to a sign bit of N-bit (where N is a natural number) binary data of 2's complement format.
Is a natural number set to the relationship of L <N) of "100 ...
Output means for switching and outputting bit pattern data of "0" and "011 ... 1", and L-bit bit pattern data output from this output means is added to the lower L bits of the N-bit binary data. A rounding circuit including an adding means is provided to convert the input N-bit binary data into (N
-L) The data is rounded.

【0014】請求項2記載の発明では、Mビットの仮数
部及びJビットの指数部(ただし、M,Jは自然数)の
入力に対してKビット(ただし、KはK<Jなる関係に
設定された自然数)の指数部で表現可能な最小値Emin
を前記Jビットの指数部から減算する第1減算手段と、
入力された仮数部の上位側から見て符号ビットと異なる
ビットが最初に出現するまでのビット数を計数する計数
手段と、前記第1減算手段の出力とこの計数手段の出力
とを比較して小さいほうを出力する比較出力手段と、入
力された仮数部のデータをこの比較出力手段の出力値の
ビット数分だけ上位方向にシフトさせる第1シフト手段
と、前記第1減算手段の出力値中の負のものを正の値に
変換する変換手段と、入力された仮数部のデータをこの
変換手段の出力値のビット数分だけ下位方向にシフトさ
せる第2シフト手段と、入力されたJビットの指数部か
ら前記比較出力手段の出力値分を減算する第2減算手段
と、前記第1減算手段の出力が、0以上である時には前
記第1シフト手段の出力値及び前記第2減算手段の出力
値を出力し負である時には前記第2シフト手段の出力値
及び前記最小値Emin を出力する切換え手段とよりなる
2の補数形式の浮動小数点正規化回路を設け、Mビット
の仮数部及びJビットの指数部を入力してMビットの仮
数部及びKビットの指数部を出力するようにした。
According to the second aspect of the present invention, the input of the M-bit mantissa part and the J-bit exponent part (where M and J are natural numbers) is set to K bits (where K is K <J). Minimum value Emin that can be represented by the exponent part of the generated natural number)
First subtracting means for subtracting from the J-bit exponent part,
Counting means for counting the number of bits until the first appearance of a bit different from the sign bit as viewed from the upper side of the input mantissa is compared with the output of the first subtracting means and the output of this counting means. The comparison output means for outputting the smaller one, the first shift means for shifting the input data of the mantissa part in the upper direction by the number of bits of the output value of the comparison output means, and the output value of the first subtraction means Means for converting a negative one of the above into a positive value, second shift means for shifting the input mantissa data in the lower direction by the number of bits of the output value of the converting means, and the input J bit Second subtraction means for subtracting the output value of the comparison output means from the exponent part of, and the output value of the first shift means and the second subtraction means when the output of the first subtraction means is 0 or more. Outputs the output value and is negative Sometimes, a two's complement type floating point normalization circuit comprising a switching means for outputting the output value of the second shift means and the minimum value Emin is provided, and an M-bit mantissa part and a J-bit exponent part are inputted. The M-bit mantissa part and the K-bit exponent part are output.

【0015】また、請求項3記載の発明では、2の補数
形式のNビット(ただし、Nは自然数)の2進データの
符号ビットに応じてLビット(ただし、LはL<Nなる
関係に設定された自然数)の「100…0」と「011
…1」とのビットパターンデータを切換え出力する出力
手段と前記Nビットの2進データの下位Lビット分にこ
の出力手段から出力されるLビットのビットパターンデ
ータを加算する第1加算手段とよりなり入力されたNビ
ットの仮数部の2進データを(N−L)ビットのデータ
に丸める丸め回路と、前記第1加算手段における桁上が
りの有無を検出する検出手段と、桁上がり有の時には指
数部に「1」を加算する第2加算手段と、桁上がり有の
時には前記第1加算手段の出力を下位方向に1ビットだ
けシフトさせるシフト手段と、桁上がり有の時にはこの
シフト手段のシフト結果を出力し桁上がり無の時には前
記第1加算手段の加算結果を出力する切換え手段とより
なる2の補数形式の浮動小数点丸め回路を設けた。
According to the third aspect of the present invention, L bits (where L is L <N are satisfied according to the sign bit of binary data of N bits (where N is a natural number) of 2's complement format. Set natural numbers) "100 ... 0" and "011
The output means for switching and outputting the bit pattern data of "1" and the first adding means for adding the lower L bits of the N-bit binary data with the L-bit bit pattern data output from the output means. A rounding circuit for rounding the binary data of the N-bit mantissa part that has been input to (NL) bits, a detecting means for detecting the presence or absence of a carry in the first adding means, and a carry case. Second addition means for adding "1" to the exponent part, shift means for shifting the output of the first addition means by 1 bit in the lower direction when a carry is present, and shift for this shift means when a carry is present. A 2's complement floating-point rounding circuit is provided, which includes a switching means for outputting the result and outputting the addition result of the first adding means when there is no carry.

【0016】請求項4記載の発明では、請求項2又は3
記載の演算回路について、2つの仮数部の積を算出する
乗算手段と、2つの指数部の和を算出する加算手段とを
設けて、2の補数形式の浮動小数点乗算回路とした。
According to the invention of claim 4, claim 2 or 3
The arithmetic circuit described above is provided with a multiplication means for calculating the product of two mantissa parts and an addition means for calculating the sum of two exponent parts, thereby forming a two's complement floating-point multiplication circuit.

【0017】さらに、請求項5記載の発明では、入力さ
れた2つの指数部の差分を算出する減算手段と、減算さ
れた差分出力の符号ビットに応じて前記2つの指数部中
の大きいほうの指数部を出力する指数出力切換え手段
と、前記差分出力の絶対値を算出する絶対値算出手段
と、入力された2つの仮数部の何れかのデータをこの絶
対値算出手段からの出力値のビット数分だけ下位方向に
シフトさせるシフト手段と、このシフト手段から出力さ
れる2の補数形式のNビット(ただし、Nは自然数)の
2進データの符号ビットに応じてLビット(ただし、L
はL<Nなる関係に設定された自然数)の「100…
0」と「011…1」とのビットパターンデータを切換
え出力する出力手段と前記Nビットの2進データの下位
Lビット分にこの出力手段から出力されるLビットのビ
ットパターンデータを加算する加算手段とよりなり入力
されたNビットの2進データを(N−L)ビットのデー
タに丸める丸め回路と、この丸め回路の出力と入力され
た2つの仮数部データとの加減算を行なう加減算手段と
を設けて、2の補数形式の浮動小数点加減算回路とし
た。
Further, in the invention according to claim 5, the subtracting means for calculating the difference between the two input exponent parts and the larger one of the two exponent parts depending on the sign bit of the subtracted difference output. An exponent output switching means for outputting an exponent part, an absolute value calculating means for calculating an absolute value of the difference output, and any one of the two input mantissa parts of the data is output as a bit of an output value from the absolute value calculating means. A shift means for shifting in the lower direction by a few minutes, and L bits (however, L) depending on the sign bit of the binary data of 2's complement format (where N is a natural number) output from this shift means.
Is a natural number set to the relationship of L <N) of "100 ...
Output means for switching and outputting bit pattern data of "0" and "011 ... 1" and addition for adding the L bit bit pattern data output from the output means to the lower L bits of the N bit binary data. A rounding circuit for rounding the input N-bit binary data into (NL) -bit data, and an addition / subtraction unit for performing addition / subtraction between the output of the rounding circuit and the input two mantissa data. Is provided to provide a two's complement floating-point adder / subtractor circuit.

【0018】[0018]

【作用】請求項1記載の発明によれば、所定の2種類の
ビットパターンデータの出力手段と加算手段とにより正
負対称の丸め処理を行なうので、小規模なハードウエア
構成にして丸めのずれの小さなものとし、必要な演算精
度が得られるものとなる。
According to the first aspect of the present invention, since the positive and negative symmetric rounding processing is performed by the predetermined two kinds of bit pattern data output means and addition means, a small-scale hardware configuration is used to eliminate the rounding deviation. It will be small, and the required calculation accuracy will be obtained.

【0019】また、請求項2記載の発明による場合、浮
動小数点の正規化処理において、アンダーフローの判断
を行なう時に、指数部だけでなく、仮数部の有効ビット
の残存数も考慮しているので、不必要にアンダーフロー
処理を行なってしまうことがなく、演算精度の向上を図
れる。
Further, according to the second aspect of the present invention, in the floating point normalization processing, when the underflow is determined, not only the exponent part but also the remaining number of significant bits in the mantissa part are taken into consideration. Therefore, the underflow process is not unnecessarily performed, and the calculation accuracy can be improved.

【0020】また、請求項3記載の発明によれば、浮動
小数点データの仮数部の丸め処理を請求項1記載の発明
による丸め回路を用いて正負対称に行なっているので、
演算精度が向上するものとなる。
According to the third aspect of the invention, since the rounding process of the mantissa part of the floating point data is performed in positive and negative symmetry using the rounding circuit according to the first aspect of the invention,
The calculation accuracy is improved.

【0021】さらに、請求項4記載の発明によれば、浮
動小数点の乗算結果を、アンダーフローの発生を極力防
止し得る請求項2記載の発明による正規化処理と、仮数
部の丸め処理を正負対称に行なう請求項3記載の発明に
よる浮動小数点丸め処理とを用いているので、演算精度
の高いものとなり、かつ、このような正規化回路を内蔵
するため、正規化されていない入力に対しても乗算結果
を正しく正規化できるものとなる。
Further, according to the invention described in claim 4, the normalization process according to the invention according to claim 2 and the rounding process of the mantissa part of the floating point multiplication result can be prevented as positively or negatively as possible. Since the floating-point rounding processing according to the third aspect of the present invention, which is performed symmetrically, is used, the calculation precision is high, and since such a normalization circuit is incorporated, it is possible to input an unnormalized input. Also can correctly normalize the multiplication result.

【0022】また、請求項5記載の発明によれば、浮動
小数点の加減算処理において、指数部を揃える時の仮数
部のビットシフト処理後に、所定のビット数を超える下
位の余分なビットに対して請求項1記載の発明による丸
め回路で正負対称の丸め処理を行なうので、演算誤差が
小さくなり、演算精度が向上するものとなる。
According to the fifth aspect of the invention, in the floating point addition / subtraction process, after the bit shift process of the mantissa part when aligning the exponent parts, the lower extra bits exceeding the predetermined number of bits are processed. Since the rounding circuit according to the first aspect of the present invention performs the positive / negative symmetrical rounding process, the calculation error is reduced and the calculation accuracy is improved.

【0023】[0023]

【実施例】請求項1記載の発明の第一の実施例を図1に
基づいて説明する。本実施例は、2の補数形式のNビッ
トのデータを、(N−L)ビットのデータに丸める丸め
回路11に関するものであり、Nビットの加算器(加算
手段)12と、Nビットデータ中の符号ビットが正又は
0の時(0以上の時)にはLビットの「100…0」の
ビットパターンデータを出力し、符号ビットが負の時に
はLビットの「011…1」のビットパターンデータを
出力するデータセレクタ(出力手段)13とにより構成
されている。ここに、N,Lはともに自然数であり、か
つ、N>Lなる関係に設定されている。前記データセレ
クタ13から出力されたLビットのデータ(何れかのビ
ットパターンデータ)は、加算器12においてその上位
に(N−L)ビットの0を付加してNビットのデータと
加算され、丸められる。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS A first embodiment of the invention described in claim 1 will be described with reference to FIG. The present embodiment relates to a rounding circuit 11 that rounds N-bit data in 2's complement format into (NL) -bit data, and includes an N-bit adder (adding means) 12 and N-bit data. If the sign bit of is positive or 0 (0 or more), L-bit "100 ... 0" bit pattern data is output, and if the sign bit is negative, L-bit "011 ... 1" bit pattern data is output. And a data selector (output means) 13 for outputting data. Here, N and L are both natural numbers, and N> L is set. The L-bit data (any bit pattern data) output from the data selector 13 is added to the N-bit data by adding (N−L) -bit 0 to the higher order in the adder 12 and rounded. Be done.

【0024】このような構成において、例えば、N=
6、L=3として、小数点以下3ビットなる6ビットの
データを整数に丸める場合を例にとると、本実施例の丸
め回路11によれば、表1に示すような丸め結果が得ら
れるものとなる。
In such a configuration, for example, N =
Taking L = 3 and rounding 6-bit data consisting of 3 bits after the decimal point into an integer, the rounding circuit 11 of the present embodiment can obtain rounding results as shown in Table 1. Becomes

【0025】[0025]

【表1】 [Table 1]

【0026】この表からも判るように、本実施例によれ
ば、丸めるべき下位Lビット(=3ビット)に、正又は
0の時は「100」なるビットパターンデータを加算
し、負の時には「011」なるビットパターンデータを
加算して、切捨てることにより、「0」を中心として正
負対称に丸め処理が実現されるものとなる。この結果、
信号処理における最終段での丸めのずれが小さくなり、
演算精度が向上するものとなる。このような丸め処理の
ためにROMを要しないため、回路規模も小さくて済
む。
As can be seen from this table, according to this embodiment, the bit pattern data of "100" is added to the lower L bits (= 3 bits) to be rounded when it is positive or 0, and when it is negative. By adding the bit pattern data "011" and truncating the data, the rounding process is realized with positive and negative symmetry centered on "0". As a result,
Rounding deviation at the final stage in signal processing becomes small,
The calculation accuracy is improved. Since the ROM is not required for such rounding processing, the circuit scale can be small.

【0027】つづいて、請求項1記載の発明の第二の実
施例を図2により説明する。前記実施例で示した部分と
同一部分は同一符号を用いて示す。本実施例は、Lビッ
トのビットパターンデータとして、「100…0」のみ
用意しておき、Nビットデータ中の符号ビットに応じて
「100…0」なるビットパターンデータ又は「011
…1」なるビットパターンデータを生成出力する出力手
段としてL個の排他的ORゲートによるゲート回路14
を、データセレクタ13に代えて設けたものである。
Next, a second embodiment of the invention according to claim 1 will be described with reference to FIG. The same parts as those shown in the above-mentioned embodiment are designated by the same reference numerals. In the present embodiment, only "100 ... 0" is prepared as the L-bit bit pattern data, and "100 ... 0" or "011" depending on the sign bit in the N-bit data.
The gate circuit 14 includes L exclusive OR gates as an output means for generating and outputting bit pattern data "1".
In place of the data selector 13.

【0028】本実施例構成によっても、前記実施例と同
様な丸め処理が行なわれる。なお、用意しておくLビッ
トのビットパターンデータを「011…1」とし、符号
ビット側を反転させるように構成してもよい。
With the configuration of this embodiment, rounding processing similar to that of the above embodiment is performed. The L-bit bit pattern data to be prepared may be "011 ... 1" and the sign bit side may be inverted.

【0029】次に、請求項2記載の発明の一実施例を図
3により説明する。本実施例は、Mビットの仮数部及び
Jビットの指数部を入力して正規化を行ないMビットの
仮数部及びKビットの指数部を出力する2の補数形式の
浮動小数点の正規化回路15に関するものである。ここ
に、M,L,Kは何れも自然数であり、かつ、K<Jな
る関係に設定されている。
Next, an embodiment of the invention described in claim 2 will be described with reference to FIG. In this embodiment, a two's complement floating-point normalization circuit 15 which inputs an M-bit mantissa part and a J-bit exponent part for normalization and outputs an M-bit mantissa part and a K-bit exponent part 15 It is about. Here, M, L, and K are all natural numbers, and K <J is set.

【0030】まず、入力されたJビットの指数部と所定
のビット数で表現し得る指数部の最小値Emin との差分
を演算する減算器(第1減算手段)16が設けられてい
る。また、入力されたMビットの仮数部の上位側から見
て符号ビットと異なるビットが最初に見つかるまでのビ
ット数を計数して出力するプライオリティエンコーダ
(計数手段)17が設けられている。前記減算器16と
このプライオリティエンコーダ17とには、両者の出力
を比較するコンパレータ18が接続され、このコンパレ
ータ18出力に応じて減算器16とプライオリティエン
コーダ17との出力の内で小さいほうを選択出力するセ
レクタ19が設けらている。これらのコンパレータ18
及びセレクタ19により比較出力手段20が構成されて
いる。また、入力された仮数部のデータを前記セレクタ
19の出力値のビット数分だけ上位方向にシフトさせる
バレルシフタ(第1シフト手段)21が設けられてい
る。さらに、入力されたJビットの指数部からセレクタ
19の出力値分を減算する減算器(第2減算手段)22
が設けられている。
First, a subtractor (first subtraction means) 16 for calculating the difference between the input J-bit exponent part and the minimum value Emin of the exponent part that can be expressed by a predetermined number of bits is provided. Further, a priority encoder (counting means) 17 is provided which counts and outputs the number of bits until a bit different from the sign bit is first found when viewed from the upper side of the mantissa part of the input M bits. The subtractor 16 and the priority encoder 17 are connected to a comparator 18 for comparing the outputs of the both, and the smaller one of the outputs of the subtractor 16 and the priority encoder 17 is selected according to the output of the comparator 18. A selector 19 for switching is provided. These comparators 18
The comparison output unit 20 is configured by the selector 19 and the selector 19. Further, there is provided a barrel shifter (first shift means) 21 for shifting the input mantissa data in the upper direction by the number of bits of the output value of the selector 19. Further, a subtractor (second subtraction means) 22 for subtracting the output value of the selector 19 from the input J-bit exponent part 22.
Is provided.

【0031】一方、前記減算器16からセレクタ19を
介して出力される出力値が負である場合に、これを正の
値に変換する符号変換回路(変換手段)23が設けられ
ている。この符号変換回路23に接続されて、入力され
る仮数部データをこの符号変換回路23の出力値のビッ
ト数分だけ下位方向にシフトさせるバレルシフタ(第2
シフト手段)24が設けられている。さらに、前記プラ
イオリテイエンコーダ17の出力値と符号変換回路23
の出力値とを入力として、アンダーフローの発生の有無
を検出するアンダーフロー検出回路25が設けられてい
る。
On the other hand, when the output value output from the subtractor 16 via the selector 19 is negative, there is provided a code conversion circuit (converting means) 23 for converting this into a positive value. A barrel shifter connected to the code conversion circuit 23 and shifting the input mantissa data in the lower direction by the number of bits of the output value of the code conversion circuit 23 (second
Shift means) 24 is provided. Further, the output value of the priority encoder 17 and the code conversion circuit 23
An underflow detection circuit 25 for detecting whether or not an underflow has occurred is provided by using the output value of and as a input.

【0032】さらに、前記バレルシフタ24、21の出
力、最小値Emin 、減算器22の出力は、切換え回路
(切換え手段)26を介しオーバーフロー・アンダーフ
ロー処理回路27に選択的に入力されている。前記アン
ダーフロー検出回路25の出力は、直接、このオーバー
フロー・アンダーフロー処理回路27に入力されてい
る。ここで、前記切換え回路26は2系統に対して設け
られた2つの切換えスイッチSW1,SW2よりなり、符
号ビットが正又は0なる0以上の時には、0端子側が選
択され、符号ビットが負の時には1端子側が選択される
ように設定されている。切換えスイッチSW1 の0端子
側はバレルシフタ21側に接続され、1端子側はバレル
シフタ24側に接続されている。また、切換えスイッチ
SW2 の0端子側は減算器22側に接続され、1端子側
は最小値Emin に接続されている。よって、減算器16
の出力=符号ビットが0以上である時にはバレルシフタ
21の出力値及び減算器22の出力値が出力され、符号
ビットが負である時にはバレルシフタ24の出力値及び
最小値Emin が出力される。
Further, the outputs of the barrel shifters 24 and 21, the minimum value Emin, and the output of the subtractor 22 are selectively input to an overflow / underflow processing circuit 27 via a switching circuit (switching means) 26. The output of the underflow detection circuit 25 is directly input to the overflow / underflow processing circuit 27. Here, the changeover circuit 26 includes two changeover switches SW 1 and SW 2 provided for two systems, and when the sign bit is positive or 0 and 0 or more, the 0 terminal side is selected and the sign bit is negative. In the case of, the one terminal side is set to be selected. The 0 terminal side of the changeover switch SW 1 is connected to the barrel shifter 21 side, and the 1 terminal side is connected to the barrel shifter 24 side. The 0 terminal side of the changeover switch SW 2 is connected to the subtractor 22 side, and the 1 terminal side is connected to the minimum value Emin. Therefore, the subtractor 16
When the sign bit is 0 or more, the output value of the barrel shifter 21 and the output value of the subtractor 22 are output, and when the sign bit is negative, the output value of the barrel shifter 24 and the minimum value Emin are output.

【0033】また、オーバーフロー・アンダーフロー処
理回路27は指数部が所定のビット数で表現できる最大
値を超える時は指数部及び仮数部に所定のデータを設定
して出力するものである。一方、アンダーフロー検出回
路25によりアンダーフローが検出された場合には、0
を示す値を指数部及び仮数部に設定して出力する。
The overflow / underflow processing circuit 27 sets and outputs predetermined data in the exponent part and the mantissa part when the exponent part exceeds the maximum value that can be expressed by a predetermined number of bits. On the other hand, when the underflow is detected by the underflow detection circuit 25, 0
Is set in the exponent part and the mantissa part and output.

【0034】このような正規化回路15は、Mビットの
仮数部及びJビットの指数部を入力して正規化を行な
い、Mビットの仮数部及びKビット(K<J)の指数部
を出力するものであり、乗算や除算結果等の正規化に好
適なものとなる。
The normalizing circuit 15 receives the M-bit mantissa part and the J-bit exponent part for normalization, and outputs the M-bit mantissa part and the K-bit (K <J) exponent part. This is suitable for normalizing multiplication and division results.

【0035】まず、入力されたMビットの仮数部の上位
の連続する無効ビット数をプライオリティエンコーダ1
7で計数する。即ち、仮数部が正の場合であれば、小数
点以下の上位から見て最初に1が現れるまでの連続する
0のビット数を計数し、仮数部が負の場合であれば最初
に0が現れるまでの連続する1のビット数を計数する。
同時に、入力されたJビットの指数部から所定のビット
数Kで表現できる最小値Emin を減算器16で減算す
る。これにより、正規化のために仮数部をシフトする時
の最大シフト量が求まる。即ち、仮数部をこの値を超え
てビットシフトすると、指数部でシフトビット数を減算
する時にアンダーフローを起してしまい、有効な数値を
不必要に0に置換えることになり、演算精度を劣化させ
てしまうので、これを避けるためである。
First, the priority encoder 1 determines the number of consecutive consecutive invalid bits of the input M-bit mantissa part.
Count at 7. That is, if the mantissa is positive, the number of consecutive bits of 0 until the first 1 appears from the upper part below the decimal point is counted, and if the mantissa is negative, 0 first appears. The number of consecutive 1 bits up to is counted.
At the same time, the subtracter 16 subtracts the minimum value Emin that can be represented by a predetermined number of bits K from the input J-bit exponent. As a result, the maximum shift amount when shifting the mantissa part for normalization is obtained. That is, if the mantissa part is bit-shifted beyond this value, an underflow will occur when the shift bit number is subtracted by the exponent part, and a valid value will be replaced with 0 unnecessarily, and the calculation accuracy will be reduced. This is to avoid this because it will deteriorate.

【0036】次に、コンパレータ18により減算器16
の出力値とプライオリティエンコーダ17の出力値とを
比較し、小さいほうの値を選択するようにセレクタ19
を制御する。そして、このセレクタ19の出力値のビッ
ト数分だけバレルシフタ21により仮数部を上位方向へ
ビットシフトする。さらに、減算器22により指数部か
ら、シフトしたビット数分を減算する。
Next, the subtractor 16 is operated by the comparator 18.
Is compared with the output value of the priority encoder 17, and the selector 19 selects the smaller value.
To control. Then, the mantissa part is bit-shifted in the upper direction by the barrel shifter 21 by the number of bits of the output value of the selector 19. Further, the subtractor 22 subtracts the shifted number of bits from the exponent part.

【0037】しかして、本実施例では、前述したよう
に、指数部について、入力ビット数Jが出力ビット数K
よりも大きいため、減算器16の出力=符号ビットが負
になる場合がある。このような場合、従来であればアン
ダーフローとして処理され、0が出力されていたが、本
実施例の正規化回路15では、以下の処理を行なうこと
により、アンダーフローの発生を極力防止し、演算精度
を向上させるようにしている。
In the present embodiment, as described above, the input bit number J is the output bit number K in the exponent part.
Therefore, the output of the subtracter 16 = sign bit may be negative. In such a case, conventionally, underflow was processed and 0 was output, but the normalization circuit 15 of the present embodiment performs the following processing to prevent occurrence of underflow as much as possible. The calculation accuracy is improved.

【0038】まず、減算器16の出力が負となった場
合、符号変換回路23により正の値に変換され、バレル
シフタ24により正の値に変換された値分のビット分だ
け仮数部を下位方向にビットシフトする。この結果、仮
数部の下位の有効ビットが下位方向へのビットシフトに
よりいくらか失われるが、全ビットが失われない限り、
アンダーフローとはならない。即ち、プライオリティエ
ンコーダ17の出力値をx、符号変換回路23の出力値
をyとすると、仮数部の小数点以下Mビット(ここで
は、説明を簡単化するため、符号ビットは省略する)の
内、下位の有効ビットは、(M−x)ビットとなる。従
って、(M−x)>yの場合には、仮数部に有効ビット
が残存するためアンダーフローにはならない。この時、
指数部は最小値Emin として出力する。また、(M−
x)≦yの場合には仮数部の有効ビットは全て消失する
ため、アンダーフローとなる。上記の(M−x)>y
か、(M−x)≦yかの判別は、アンダーフロー検出回
路25により行なわれる。
First, when the output of the subtractor 16 becomes negative, the sign conversion circuit 23 converts the value into a positive value and the barrel shifter 24 converts the value into a positive value. Bit shift to. As a result, the lower significant bits of the mantissa are lost to some extent by the bit shift in the lower direction, but unless all bits are lost,
Underflow does not occur. That is, assuming that the output value of the priority encoder 17 is x and the output value of the sign conversion circuit 23 is y, of the M bits below the decimal point of the mantissa part (the sign bit is omitted here for simplification of description), The lower significant bits are (Mx) bits. Therefore, in the case of (Mx)> y, an effective bit remains in the mantissa part, and therefore underflow does not occur. At this time,
The exponent part is output as the minimum value Emin. Also, (M-
When x) ≦ y, all effective bits in the mantissa part disappear, resulting in underflow. (M-x)> y above
The underflow detection circuit 25 determines whether or not (M−x) ≦ y.

【0039】そして、スイッチSW1,SW2により、減
算器16の出力が正又は0の時には、仮数部としてはバ
レルシフタ21の出力値、指数部としては減算器22の
出力値がオーバーフロー・アンダーフロー処理回路27
に出力され、減算器16の出力が負の時には仮数部とし
てはバレルシフタ24の出力値、指数部としては最小値
Emin が出力される。その後、このオーバーフロー・ア
ンダーフロー処理回路27によって、オーバーフローの
場合には正の最大値又は負の最小値が、アンダーフロー
の場合には0が、仮数部及び指数部として出力される。
When the output of the subtracter 16 is positive or zero, the output value of the barrel shifter 21 as the mantissa part and the output value of the subtracter 22 as the exponent part overflow or underflow by the switches SW 1 and SW 2. Processing circuit 27
When the output of the subtractor 16 is negative, the output value of the barrel shifter 24 is output as the mantissa and the minimum value Emin is output as the exponent. Thereafter, the overflow / underflow processing circuit 27 outputs a positive maximum value or a negative minimum value in the case of overflow, and 0 in the case of underflow as the mantissa part and the exponent part.

【0040】また、請求項3記載の発明の一実施例を図
4により説明する。本実施例は、2の補数形式の浮動小
数点丸め回路31に関するものであり、Nビットデータ
による仮数部の丸め処理に前述した請求項1記載の発明
による丸め回路11を利用したものである。この他、丸
め回路11の処理に伴い指数部の処理を行なう回路を付
加したものである。まず、丸め回路11中の加算器(第
1加算手段)12における桁上がりの有無を検出するオ
ーバーフロー検出器(検出手段)32が設けられてい
る。また、指数部入力を受けて、このオーバーフロー検
出器32により桁上がり有が検出された時に、指数部に
「1」を加算する加算器(第2加算手段)33が設けら
れている。さらに、このような桁上がりが検出された時
に前記丸め回路11出力(加算器12の出力)を下位方
向に1ビットだけシフトさせる1ビットシフタ(シフト
手段)34が設けられている。この1ビットシフタ34
の出力側に1端子側が接続され、0端子側が1ビットシ
フタ34を経ずに丸め回路11出力側に接続されたスイ
ッチ(切換え手段)SW3 が設けられている。このスイ
ッチSW3 は前記オーバーフロー検出器32の出力に応
じて切換えられるものであり、オーバーフロー発生時に
は1端子側が選択され、オーバーフロー無の場合には0
端子側が選択されるように設定されている。
An embodiment of the invention described in claim 3 will be described with reference to FIG. This embodiment relates to a floating point rounding circuit 31 of 2's complement format, and uses the rounding circuit 11 according to the above-mentioned invention for rounding the mantissa part with N-bit data. In addition, a circuit for processing the exponent part is added to the processing of the rounding circuit 11. First, an overflow detector (detection means) 32 for detecting the presence or absence of a carry in the adder (first addition means) 12 in the rounding circuit 11 is provided. Further, an adder (second adding means) 33 is provided for adding "1" to the exponent when the overflow detector 32 detects the presence of a carry in response to the input of the exponent. Further, there is provided a 1-bit shifter (shift means) 34 for shifting the output of the rounding circuit 11 (output of the adder 12) by 1 bit in the lower direction when such a carry is detected. This 1-bit shifter 34
There is provided a switch (switching means) SW 3 in which the 1-terminal side is connected to the output side of and the 0-terminal side is connected to the output side of the rounding circuit 11 without passing through the 1-bit shifter 34. This switch SW 3 is switched according to the output of the overflow detector 32. When the overflow occurs, the 1 terminal side is selected, and when there is no overflow, it is 0.
The terminal side is set to be selected.

【0041】よって、丸め回路11による仮数部の丸め
処理の結果、仮数部でオーバーフローが発生したことが
オーバーフロー検出器32により検出されると、加算器
33により入力指数部に1を加算して出力するととも
に、1ビットシフタ34によって下位方向に1ビットシ
フトされた仮数部データを出力する。オーバーフローが
なければ、前述した通り、丸め回路11の加算器12の
出力がそのまま仮数部データとして出力される。
Therefore, as a result of the rounding processing of the mantissa part by the rounding circuit 11, when the overflow detector 32 detects that an overflow has occurred in the mantissa part, the adder 33 adds 1 to the input exponent part and outputs it. At the same time, the 1-bit shifter 34 outputs the mantissa data shifted by 1 bit in the lower direction. If there is no overflow, as described above, the output of the adder 12 of the rounding circuit 11 is directly output as the mantissa data.

【0042】このように、本実施例によれば、請求項1
記載の発明による丸め回路11の具体的な適用として、
浮動小数点の丸め処理を正負対称に行なうことができ、
演算精度が向上するものとなる。
As described above, according to this embodiment,
As a specific application of the rounding circuit 11 according to the described invention,
Floating point rounding can be performed with positive and negative symmetry,
The calculation accuracy is improved.

【0043】さらに、請求項4記載の発明の一実施例を
図5により説明する。本実施例は、2の補数形式の浮動
小数点乗算回路35に関するもので、具体的には、図3
に示したような正規化回路15の仮数部入力として2つ
の仮数部1,2の積を算出する乗算器(乗算手段)36
を設け、指数部入力として2つの指数部1,2の和を算
出する加算器(加算手段)37を設け、かつ、切換え回
路26とオーバーフロー・アンダーフロー処理回路27
間に、図4に示したような浮動小数点丸め回路31を設
けたものである。
Further, an embodiment of the invention described in claim 4 will be described with reference to FIG. The present embodiment relates to a two's complement floating-point multiplication circuit 35, and specifically, FIG.
A multiplier (multiplication means) 36 for calculating the product of two mantissa parts 1 and 2 as the mantissa part input of the normalization circuit 15 as shown in FIG.
And an adder (adding means) 37 for calculating the sum of two exponents 1 and 2 as an exponent input, and a switching circuit 26 and an overflow / underflow processing circuit 27.
A floating point rounding circuit 31 as shown in FIG. 4 is provided between them.

【0044】このような構成において、2つの浮動小数
点データ(仮数部1+指数部1、仮数部2+指数部2)
を入力し、その仮数部の積を乗算器36により算出し、
同時に、指数部の和を加算器37により算出する。その
後、図3により説明したように、正規化回路15による
浮動小数点の正規化を行なうが、最終的に、オーバーフ
ロー・アンダーフロー処理回路27で処理して仮数部
3、指数部3なるデータを出力する前に、図4で説明し
た浮動小数点丸め回路31による丸め処理を行なう。
In such a configuration, two floating point data (mantissa part 1 + exponent part 1, mantissa part 2 + exponent part 2)
Is input, the product of the mantissas is calculated by the multiplier 36,
At the same time, the sum of the exponents is calculated by the adder 37. After that, as described with reference to FIG. 3, the floating point normalization is performed by the normalization circuit 15, but finally, the overflow / underflow processing circuit 27 processes and outputs the data of the mantissa part 3 and the exponent part 3. Before that, rounding processing by the floating point rounding circuit 31 described in FIG. 4 is performed.

【0045】この結果、浮動小数点の乗算結果が、アン
ダーフローの発生を極力防止した形で正規化され、さら
に、仮数部が正負対称に丸められるため、演算精度の高
いものとなる。また、本実施例によれば、乗算回路35
が正規化回路15を内蔵しているため、正規化されてい
ない入力値に対しても乗算結果を正しく正規化できるも
のとなる。
As a result, the floating-point multiplication result is normalized so that underflow is prevented as much as possible, and the mantissa part is rounded in positive and negative symmetry, resulting in high calculation accuracy. Further, according to the present embodiment, the multiplication circuit 35
Since the normalization circuit 15 is built in, the multiplication result can be correctly normalized even for an unnormalized input value.

【0046】ついで、請求項5記載の発明の一実施例を
図6により説明する。本実施例は、2の補数形式の浮動
小数点加減算回路38に関するものである。まず、入力
された2つの指数部1,2の差分を算出する減算器(減
算手段)39が設けられ、この減算器39により減算さ
れた差分出力の符号ビットに応じて2つの指数部1,2
中の大きいほうの指数部1又は2を出力するセレクタ
(指数出力切換え手段)40が設けられている。また、
この減算器39からの差分出力の絶対値を算出する絶対
値算出器(絶対値算出手段)41が設けられ、この絶対
値算出器41の絶対値出力のビット数分だけ入力された
仮数部データを下位方向にシフトさせるバレルシフタ
(シフト手段)42が設けられている。ここに、バレル
シフタ42には2つの仮数部1,2の内の何れか一方の
みがスイッチSW4により入力される。
Next, an embodiment of the invention described in claim 5 will be described with reference to FIG. The present embodiment relates to a two's complement floating point adder / subtractor circuit 38. First, a subtracter (subtracting means) 39 for calculating the difference between the input two exponent parts 1 and 2 is provided, and the two exponent parts 1 and 2 are provided according to the sign bit of the difference output subtracted by the subtractor 39. Two
A selector (exponential output switching means) 40 that outputs the larger exponent part 1 or 2 is provided. Also,
An absolute value calculator (absolute value calculating means) 41 for calculating the absolute value of the difference output from the subtractor 39 is provided, and the mantissa data input by the number of bits of the absolute value output of the absolute value calculator 41. Is provided with a barrel shifter (shift means) 42 for shifting in the lower direction. Here, only one of the two mantissa parts 1 and 2 is input to the barrel shifter 42 by the switch SW 4 .

【0047】しかして、このバレルシフタ42の出力側
には、請求項1記載の発明による丸め回路11が設けら
れ、バレルシフタ42の出力をこれよりも少ない所定の
ビット数に丸め処理するように構成されている。また、
このような仮数部処理系統には、この丸め回路11によ
る出力と、入力されて丸め回路11を経ない仮数部1又
は2なるデータとを切換え出力するスイッチSW5 が設
けられ、これらのデータ間の加減算を行なう加減算器
(加減算手段)43が設けられている。ここに、スイッ
チSW4,SW5は、指数部1<指数部2により減算器3
9の出力が負の場合には1端子側に切換えられ、指数部
1≧指数部2により減算器39の出力が正又は0の場合
には0端子側に切換えられる。
A rounding circuit 11 according to the present invention is provided on the output side of the barrel shifter 42, and is configured to round the output of the barrel shifter 42 to a predetermined number of bits smaller than that. ing. Also,
Such a mantissa processing system is provided with a switch SW 5 for switching and outputting between the output from the rounding circuit 11 and the data that is input and does not pass through the rounding circuit 11 and is the mantissa 1 or 2. An adder / subtractor (adder / subtractor) 43 for performing addition and subtraction of is provided. Here, the switches SW 4 and SW 5 are configured such that the exponent part 1 <the exponent part 2
When the output of 9 is negative, it is switched to the 1 terminal side, and when the output of the subtractor 39 is positive or 0 by the exponent part 1 ≧ exponent part 2, it is switched to the 0 terminal side.

【0048】このような構成において、2つの浮動小数
点データ(仮数部1+指数部1、仮数部2+指数部2)
の和又は差を演算するためには、各々の指数部1,2を
揃えてから、仮数部1,2の加減算を行なう必要があ
る。そのために、指数部1,2の差を減算器39によっ
て算出し、その結果の符号ビットによって、大きいほう
の指数部1又は2をセレクタ40により出力する。同時
に、この減算器39出力の絶対値を絶対値算出器41に
より算出し、バレルシフタ42に出力し、小さいほうの
指数部に対応する仮数部に対してビットシフト処理を行
なう。その後、所定のビット数を超える下位の余分なビ
ットに対しては、丸め回路11によって正負対称の丸め
処理を行なう。このようにして、指数部1,2を揃え、
仮数部1又は2を丸めた後、加減算器43により2つの
仮数部データの加減算を行なう。この後は、正規化処理
を行ない、加減算器出力とすればよい。
In such a configuration, two floating point data (mantissa part 1 + exponent part 1, mantissa part 2 + exponent part 2)
In order to calculate the sum or difference of, it is necessary to align the exponent parts 1 and 2 and then add and subtract the mantissa parts 1 and 2. Therefore, the difference between the exponents 1 and 2 is calculated by the subtractor 39, and the larger exponent 1 or 2 is output by the selector 40 according to the sign bit of the result. At the same time, the absolute value of the output of the subtractor 39 is calculated by the absolute value calculator 41 and output to the barrel shifter 42, and the mantissa part corresponding to the smaller exponent part is bit-shifted. After that, the rounding circuit 11 performs a rounding process of positive and negative symmetry on the lower-order extra bits exceeding the predetermined number of bits. In this way, align the exponents 1 and 2,
After rounding the mantissa part 1 or 2, the adder / subtractor 43 performs addition and subtraction of the two mantissa part data. After this, normalization processing may be performed to obtain an adder / subtractor output.

【0049】[0049]

【発明の効果】請求項1記載の発明によれば、2の補数
形式のNビットの2進データの符号ビットに応じてL<
Nなる関係のLビットの「100…0」と「011…
1」とのビットパターンデータを切換え出力する出力手
段と、前記Nビットの2進データの下位Lビット分にこ
の出力手段から出力されるLビットのビットパターンデ
ータを加算する加算手段とよりなる丸め回路を設けて、
正負対称の丸め処理を行なうようにしたので、小規模な
ハードウエア構成にして丸めのずれの小さなものとする
ことができ、よって、必要な演算精度を得ることができ
る。
According to the first aspect of the present invention, L <L depending on the sign bit of N-bit binary data in the 2's complement format.
L bits “100 ... 0” and “011 ...
Rounding including output means for switching and outputting bit pattern data of "1" and addition means for adding the L-bit bit pattern data output from the output means to the lower L bits of the N-bit binary data. With a circuit
Since the positive and negative symmetric rounding processing is performed, it is possible to reduce the rounding deviation with a small-scale hardware configuration, and thus it is possible to obtain the necessary calculation accuracy.

【0050】また、請求項2記載の発明によれば、Mビ
ットの仮数部及びJビットの指数部の入力に対してK<
Jなる関係のKビットの指数部で表現可能な最小値Emi
n を前記Jビットの指数部から減算する第1減算手段
と、入力された仮数部の上位側から見て符号ビットと異
なるビットが最初に出現するまでのビット数を計数する
計数手段と、前記第1減算手段の出力とこの計数手段の
出力とを比較して小さいほうを出力する比較出力手段
と、入力された仮数部のデータをこの比較出力手段の出
力値のビット数分だけ上位方向にシフトさせる第1シフ
ト手段と、前記第1減算手段の出力値中の負のものを正
の値に変換する変換手段と、入力された仮数部のデータ
をこの変換手段の出力値のビット数分だけ下位方向にシ
フトさせる第2シフト手段と、入力されたJビットの指
数部から前記比較出力手段の出力値分を減算する第2減
算手段と、前記第1減算手段の出力が、0以上である時
には前記第1シフト手段の出力値及び前記第2減算手段
の出力値を出力させ負である時には前記第2シフト手段
の出力値及び前記最小値Eminを出力する切換え手段と
よりなる2の補数形式の浮動小数点正規化回路を設け、
Mビットの仮数部及びJビットの指数部を入力してMビ
ットの仮数部及びKビットの指数部を出力するようにし
たので、浮動小数点の正規化処理において、アンダーフ
ローの判断を行なう時に、指数部だけでなく、仮数部の
有効ビットの残存数も考慮したものとなり、不必要にア
ンダーフロー処理を行なってしまうことがなく、演算精
度の向上を図ることができる。
According to the second aspect of the present invention, K <for input of the M-bit mantissa part and the J-bit exponent part.
The minimum value Emi that can be represented by the K-bit exponent of the relationship J
first subtracting means for subtracting n from the J-bit exponent part, counting means for counting the number of bits until the first appearance of a bit different from the sign bit as seen from the upper side of the input mantissa part, The comparison output means for comparing the output of the first subtraction means and the output of the counting means and outputting the smaller one, and the input data of the mantissa part in the upper direction by the number of bits of the output value of the comparison output means. First shifting means for shifting, converting means for converting a negative value in the output value of the first subtracting means into a positive value, and input mantissa data by the number of bits of the output value of the converting means. When the output of the first subtracting means is 0 or more, the second shifting means for shifting only in the lower direction, the second subtracting means for subtracting the output value of the comparing and outputting means from the input J-bit exponent part are 0 or more. Sometimes the first shift hand 2 and the output value of the second subtraction means, and a switching means for outputting the output value of the second shift means and the minimum value Emin when the output value of the second subtraction means is negative. Is provided
Since the M-bit mantissa part and the J-bit exponent part are input and the M-bit mantissa part and the K-bit exponent part are output, when the underflow is determined in the floating point normalization process, Not only the exponent part but also the remaining number of significant bits in the mantissa part are taken into consideration, and the underflow process is not unnecessarily performed, and the calculation accuracy can be improved.

【0051】また、請求項3記載の発明によれば、請求
項1記載の発明による丸め回路と、この丸め回路中の第
1加算手段における桁上がりの有無を検出する検出手段
と、桁上がり有の時には指数部に「1」を加算する第2
加算手段と、桁上がり有の時には前記第1加算手段の出
力を下位方向に1ビットだけシフトさせるシフト手段
と、桁上がり有の時にはこのシフト手段のシフト結果を
出力し桁上がり無の時には前記第1加算手段の加算結果
を出力する切換え手段とよりなる2の補数形式の浮動小
数点丸め回路を設け、浮動小数点データの仮数部の丸め
処理を、請求項1記載の発明による丸め回路を用いて正
負対称に行なうようにしたので、演算精度を向上させる
ことができる。
According to the third aspect of the invention, the rounding circuit according to the first aspect of the invention, the detecting means for detecting the presence / absence of a carry in the first adding means in the rounding circuit, and the carry presence When it is, the second which adds "1" to the exponent part
An adder, a shifter for shifting the output of the first adder by one bit in the lower direction when a carry is present, and a shift result of the shifter when a carry is present, and the shift result when the carry is not present. A 2's complement floating-point rounding circuit comprising switching means for outputting the addition result of the 1-adding means is provided, and rounding processing of the mantissa part of the floating-point data is performed by using the rounding circuit according to the present invention. Since the operations are performed symmetrically, the calculation accuracy can be improved.

【0052】また、請求項4記載の発明によれば、請求
項2又は3記載の演算回路について、2つの仮数部の積
を算出する乗算手段と、2つの指数部の和を算出する加
算手段とを設けて、2の補数形式の浮動小数点乗算回路
とし、浮動小数点の乗算結果をアンダーフローの発生を
極力防止し得る請求項2記載の発明による正規化処理
と、仮数部の丸め処理を正負対称に行なう請求項3記載
の発明による浮動小数点丸め処理とを用いるようにした
ので、演算精度の高いものとすることができ、かつ、乗
算回路中にこのような正規化回路を内蔵しているため、
正規化されていない入力に対しても乗算結果を正しく正
規化できるものとなる。
According to the invention described in claim 4, in the arithmetic circuit according to claim 2 or 3, multiplication means for calculating a product of two mantissa parts and addition means for calculating a sum of two exponent parts. 3. The normalization process according to the present invention and the rounding process of the mantissa part are made positive and negative in order to prevent the occurrence of underflow in the floating-point multiplication result as much as possible. Since the floating-point rounding process according to the third aspect of the present invention, which is performed symmetrically, is used, the calculation precision can be made high, and such a normalization circuit is built in the multiplication circuit. For,
The multiplication result can be correctly normalized even for an unnormalized input.

【0053】さらに、請求項5記載の発明では、入力さ
れた2つの指数部の差分を算出する減算手段と、減算さ
れた差分出力の符号ビットに応じて前記2つの指数部中
の大きいほうの指数部を出力する指数出力切換え手段
と、前記差分出力の絶対値を算出する絶対値算出手段
と、入力された2つの仮数部の何れかのデータをこの絶
対値算出手段からの出力値のビット数分だけ下位方向に
シフトさせるシフト手段と、請求項1記載の発明による
丸め回路と、この丸め回路の出力と入力された2つの仮
数部データとの加減算を行なう加減算手段とを設けて、
2の補数形式の浮動小数点加減算回路とし、浮動小数点
の加減算処理において、指数部を揃える時の仮数部のビ
ットシフト処理後に、所定のビット数を超える下位の余
分なビットに対して請求項1記載の発明による丸め回路
で正負対称の丸め処理を行なうようにしたので、演算誤
差を小さなものとし、演算精度を向上させることができ
る。
Further, in the invention of claim 5, the subtracting means for calculating the difference between the two input exponents and the larger one of the two exponents depending on the sign bit of the subtracted difference output. An exponent output switching means for outputting an exponent part, an absolute value calculating means for calculating an absolute value of the difference output, and any one of the two input mantissa parts of the data is output as a bit of an output value from the absolute value calculating means. A shift means for shifting the lower direction by a few minutes, a rounding circuit according to the present invention, and an adder / subtractor means for adding / subtracting the output of the rounding circuit and the inputted two mantissa data are provided.
2. A floating-point addition / subtraction circuit of 2's complement format, wherein in the floating-point addition / subtraction process, after the bit shift process of the mantissa part when aligning the exponent parts, the lower extra bits exceeding the predetermined number of bits are set. Since the rounding circuit according to the invention performs positive and negative symmetric rounding processing, the calculation error can be reduced and the calculation accuracy can be improved.

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

【図1】請求項1記載の発明の第一の実施例を示すブロ
ック図である。
FIG. 1 is a block diagram showing a first embodiment of the invention according to claim 1.

【図2】請求項1記載の発明の第二の実施例を示すブロ
ック図である。
FIG. 2 is a block diagram showing a second embodiment of the invention according to claim 1;

【図3】請求項2記載の発明の一実施例を示すブロック
図である。
FIG. 3 is a block diagram showing an embodiment of the invention described in claim 2.

【図4】請求項3記載の発明の一実施例を示すブロック
図である。
FIG. 4 is a block diagram showing an embodiment of the invention according to claim 3;

【図5】請求項4記載の発明の一実施例を示すブロック
図である。
FIG. 5 is a block diagram showing an embodiment of the invention described in claim 4.

【図6】請求項5記載の発明の一実施例を示すブロック
図である。
FIG. 6 is a block diagram showing an embodiment of the invention described in claim 5;

【図7】従来の丸め回路を示すブロック図である。FIG. 7 is a block diagram showing a conventional rounding circuit.

【図8】従来の浮動小数点正規化装置を示すブロック図
である。
FIG. 8 is a block diagram showing a conventional floating point normalization device.

【図9】従来の浮動小数点の乗算処理を示すフローチャ
ートである。
FIG. 9 is a flowchart showing a conventional floating point multiplication process.

【図10】従来の浮動小数点の加算処理を示すフローチ
ャートである。
FIG. 10 is a flowchart showing conventional floating point addition processing.

【符号の説明】[Explanation of symbols]

11 丸め回路 12 加算手段 13,14 出力手段 15 浮動小数点正規化回路 16 第1減算手段 17 計数手段 20 比較出力手段 21 第1シフト手段 22 第2減算手段 24 第2シフト手段 26 切換え手段 31 浮動小数点丸め回路 32 検出手段 33 第2加算手段 34 シフト手段 35 浮動小数点乗算回路 36 乗算手段 37 加算手段 38 浮動小数点加算回路 39 減算手段 40 指数出力切換え手段 41 絶対値算出手段 42 シフト手段 43 加減算手段 11 Rounding Circuit 12 Addition Means 13 and 14 Output Means 15 Floating Point Normalization Circuit 16 First Subtracting Means 17 Counting Means 20 Comparison Output Means 21 First Shift Means 22 Second Subtracting Means 24 Second Shift Means 26 Switching Means 31 Floating Point Rounding circuit 32 Detection means 33 Second addition means 34 Shift means 35 Floating point multiplication circuit 36 Multiplication means 37 Addition means 38 Floating point addition circuit 39 Subtraction means 40 Exponential output switching means 41 Absolute value calculation means 42 Shift means 43 Addition / subtraction means

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 2の補数形式のNビット(ただし、Nは
自然数)の2進データの符号ビットに応じてLビット
(ただし、LはL<Nなる関係に設定された自然数)の
「100…0」と「011…1」とのビットパターンデ
ータを切換え出力する出力手段と、前記Nビットの2進
データの下位Lビット分にこの出力手段から出力される
Lビットのビットパターンデータを加算する加算手段と
よりなる丸め回路を設け、入力されたNビットの2進デ
ータを(N−L)ビットのデータに丸めるようにしたこ
とを特徴とする演算回路。
1. An L-bit (where L is a natural number set in a relationship of L <N) "100" according to a sign bit of N-bit (where N is a natural number) binary data in a two's complement format. Output means for switching and outputting bit pattern data of "0" and "011 ... 1", and L-bit bit pattern data output from this output means is added to the lower L bits of the N-bit binary data. And a rounding circuit including an adding means for rounding the input N-bit binary data to (NL) -bit data.
【請求項2】 Mビットの仮数部及びJビットの指数部
(ただし、M,Jは自然数)の入力に対してKビット
(ただし、KはK<Jなる関係に設定された自然数)の
指数部で表現可能な最小値Emin を前記Jビットの指数
部から減算する第1減算手段と、入力された仮数部の上
位側から見て符号ビットと異なるビットが最初に出現す
るまでのビット数を計数する計数手段と、前記第1減算
手段の出力とこの計数手段の出力とを比較して小さいほ
うを出力する比較出力手段と、入力された仮数部のデー
タをこの比較出力手段の出力値のビット数分だけ上位方
向にシフトさせる第1シフト手段と、前記第1減算手段
の出力値中の負のものを正の値に変換する変換手段と、
入力された仮数部のデータをこの変換手段の出力値のビ
ット数分だけ下位方向にシフトさせる第2シフト手段
と、入力されたJビットの指数部から前記比較出力手段
の出力値分を減算する第2減算手段と、前記第1減算手
段の出力が、0以上である時には前記第1シフト手段の
出力値及び前記第2減算手段の出力値を出力し負である
時には前記第2シフト手段の出力値及び前記最小値Emi
n を出力する切換え手段とよりなる2の補数形式の浮動
小数点正規化回路を設け、Mビットの仮数部及びJビッ
トの指数部を入力してMビットの仮数部及びKビットの
指数部を出力するようにしたことを特徴とする演算回
路。
2. An exponent of K bits (where K is a natural number set in a relation of K <J) with respect to an input of an M-bit mantissa part and a J-bit exponent part (where M and J are natural numbers). A first subtraction means for subtracting the minimum value Emin that can be expressed by the part from the J-bit exponent part, and the number of bits until the first appearance of a bit different from the sign bit as seen from the upper side of the input mantissa part. Counting means for counting, comparison output means for comparing the output of the first subtraction means with the output of the counting means and outputting the smaller one, and input mantissa data of the output value of the comparison output means. First shift means for shifting in the upper direction by the number of bits, and converting means for converting a negative one of the output values of the first subtracting means into a positive value,
Second shift means for shifting the input mantissa data in the lower direction by the number of bits of the output value of the converting means, and subtracting the output value of the comparison output means from the input J-bit exponent portion. When the outputs of the second subtraction means and the first subtraction means are 0 or more, the output value of the first shift means and the output value of the second subtraction means are output, and when the outputs are negative, the output of the second shift means is output. Output value and the minimum value Emi
A floating-point normalization circuit of 2's complement format including switching means for outputting n is provided, and an M-bit mantissa part and a J-bit exponent part are input and an M-bit mantissa part and a K-bit exponent part are output. An arithmetic circuit characterized in that
【請求項3】 2の補数形式のNビット(ただし、Nは
自然数)の2進データの符号ビットに応じてLビット
(ただし、LはL<Nなる関係に設定された自然数)の
「100…0」と「011…1」とのビットパターンデ
ータを切換え出力する出力手段と前記Nビットの2進デ
ータの下位Lビット分にこの出力手段から出力されるL
ビットのビットパターンデータを加算する第1加算手段
とよりなり入力されたNビットの仮数部の2進データを
(N−L)ビットのデータに丸める丸め回路と、前記第
1加算手段における桁上がりの有無を検出する検出手段
と、桁上がり有の時には指数部に「1」を加算する第2
加算手段と、桁上がり有の時には前記第1加算手段の出
力を下位方向に1ビットだけシフトさせるシフト手段
と、桁上がり有の時にはこのシフト手段のシフト結果を
出力し桁上がり無の時には前記第1加算手段の加算結果
を出力する切換え手段とよりなる2の補数形式の浮動小
数点丸め回路を設けたことことを特徴とする演算回路。
3. An L-bit (where L is a natural number set in a relation of L <N) "100" according to a sign bit of N-bit (where N is a natural number) binary data in a two's complement format. Output means for switching and outputting bit pattern data of "0" and "011 ... 1" and L output from this output means for lower L bits of the N-bit binary data.
A rounding circuit for rounding the inputted binary data of the N-bit mantissa into (NL) -bit data, and a carry in the first adding means. Detecting means for detecting the presence / absence of the presence of a carry;
An adder, a shifter for shifting the output of the first adder by one bit in the lower direction when a carry is present, and a shift result of the shifter when a carry is present, and the shift result when the carry is not present. An arithmetic circuit characterized in that a floating-point rounding circuit of 2's complement format comprising switching means for outputting the addition result of the 1-adding means is provided.
【請求項4】 2つの仮数部の積を算出する乗算手段
と、2つの指数部の和を算出する加算手段とを設けて、
2の補数形式の浮動小数点乗算回路としたことを特徴と
する請求項2又は3記載の演算回路。
4. A multiplication means for calculating a product of two mantissa parts and an addition means for calculating a sum of two exponent parts are provided,
The arithmetic circuit according to claim 2 or 3, wherein the arithmetic circuit is a two's complement floating point multiplication circuit.
【請求項5】 入力された2つの指数部の差分を算出す
る減算手段と、減算された差分出力の符号ビットに応じ
て前記2つの指数部中の大きいほうの指数部を出力する
指数出力切換え手段と、前記差分出力の絶対値を算出す
る絶対値算出手段と、入力された2つの仮数部の何れか
のデータをこの絶対値算出手段からの出力値のビット数
分だけ下位方向にシフトさせるシフト手段と、このシフ
ト手段から出力される2の補数形式のNビット(ただ
し、Nは自然数)の2進データの符号ビットに応じてL
ビット(ただし、LはL<Nなる関係に設定された自然
数)の「100…0」と「011…1」とのビットパタ
ーンデータを切換え出力する出力手段と前記Nビットの
2進データの下位Lビット分にこの出力手段から出力さ
れるLビットのビットパターンデータを加算する加算手
段とよりなり入力されたNビットの2進データを(N−
L)ビットのデータに丸める丸め回路と、この丸め回路
の出力と入力された2つの仮数部データとの加減算を行
なう加減算手段とを設けて、2の補数形式の浮動小数点
加減算回路としたことを特徴とする演算回路。
5. A subtracting means for calculating a difference between two input exponents, and an exponential output switching for outputting a larger exponent of the two exponents according to a sign bit of the subtracted difference output. Means, an absolute value calculating means for calculating the absolute value of the difference output, and data of any of the two input mantissas, which are shifted in the lower direction by the number of bits of the output value from the absolute value calculating means. L according to the shift means and the sign bit of N-bit (where N is a natural number) binary data of 2's complement format output from the shift means.
Output means for switching and outputting bit pattern data of "100 ... 0" and "011 ... 1" of bits (where L is a natural number set to satisfy the relation of L <N) and the lower order of the N-bit binary data. The N-bit binary data which is input is composed of an addition means for adding the L-bit bit pattern data output from the output means to the L-bit (N-
A rounding circuit for rounding L) -bit data and addition / subtraction means for performing addition / subtraction of the output of the rounding circuit and the input two mantissa data are provided to form a two's complement floating-point addition / subtraction circuit. Characteristic arithmetic circuit.
JP33541191A 1991-12-19 1991-12-19 Arithmetic operation circuit Pending JPH05167456A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP33541191A JPH05167456A (en) 1991-12-19 1991-12-19 Arithmetic operation circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP33541191A JPH05167456A (en) 1991-12-19 1991-12-19 Arithmetic operation circuit

Publications (1)

Publication Number Publication Date
JPH05167456A true JPH05167456A (en) 1993-07-02

Family

ID=18288250

Family Applications (1)

Application Number Title Priority Date Filing Date
JP33541191A Pending JPH05167456A (en) 1991-12-19 1991-12-19 Arithmetic operation circuit

Country Status (1)

Country Link
JP (1) JPH05167456A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1995009487A1 (en) * 1993-09-28 1995-04-06 Sony Corporation High efficiency encoding/decoding device
US6990561B2 (en) 2000-05-23 2006-01-24 Ntt Comware Corporation Data sharing method, terminal, and medium on which program is recorded

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1995009487A1 (en) * 1993-09-28 1995-04-06 Sony Corporation High efficiency encoding/decoding device
US5604494A (en) * 1993-09-28 1997-02-18 Sony Corporation Efficient encoding/decoding apparatus
US6990561B2 (en) 2000-05-23 2006-01-24 Ntt Comware Corporation Data sharing method, terminal, and medium on which program is recorded

Similar Documents

Publication Publication Date Title
US5027308A (en) Circuit for adding/subtracting two floating point operands
US5010508A (en) Prenormalization for a floating-point adder
JP2013012203A (en) Floating-point adder
KR100241076B1 (en) Floating- point multiply-and-accumulate unit with classes for alignment and normalization
CN116643718B (en) Floating point fusion multiply-add device and method of pipeline structure and processor
KR100465371B1 (en) apparatus and method for design of the floating point ALU performing addition and round operations in parallel
WO1999040508A1 (en) Fast adder/subtractor for signed floating point numbers
US5181184A (en) Apparatus for multiplying real-time 2&#39;s complement code in a digital signal processing system and a method for the same
JP2757671B2 (en) Priority encoder and floating point adder / subtracter
KR19980082906A (en) How to Convert Floating-Point Numbers to Integer Types
JP2558669B2 (en) Floating point arithmetic unit
JPH05167456A (en) Arithmetic operation circuit
JP3253660B2 (en) Numerical rounding device and numerical rounding method
KR920003493B1 (en) Arithmetic circuit based on floating point notation
JP2010102431A (en) Floating decimal point arithmetic circuit, floating decimal point arithmetic method, and servo-controlled system
JPH06250820A (en) Exponential underflow in floating-point adder and method and equipment for detecting overflow
JP3187402B2 (en) Floating point data addition / subtraction circuit
JP2003029960A (en) Elimination of rounding steps in short path of floating point adders
JPH07121353A (en) Floating point adder-substracter
JPH0635671A (en) Floating point adder-subtracter
JPH0612224A (en) Method and device for arithmetic processing for floating point binary number
Deka et al. Design of an ASIC-Based High Speed 32-bit Floating Point Adder
JP3124286B2 (en) Floating point arithmetic unit
JPH0887399A (en) Normalizing device using redundant shift number prediction and shift error correction
CN112541582A (en) Arithmetic circuit