JP2555135B2 - Arithmetic circuit - Google Patents
Arithmetic circuitInfo
- Publication number
- JP2555135B2 JP2555135B2 JP63058825A JP5882588A JP2555135B2 JP 2555135 B2 JP2555135 B2 JP 2555135B2 JP 63058825 A JP63058825 A JP 63058825A JP 5882588 A JP5882588 A JP 5882588A JP 2555135 B2 JP2555135 B2 JP 2555135B2
- Authority
- JP
- Japan
- Prior art keywords
- mantissa
- bit
- normalization
- shift
- bits
- 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 - Lifetime
Links
Description
【発明の詳細な説明】 〔目 次〕 概要 産業上の利用分野 従来の技術(第5、6図) 発明が解決しようとする課題 課題を解決するための手段 作用 実施例 本発明の一実施例(第1〜4図) 発明の効果 〔概 要〕 浮動小数表記法の数値について演算を行う演算回路に
関し、 演算処理を高速化できる演算回路を提供することを目
的とし、 指数部と仮数部により表される浮動小数点表記法によ
り2つの数の演算を行うとともに、仮数部の下桁に所定
数の付加ビットを有し、仮数部の演算結果に応じて正規
化および丸めの処理を行う演算回路において、仮数部の
演算結果に基づく正規化のシフト量が前記付加ビット数
を超えるとき、仮数部のシフト化を行うとともに、仮数
部の最下位ビットについての丸めを並行して処理し、両
者を合成する第1の実行手段と、仮数部の演算結果に基
づき前記付加ビット数の範囲内で正規化のために仮数部
をシフトするシフト手段と、仮数部の演算結果に基づく
正規化のシフト量が前記付加ビット以下であるとき、丸
めの処理によって生じる仮数部の桁移動を各態様毎に、
丸めの処理結果として予め設定し、そのうちから1つを
選択する第2の実行手段と、仮数部の演算結果に基づく
正規化のシフト量が前記付加ビットを超えるか否かによ
り、第1の実行手段又は第2の実行手段の出力を択一的
に選択する選択手段とにより構成する。DETAILED DESCRIPTION [Table of Contents] Outline Industrial field of application Conventional technology (Figs. 5 and 6) Problem to be solved by the invention Means for solving the problem Action Example Example of the present invention (FIGS. 1 to 4) Effects of the Invention [Summary] An arithmetic circuit for performing arithmetic operation on a numerical value in floating point notation, with the purpose of providing an arithmetic circuit capable of speeding up arithmetic processing. An arithmetic circuit that performs an operation of two numbers by the represented floating-point notation, has a predetermined number of additional bits in the lower digit of the mantissa, and performs normalization and rounding processing according to the operation result of the mantissa. In, when the shift amount of the normalization based on the operation result of the mantissa exceeds the number of additional bits, the mantissa is shifted and the least significant bit of the mantissa is rounded in parallel, and both are processed. First to synthesize Execution means, shift means for shifting the mantissa part for normalization within the range of the additional bit number based on the operation result of the mantissa part, and the shift amount for normalization based on the operation result of the mantissa part is the additional bit or less , The digit shift of the mantissa part caused by the rounding process is
The second execution means is set in advance as a rounding processing result, and one of them is selected, and the first execution is performed depending on whether the shift amount for normalization based on the operation result of the mantissa exceeds the additional bit. Means or selecting means for selectively selecting the output of the second executing means.
本発明は、演算回路に係り、詳しくは浮動小数点表記
法の数値について演算を行う演算回路に関する。The present invention relates to an arithmetic circuit, and more particularly, to an arithmetic circuit that operates on a numerical value in floating point notation.
固定小数点表現では、表現できる数の範囲が狭いため
非常に大きな数を表すことができない。また、固定小数
点表現は通常整数のみを扱うことが多く、したがって科
学技術計算などに必要な実数を表すための表記法が別に
必要となる。このようなことから、仮数と指数と呼ばれ
る2つの数を組み合わせた浮動小数点表記法(floating
point representation)が考察された。Fixed-point representation cannot represent very large numbers because the range of numbers that can be represented is narrow. In addition, the fixed-point representation usually handles only integers in many cases, and thus a notation for expressing real numbers required for scientific and technological calculations is separately required. For this reason, the floating point notation (floating notation) that combines two numbers called the mantissa and exponent is used.
point representation) was considered.
一般的な浮動小数点数は、基数(radix)がRのと
き、次のように示される。A general floating-point number is represented as follows when the radix is R.
(−1)s・m・Re ここに、sは符号(sign)で、正のときs=0、負の
ときs=1である。また、mとeはそれぞれ仮数(mant
issa)、指数(exponent)であり、これらを固定小数点
で表したものを組み合わせたものがコンピュータ内の浮
動小数点表現である。なお、浮動小数点表現では、仮数
mの長さが有効けたの長さを決めるので、精度の良い数
値を必要とする場合は、仮数部の長さを大きくした表現
が用いられる。(−1) s · m · R e Here, s is a sign, and s = 0 when it is positive and s = 1 when it is negative. In addition, m and e are mantissas (mant
issa), exponent, which is a combination of fixed-point representations of these is the floating-point representation in the computer. In the floating-point representation, the length of the mantissa m determines the length of the effective digit. Therefore, when an accurate numerical value is required, an expression with a large mantissa length is used.
このような浮動小数点演算は、整数演算と比べ、ダイ
ナミックレンジが広く精度も高い、特に、近時は各種の
高度な演算要求に沿うように高速のものが求められる傾
向にある。Such floating point arithmetic has a wider dynamic range and higher accuracy than integer arithmetic, and in particular, recently there is a tendency to demand high speed arithmetic so as to meet various sophisticated arithmetic demands.
現在、最も広く使われている2進の浮動小数点規格
は、IEEE、DEC、IBM、MIL−Std−1750Aの四である。い
ずれも単精度の浮動小数点を32ビットの語長で表してい
る。いずれの規格も倍精度データをサポートしており、
なかには拡張形式の単精度や拡張形式の倍精度など他の
データの形式をサポートしているものである。このう
ち、IEEEの作業グループは、ANSI/IEEE Std 754−198
5(規格書)(最終規格として1985年規格化された。)
に示す仕様を、移植性の高い浮動小数点ソフト用の強力
な規格として提案している。この規格提案は広い支持を
受けており、今後作られるハードウエアの大部分の基本
になっていくと考えられる。Currently, the most widely used binary floating point standards are IEEE, DEC, IBM and MIL-Std-1750A. Each represents a single-precision floating point with a 32-bit word length. Both standards support double precision data,
Some of them support other data formats such as extended format single precision and extended format double precision. Of these, the IEEE working group is ANSI / IEEE Std 754-198.
5 (Standards) (The standard was finalized in 1985.)
The following specifications are proposed as a powerful standard for highly portable floating point software. This standard proposal has received widespread support and is considered to be the basis for most of the future hardware.
従来のこの種のIEEEの浮動小数点フォーマットによる
演算回路としては、例えば第5図に示すようなものがあ
る。本例は、2を基数とする2つの入力数(入力デー
タ)について正規化数同士あるいは正規化数でも非正規
化数同士のでも可の加算を行う例であり、特に第5図は
加算処理のうちアダーによる仮数部の加算が終了し、仮
数部パイプラインレジスタ1に格納された後のブロック
図を示している。なお、2は指数部のレジスタである。
また、同図中符号ビットの演算は省略している。第5図
に基づきポストノーマライズ(正規化)およびラウンド
(丸め)の動作を述べる。As a conventional arithmetic circuit of this type of IEEE floating point format, there is one as shown in FIG. 5, for example. This example is an example of performing addition of two normalized input numbers (input data) between normalized numbers or between normalized numbers and non-normalized numbers. In particular, FIG. 5 shows addition processing. 4 is a block diagram after the addition of the mantissa part by the adder is completed and the mantissa part is stored in the pipeline register 1. 2 is a register of the exponent part.
The calculation of the sign bit is omitted in the figure. The operations of post-normalization (normalization) and round (rounding) will be described with reference to FIG.
なお、正規化とは仮数部の最上位桁が“0"にならない
ようにすることであり、また丸めとは演算結果が所定の
桁数を超えて格納できない場合に、下位のあふれた部分
を切り捨て等の方法によって処理、すなわち丸めること
である。丸めの方法により累積誤差が大きく影響を受け
る可能性があるので、近傍の値に向って丸める、0に向
って丸める等の方法がある。パイプラインレジスタ1に
格納されるデータの形式は第6図のように示され、主な
記号の意味は次の通りである。Note that normalization is to prevent the most significant digit of the mantissa part from being "0", and rounding is to reduce the overflowed part of the lower part when the operation result exceeds the predetermined number of digits and cannot be stored. It is processing, that is, rounding by a method such as truncation. Since the cumulative error may be greatly affected by the rounding method, there are methods such as rounding toward a neighboring value and rounding toward 0. The format of the data stored in the pipeline register 1 is shown in FIG. 6, and the main symbols have the following meanings.
V:仮数部のオーバフロービット G:ガードビット R:ラウンドビット S:スティッキビット いま、ポストノーマライズではV=φかつN=1にな
るように仮数部をシフトする操作が必要である。まず、
プライオリティエンコーダ(PE)3でVビットから連続
する“φ”の数をカウントし、その値をシフタ(shifte
r)4に送るとともに、指数部の加算器(adder)5にも
入力する。そして、シフタ4で必要なビットだけシフト
することによってポストノーマライズは終了する。V: Mantissa overflow bit G: Guard bit R: Round bit S: Sticky bit Now, in post normalization, it is necessary to shift the mantissa so that V = φ and N = 1. First,
The priority encoder (PE) 3 counts the number of consecutive "φ" from the V bit, and the value is shifted (shifte).
r) 4, and also inputs to the adder 5 of the exponent part. Then, the shifter 4 shifts only the necessary bits to complete the post normalization.
次に、ラウンドを行う。ラウンドはラウンド回路6に
よりRビットを必要に応じて切り捨て、あるいは切り上
げすることによって実行される。このとき、仮数部のデ
ータが例えば〔1・11〜110〕でR=1であるとする
と、オーバーフローが生じるため再び1ビットだけ右に
シフトし、かつ加算器5で“1"をプラスする必要があ
る。ラウンドが終了した後の仮数部のデータは出力側の
レジスタ7に格納され、同様に指数部のデータはレジス
タ8に格納される。Next, a round is performed. The round is executed by the round circuit 6 by rounding down or rounding up the R bit as necessary. At this time, if the data of the mantissa part is, for example, [1 · 11 to 110] and R = 1, an overflow occurs, so that it is necessary to shift the value by 1 bit to the right again and to add “1” to the adder 5. There is. The data of the mantissa part after the round is completed is stored in the register 7 on the output side, and the data of the exponent part is similarly stored in the register 8.
しかしながら、このような従来の演算回路にあって
は、正規化の後にラウンドを行う構成となっていたた
め、全体の演算処理時間が長く、近時の高速化要求に沿
い難いという問題点があった。However, in such a conventional arithmetic circuit, since the round is performed after the normalization, the whole arithmetic processing time is long and there is a problem that it is difficult to meet the recent demand for high speed. .
そこで本発明は、演算処理を高速化できる演算回路を
提供することを目的としている。Therefore, an object of the present invention is to provide an arithmetic circuit that can speed up arithmetic processing.
本発明による演算回路は上記目的達成のため、指数部
と仮数部により表される浮動小数点表記法により2つの
数の演算を行うとともに、仮数部の下桁に所定数の付加
ビットを有し、仮数部の演算結果に応じて正規化および
丸めの処理を行う演算回路において、仮数部の演算結果
に基づく正規化のシフト量が前記付加ビット数を超える
とき、仮数部のシフト化を行うとともに、仮数部の最下
位ビットについての丸めを並行して処理し、両者を合成
する第1の実行手段と、仮数部の演算結果に基づき前記
付加ビット数の範囲内で正規化のために仮数部をシフト
するシフト手段と、仮数部の演算結果に基づく正規化の
シフト量が前記付加ビット以下であるとき、丸めの処理
によって生じる仮数部の桁移動を各態様毎に、丸めの処
理結果として予め設定し、そのうちから1つを選択する
第2の実行手段と、仮数部の演算結果に基づく正規化の
シフト量が前記付加ビットを超えるか否かにより、第1
の実行手段又は第2の実行手段の出力を択一的に選択す
る選択手段とを設けている。In order to achieve the above object, the arithmetic circuit according to the present invention calculates two numbers by a floating point notation represented by an exponent part and a mantissa part, and has a predetermined number of additional bits in the lower digit of the mantissa part. In an arithmetic circuit that performs normalization and rounding processing according to the calculation result of the mantissa part, when the shift amount for normalization based on the calculation result of the mantissa part exceeds the number of additional bits, the mantissa part is shifted, First execution means for processing the rounding of the least significant bit of the mantissa in parallel and synthesizing the two, and the mantissa for normalization within the range of the additional bit number based on the operation result of the mantissa. When the shift means for shifting and the shift amount for normalization based on the operation result of the mantissa part are less than or equal to the additional bits, the digit shift of the mantissa part caused by the rounding process is preset as the rounding process result for each mode. And, depending on whether or not the second execution means for selecting one from among them, the shift amount of the normalization based on the operation result of the mantissa exceeds the additional bits, the first
And an selecting means for selectively selecting the output of the executing means or the second executing means.
本発明では、仮数部の演算結果に基づく正規化のシフ
ト量が付加ビット数を超えるときは、正規化のための仮
数部のシフトおよび最下位ビットについて、丸め処理が
平行して行われる。一方、上記正規化のシフト量が付加
ビット以下のときは丸めの処理によって生じる仮数部の
桁移動が各態様毎に予め設定され、そのうちから該当す
る1つが選択される。この場合も丸めと仮数部シフトは
並行して実行される。In the present invention, when the shift amount for normalization based on the operation result of the mantissa exceeds the number of additional bits, rounding processing is performed in parallel for the shift of the mantissa for normalization and the least significant bit. On the other hand, when the normalization shift amount is equal to or less than the additional bits, the digit shift of the mantissa part generated by the rounding process is preset for each mode, and the corresponding one is selected from them. Also in this case, rounding and mantissa shift are performed in parallel.
したがって、逐次処理と異なり、正規化と丸めを並行
処理するため、演算スピードが格段と向上する。Therefore, unlike the sequential processing, since the normalization and the rounding are performed in parallel, the calculation speed is significantly improved.
以下、本発明を図面に基づいて説明する。 Hereinafter, the present invention will be described with reference to the drawings.
第1〜4図は本発明に係る演算回路の一実施例を示す
図である。第1図は仮数部の加算が終了し、その後のラ
ウンド処理等を行う演算ブロックを示す図である。ま
ず、構成を説明する。第1図において、11はレジスタで
あり、例えばパイプラインレジスタからなり、図中に示
す配列の28ビットのデータを格納し、そのうちLSBのさ
らに下位側にはG、R、Sの3つのビット(付加ビッ
ト)を有しており、これは従来と同様である。12は符号
レジスタであり、符号レジスタ12はデータの正、負を表
す。1ビットの符号のデータ(SGN)を格納する。例え
ば“0"が正を、“1"が負を表す。1 to 4 are diagrams showing an embodiment of an arithmetic circuit according to the present invention. FIG. 1 is a diagram showing a calculation block for performing round processing after the addition of the mantissa part is completed. First, the configuration will be described. In FIG. 1, reference numeral 11 denotes a register, which is composed of, for example, a pipeline register and stores 28-bit data in the arrangement shown in the figure, of which three bits G, R and S ( Additional bits), which is the same as the conventional one. Reference numeral 12 is a sign register, and the sign register 12 indicates whether the data is positive or negative. Stores 1-bit code data (SGN). For example, "0" represents positive and "1" represents negative.
レジスタ11の出力は28ビットで取り出され、シフタ1
3、14、プライオリティエンコーダPE15、4ビットプラ
イオリティエンコーダ(4bPE)16およびLSB回路17に入
力される。プライオリティエンコーダPE15はVビットか
ら連続する“0"の数をカウントし、その値をシフタ13に
送るとともに、図示していない指数部加算器(EXPで表
す)へ送る。シフタ13は28ビットの仮数部のうちSを除
く27ビット分につきプライオリティエンコーダPE15から
の出力に基づいてシフト操作を行い、シフト後の23ビッ
トのデータをセレクタ18に送る。LSB回路17はレジスタ1
1の28ビットデータのうちV、N1、N2、N3およびSビッ
トの5つのデータからモード(mode)要求RP、RMに基づ
いてLSBを決定するもので、詳細な回路は第2図のよう
に示される。The output of register 11 is taken out as 28 bits, and shifter 1
3, 14, a priority encoder PE15, a 4-bit priority encoder (4bPE) 16 and an LSB circuit 17. The priority encoder PE15 counts the number of consecutive "0" s from the V bit, sends the value to the shifter 13, and sends it to an exponent adder (not shown) (not shown). The shifter 13 performs a shift operation on 27 bits of the 28-bit mantissa excluding S based on the output from the priority encoder PE15, and sends the shifted 23-bit data to the selector 18. LSB circuit 17 is register 1
The LSB is determined based on the mode request RP, RM from 5 data of V, N 1 , N 2 , N 3 and S bits of the 28-bit data of 1. The detailed circuit is shown in FIG. As shown.
すなわち、第2図に示すようにLSB回路17はV、N1、N
2、N3の各ビットの入力されるノアゲート21と、モードR
M、SビットおよびSGNの入力されるオアゲート22aと、
Sビットを反転させるインバータ22bと、モードRP、S
ビットおよびSGNの反転信号の入力されるオアゲート22c
と、オアゲート22aとオアゲート22cとのナンドを求める
ナンドゲート23aと、ナンドゲート23aとナンドゲート21
とのアンドを求めるアンドゲート23bとにより構成さ
れ、LSBの決定は具体的には別表のように示され、決定
後のLSBを示す1ビットデータはセレクタ18に入力され
る。上記シフタ13、プライオリティエンコーダ15および
LSB回路17は全体として第1の実行手段19を構成する。That is, as shown in FIG. 2, the LSB circuit 17 has V, N 1 , and N
2 , NOR gate 21 for each bit of N 3 and mode R
OR gate 22a to which M, S bit and SGN are input,
Inverter 22b that inverts the S bit and modes RP and S
OR gate 22c to which inverted signal of bit and SGN is input
And a NAND gate 23a for obtaining a NAND between the OR gate 22a and the OR gate 22c, and a NAND gate 23a and a NAND gate 21.
And an AND gate 23b for determining AND of 2 and 1. The determination of LSB is specifically shown in a separate table, and 1-bit data indicating the determined LSB is input to the selector 18. The shifter 13, the priority encoder 15 and
The LSB circuit 17 constitutes the first executing means 19 as a whole.
4ビットプライオリティエンコーダ16はレジスタ11の
28ビットデータのうちV、N1、N2、N3の4ビットについ
てVビットから連続する“0"の数をカウントし、その値
をシフタ14に送るもので、具体的回路は第3図のように
示される。すなわち、第3図に示すように4ビットプラ
イオリティエンコーダ16は少なくとも一つ以上のローア
クティブ端子を有するゲート24〜26からなり、Vビット
から連続する“0"の値に応じて、 R1:右1ビットシフト R2:シフトなし L1:左1ビットシフト L2:左2ビットシフト の4つの状態を決定してシフト要求をシフタ14に送ると
ともに、このシフト要求を指数部加算器へ送る。シフタ
14は4ビットプライオリティエンコーダ16からのシフト
要求に従ってレジスタ11からの28ビットデータを所定量
だけシフトさせ、シフト後のデータをLSB加算回路31、
ラウンド回路32およびセレクタ33に送る。上記シフタ14
および4ビットプライオリティエンコーダ16はシフト手
段27を構成する。The 4-bit priority encoder 16 is
Of the 28-bit data, the number of consecutive "0" from the V bit is counted for 4 bits of V, N 1 , N 2 and N 3 and the value is sent to the shifter 14. The concrete circuit is shown in FIG. As shown. That is, as shown in FIG. 3, the 4-bit priority encoder 16 is composed of gates 24 to 26 having at least one low active terminal, and R 1 : right according to the value of “0” consecutive from the V bit. 1 bit shift R 2 : No shift L 1 : Left 1 bit shift L 2 : Left 2 bit shift Determines four states and sends the shift request to the shifter 14, and sends the shift request to the exponent adder. Shifter
14 shifts the 28-bit data from the register 11 by a predetermined amount in accordance with the shift request from the 4-bit priority encoder 16, and outputs the shifted data to the LSB addition circuit 31,
Send to round circuit 32 and selector 33. Shifter 14 above
And the 4-bit priority encoder 16 constitutes a shift means 27.
LSB加算回路31はシフタ14により送られたシフト後の
データに対して予め“1"をインクリメントしておくもの
で、インクリメント後のデータは24ビットでセレクタ33
に送られるとともに、そのオーバーフロー信号OVFは指
数部分加算器に送られる。また、ラウンド回路32はレジ
スタ11からの4ビットデータ、すなわちLSB、G′、
R′、S′(ダッシュはシフト後のデータを表す)およ
び符号レジスタ12からの符号ビットSGNからモード要求R
N、RP、RM、RZに基づいてラウンド処理を行うもので具
体的な回路は第4図のように示される。すなわち、第4
図において、ラウンド回路32は少なくとも1つ以上のロ
ーアクティブ端子を有するゲート41〜46と、オアゲート
47〜50と、インバータ51と、アンドゲート52〜56とによ
り構成され、ラウンド処理は別表のように示され、切り
捨てかLSBに+1を加算の何れかが実行され、ラウンド
回路32からの出力2ビットは、セレクタ33の制御信号で
あり、G、Rビットには何ら関係はないセレクタ33に送
られる。The LSB adder circuit 31 increments “1” in advance with respect to the shifted data sent by the shifter 14, and the incremented data is a 24-bit selector 33.
And the overflow signal OVF is sent to the exponent partial adder. Further, the round circuit 32 uses the 4-bit data from the register 11, that is, LSB, G ',
Mode request R from R ', S' (dash represents data after shift) and code bit SGN from code register 12
Round processing is performed based on N, RP, RM, and RZ, and a specific circuit is shown in FIG. That is, the fourth
In the figure, a round circuit 32 includes gates 41 to 46 having at least one low active terminal and an OR gate.
47 to 50, an inverter 51, and AND gates 52 to 56. The round processing is shown in a separate table. Either rounding down or adding +1 to LSB is executed, and the output from the round circuit 32 is 2 The bits are control signals of the selector 33 and are sent to the selector 33 which has nothing to do with the G and R bits.
セレクタ18にはシフタ14からの上位24ビットデータお
よびLSB加算回路31からの24ビットデータが入力されて
おり、セレクタ33はラウンド回路32からの2ビットデー
タに基づきLSB加算回路31又はシフタ14からのデータを
選択してセレクタ18に出力する。セレクタ18はポストノ
ーマライズラウンドに関する制御要求に従いシフタ13お
よびLSB回路17からの24ビットデータとを、セレクタ33
からの24ビットデータと択一的に選択し、選択後のデー
タを出力しレジスタ57に送る。出力レジスタ57は第1図
に示すように、〔1、m23、…………m2、m1〕で表わさ
れる正規化やラウンド処理の終了した24ビットのデータ
を格納するものである。The higher-order 24-bit data from the shifter 14 and the 24-bit data from the LSB adder circuit 31 are input to the selector 18, and the selector 33 outputs the LSB adder circuit 31 or the shifter 14 based on the 2-bit data from the round circuit 32. The data is selected and output to the selector 18. The selector 18 selects the 24-bit data from the shifter 13 and the LSB circuit 17 from the selector 33 according to the control request for the post normalization round.
Alternatively, the 24-bit data is selected and the selected data is output and sent to the register 57. As shown in FIG. 1, the output register 57 stores 24-bit data which has been subjected to normalization and round processing represented by [1, m 23 , ..., M 2 , m 1 ].
上記LSB加算回路31、ラウンド回路32、セレクタ33は
全体として第2の実行手段58を構成し、セレクタ18は選
択手段を構成する。The LSB adder circuit 31, the round circuit 32, and the selector 33 constitute the second executing means 58 as a whole, and the selector 18 constitutes the selecting means.
次に、作用を説明する。 Next, the operation will be described.
本実施例のようにLSBの下位桁に3ビットを付加して
いるデータでは、この3ビットのラウンド処理如何によ
ってLSBを含む下位ビットのデータ内容は正規化後でも
左右される。ところが、付加ビットは3ビットであるか
ら、最大限でも3ビットのシフトしか行われない。例え
ば、ポストノーマライズにおいて、3ビットを左シフト
操作を行う場合、左シフト操作を行った後であれば、ラ
ウンドを如何なる選択で行っても該ラウンド実行時に桁
上げは生じない。したがって、シフト操作のみでよい。In the data in which 3 bits are added to the lower digit of the LSB as in the present embodiment, the data content of the lower bit including the LSB depends on the round processing of the 3 bits even after normalization. However, since the additional bits are 3 bits, only a maximum shift of 3 bits is performed. For example, in post-normalization, when a 3-bit left shift operation is performed, no carry occurs when the round is executed no matter which round the round is performed after the left shift operation is performed. Therefore, only the shift operation is required.
そこで本実施例では、上記の事実に着目し、3ビット
を超えるシフトと、3ビット以内のシフトであってかつ
ラウンド処理を行ったもの(本実施例の全てのラウンド
処理を含む)とを、並列処理で予め演算しておき、その
後、単にセレクタ18によって該当する処理済データを選
択することで、演算処理の時間を短縮している。Therefore, in the present embodiment, paying attention to the above facts, a shift that exceeds 3 bits and a shift that is within 3 bits and that has undergone round processing (including all round processing in this embodiment) The calculation processing time is shortened by performing the calculation in parallel processing in advance and then simply selecting the corresponding processed data by the selector 18.
3ビットを超えるノーマライズの場合 シフト量はプライオリティエンコーダ15によって検出
され、シフタ13によってシフトが行われるとともに、こ
のとき同時にラウンド処理の要求に基づきLSB回路17に
よってLSBの値が決定され、両者が合成されて24ビット
のデータとしてセレクタ18に送られる。そして、セレク
タ18によって上記24ビットデータがそのまま選択され、
出力レジスタ57に格納される。なお、出力レジスタ57の
格納レジスタにはVビットを含んでおらず、常にV=0
となって隠れている。したがって、このように3ビット
を超えるノーマライズの場合には、ノーマライズとラウ
ンド処理が並列に実行され、その後編成されるのみでよ
いから、従来と比べ全体の演算処理時間が短くなり、高
速化を図ることができる。Normalization with more than 3 bits The shift amount is detected by the priority encoder 15 and shifted by the shifter 13. At the same time, the LSB value is determined by the LSB circuit 17 based on the round processing request, and both are combined. And sent to the selector 18 as 24-bit data. Then, the 24-bit data is directly selected by the selector 18,
It is stored in the output register 57. It should be noted that the storage register of the output register 57 does not include the V bit and is always V = 0.
Is hidden. Therefore, in the case of normalization of more than 3 bits in this way, normalization and round processing are executed in parallel and only knitting is required. Therefore, the overall operation processing time is shortened compared to the conventional case, and the speed is increased. be able to.
3ビット以内のノーマライズの場合 3ビット以内のシフト量であるから、まず、レジスタ
11に格納された28ビットのうちV1、N1、N2、N3について
Vビットから連続する“0"の数が4ビットプライオリテ
ィエンコーダ16によってカウントされ、その値に応じて
シフタ14によりレジスタ11からのSビットをのぞく27ビ
ットデータが予め4ビット以内で所定量だけシフトされ
る。その後、ラウンド処理について全ての状況を想定し
た値が予め作成される。具体的には次の4つのケースが
考えられる。In case of normalization within 3 bits Since the shift amount is within 3 bits, first register
Of the 28 bits stored in 11, the number of consecutive "0" from V bit for V 1 , N 1 , N 2 and N 3 is counted by the 4-bit priority encoder 16 and is registered by the shifter 14 according to the value. 27-bit data excluding S bits from 11 is pre-shifted by a predetermined amount within 4 bits. After that, a value assuming all situations for the round process is created in advance. Specifically, the following four cases can be considered.
(I)V1N1N2N3=1XXXのとき 但し、Xは1又は0 このときはV=0とするため、1ビット右シフト操作が
必要となる。(I) When V 1 N 1 N 2 N 3 = 1XXX However, X is 1 or 0. Since V = 0 in this case, a 1-bit right shift operation is required.
(II)VN1N2N3=01XXのとき 正規化されているから、シフトなし (III)VN1N2N3=001X 1ビット左シフトが必要 (IV)VN1N2N3=0001 2ビット左シフトが必要 これらのラウンド処理はモード要求RN、RP、RM、RZに
より別表で示すようにラウンド回路32によって予め行わ
れ、その後ラウンド回路32の出力に基づいてセレクタ33
によりLSBに+1を加算又は切り捨ての何れかが選択さ
れ、24ビットのデータがセレクタ18に出力される。そし
て、制御要求に従いセレクタ18によってセレクタ33から
の出力データが選択されて、出力レジスタ57に格納され
る。(II) VN 1 N 2 N 3 = 01XX Normalized, no shift (III) VN 1 N 2 N 3 = 001X 1-bit left shift required (IV) VN 1 N 2 N 3 = 0001 2-bit left shift is required. These round processes are preliminarily performed by the round circuit 32 by the mode requests RN, RP, RM, and RZ as shown in a separate table, and then the selector 33 based on the output of the round circuit 32.
Thus, either +1 is added to LSB or truncation is selected, and 24-bit data is output to the selector 18. Then, according to the control request, the output data from the selector 33 is selected by the selector 18 and stored in the output register 57.
このようなケースでは3ビット以内のノーマライズで
あるから、シフト量は最大限4ビット以下に制限される
ため、その処理は4ビットのロジック回路で済み、かつ
シフト時間も短い。また、ラウンド処理についても予め
想定されるケースを全て設定しておき、その中の1つを
選択するのみでよく、かつ、このラウンド処理を並列配
置したロジック回路で行っている。したがって、従来と
異なり全体の演算処理時間が短くなり、高速化を図るこ
とができる。In such a case, since the normalization is within 3 bits, the shift amount is limited to a maximum of 4 bits or less, so that the process can be performed by a 4-bit logic circuit and the shift time is short. In addition, all round-cases that have been assumed in advance are set for round processing, and it is only necessary to select one of them, and this round processing is performed by logic circuits arranged in parallel. Therefore, unlike the prior art, the entire calculation processing time is shortened and the speed can be increased.
なお、本実施例ではLSBの下桁に付加ビットとしてGRS
の3ビットを付加した例であるが、付加ビットの数は3
ビットに限らず、他の数であってもよい。また、ラウン
ドのモード要求も上記実施例の態様に限らず、他の例で
もよい。また、IEEE規格の単精度の浮動少数点のデータ
フォーマットを用いて説明したが、倍精度等の他の例で
もよい。さらに、IBMやDEC形式等のデータフォーマット
でもよい。In this embodiment, GRS is added as an additional bit in the last digit of LSB.
Is an example of adding 3 bits, but the number of additional bits is 3
The number is not limited to bits and may be another number. Further, the round mode request is not limited to the mode of the above embodiment, and may be another example. Further, the description has been given using the IEEE standard single precision floating point data format, but other examples such as double precision may be used. Further, it may be a data format such as IBM or DEC format.
本発明によれば、付加ビットを考慮しつつ正規化と丸
めの処理を並列して実行するようにしているので、遅延
を少なくして演算時間を短縮し、処理の高速化を図るこ
とができる。According to the present invention, since the normalization and rounding processes are executed in parallel while considering the additional bits, the delay can be reduced, the operation time can be shortened, and the processing speed can be increased. .
【図面の簡単な説明】 第1〜4図は本発明に係る演算回路の一実施例を示す図
であり、 第1図はその全体ブロック図、 第2図はそのLSB回路の回路図、 第3図はその4ビットプライオリティエンコーダの回路
図、 第4図はそのラウンド回路の回路図、 第5、6図は従来の演算回路を示す図であり、 第5図はそのブロック図、 第6図はそのレジスタのデータ形成を示す図である。 11……レジスタ、 12……符号レジスタ、 13、14……シフタ、 15……プライオリティエンコーダ、 16……4ビットプライオリティエンコーダ、 17……LSB回路、 18……セレクタ、 19……第1の実行手段、 27……シフト手段、 57……出力レジスタ、 58……第2の実行手段。BRIEF DESCRIPTION OF THE DRAWINGS FIGS. 1 to 4 are diagrams showing an embodiment of an arithmetic circuit according to the present invention, FIG. 1 is an overall block diagram thereof, and FIG. 2 is a circuit diagram of its LSB circuit. 3 is a circuit diagram of the 4-bit priority encoder, FIG. 4 is a circuit diagram of the round circuit, FIGS. 5 and 6 are diagrams showing a conventional arithmetic circuit, FIG. 5 is a block diagram thereof, and FIG. FIG. 6 is a diagram showing data formation of the register. 11 …… Register, 12 …… Sign register, 13,14 …… Shifter, 15 …… Priority encoder, 16 …… 4-bit priority encoder, 17 …… LSB circuit, 18 …… Selector, 19 …… First execution Means, 27 ... Shift means, 57 ... Output register, 58 ... Second execution means.
Claims (1)
表記法により2つの数の演算を行うとともに、 仮数部の下桁に所定数の付加ビットを有し、仮数部の演
算結果に応じて正規化および丸めの処理を行う演算回路
において、 仮数部の演算結果に基づく正規化のシフト量が前記付加
ビット数を超えるとき、仮数部のシフト化を行うととも
に、仮数部の最下位ビットについての丸めを並行して処
理し、両者を合成する第1の実行手段と、 仮数部の演算結果に基づき前記付加ビット数の範囲内で
正規化のために仮数部をシフトするシフト手段と、 仮数部の演算結果に基づく正規化のシフト量が前記付加
ビット以下であるとき、丸めの処理によって生じる仮数
部の桁移動を各態様毎に、丸めの処理結果として予め設
定し、そのうちから1つを選択する第2の実行手段と、 仮数部の演算結果に基づく正規化のシフト量が前記付加
ビットを超えるか否かにより、第1の実行手段又は第2
の実行手段の出力を択一的に選択する選択手段と、 を設けたことを特徴とする演算回路。1. A floating point notation represented by an exponent part and a mantissa part is used to calculate two numbers, and a predetermined number of additional bits are provided in the lower digit of the mantissa part according to the result of the mantissa part calculation. In an arithmetic circuit that performs normalization and rounding processing, when the shift amount of normalization based on the operation result of the mantissa exceeds the number of additional bits, the mantissa is shifted and the least significant bit of the mantissa is calculated. First execution means for processing the rounding of the numbers in parallel and synthesizing them, shift means for shifting the mantissa part for normalization within the range of the additional bit number based on the operation result of the mantissa part, and mantissa When the normalization shift amount based on the calculation result of the part is equal to or less than the additional bit, the digit shift of the mantissa part generated by the rounding process is preset as a rounding process result for each mode, and one of them is set. Choice The second execution means for performing the first execution means or the second execution means depending on whether the shift amount for normalization based on the operation result of the mantissa exceeds the additional bit.
And a selecting means for selectively selecting the output of the executing means.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP63058825A JP2555135B2 (en) | 1988-03-11 | 1988-03-11 | Arithmetic circuit |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP63058825A JP2555135B2 (en) | 1988-03-11 | 1988-03-11 | Arithmetic circuit |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH01232422A JPH01232422A (en) | 1989-09-18 |
| JP2555135B2 true JP2555135B2 (en) | 1996-11-20 |
Family
ID=13095418
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP63058825A Expired - Lifetime JP2555135B2 (en) | 1988-03-11 | 1988-03-11 | Arithmetic circuit |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2555135B2 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US4926370A (en) * | 1989-04-17 | 1990-05-15 | International Business Machines Corporation | Method and apparatus for processing postnormalization and rounding in parallel |
| US5408426A (en) * | 1992-03-17 | 1995-04-18 | Hitachi, Ltd. | Arithmetic unit capable of performing concurrent operations for high speed operation |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH01223532A (en) * | 1988-03-03 | 1989-09-06 | Pfu Ltd | Overflow/underflow processing circuit |
-
1988
- 1988-03-11 JP JP63058825A patent/JP2555135B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JPH01232422A (en) | 1989-09-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP3076046B2 (en) | Exception detection circuit | |
| JP2662196B2 (en) | Calculation result normalization method and apparatus | |
| JP3541066B2 (en) | Method and apparatus for performing division and square root calculations in a computer | |
| US4758972A (en) | Precision rounding in a floating point arithmetic unit | |
| US5010508A (en) | Prenormalization for a floating-point adder | |
| US6820107B1 (en) | Square root extraction circuit and floating-point square root extraction device | |
| KR20080055985A (en) | Selectable semi-precision floating-point processor | |
| JPH0776911B2 (en) | Floating point arithmetic unit | |
| JP4388543B2 (en) | 3-input floating-point adder / subtracter | |
| JP2002108606A (en) | Sticky bit generation circuit and multiplier | |
| JP2618374B2 (en) | Finding the position of the most significant digit | |
| US6175851B1 (en) | Fast adder/subtractor for signed floating point numbers | |
| KR100465371B1 (en) | apparatus and method for design of the floating point ALU performing addition and round operations in parallel | |
| JPH0343645B2 (en) | ||
| GB1579100A (en) | Digital arithmetic method and means | |
| US7016930B2 (en) | Apparatus and method for performing operations implemented by iterative execution of a recurrence equation | |
| KR920003493B1 (en) | Arithmetic circuit based on floating point notation | |
| JP2555135B2 (en) | Arithmetic circuit | |
| JPH0346024A (en) | Floating point computing element | |
| US6615228B1 (en) | Selection based rounding system and method for floating point operations | |
| US7003540B2 (en) | Floating point multiplier for delimited operands | |
| JPH04172526A (en) | floating point divider | |
| JP3693748B2 (en) | OR gate with controllable width | |
| JP2856792B2 (en) | Floating point arithmetic unit | |
| JP3124286B2 (en) | Floating point arithmetic unit |