JPS6097436A - Rounding control circuit - Google Patents

Rounding control circuit

Info

Publication number
JPS6097436A
JPS6097436A JP58205214A JP20521483A JPS6097436A JP S6097436 A JPS6097436 A JP S6097436A JP 58205214 A JP58205214 A JP 58205214A JP 20521483 A JP20521483 A JP 20521483A JP S6097436 A JPS6097436 A JP S6097436A
Authority
JP
Japan
Prior art keywords
mantissa
data
rounding
period
exponent
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
JP58205214A
Other languages
Japanese (ja)
Inventor
Toshiya Takahashi
利也 高橋
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.)
NEC Corp
Original Assignee
NEC Corp
Nippon Electric 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 NEC Corp, Nippon Electric Co Ltd filed Critical NEC Corp
Priority to JP58205214A priority Critical patent/JPS6097436A/en
Publication of JPS6097436A publication Critical patent/JPS6097436A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/483Computations with numbers represented by a non-linear combination of denominational numbers, e.g. rational numbers, logarithmic number system or floating-point numbers
    • G06F7/485Adding; Subtracting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/499Denomination or exception handling, e.g. rounding or overflow
    • G06F7/49942Significance control
    • G06F7/49947Rounding

Abstract

PURPOSE:To speed up rounding processing by detecting whether mantissa data is increased to output a carry before a mantissa is increased. CONSTITUTION:Mantissa part data, exponent part data, and a sign before rounding processing are stored in registers 101 and 105 and a sign bit 104 in a period phi2 of a period T1. A specific rounding mode is stored in a rounding mode register 103 until the period phi2 of the period T1. A round-up/round-off decision circuit 105 and a carry look-ahead circuit 107 operate in a period phi1 of the period T1. Further, the mantissa part data in the register 101 is passed through a mantissa data bus 108 and latched by a mantissa part adder 109 in the period phi1 of the period T1, and the exponent part data in the register 115 is latched by an exponent part adder 117 through an exponent data bus 116. The mantissa part adder 109 and exponent part adder 117 operate in the period phi2 of the period T2. At this time, the mantissa part adder 109 uses the decision signal 106 of the round-up/round-off decision circuit 105 as the least significant digit bit.

Description

【発明の詳細な説明】 本発明は浮動小数点演算における丸め処理回路に関する
ものである。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a rounding circuit in floating point arithmetic.

一般に浮動小数点データのフォーマットは第1図に示さ
れるようにフィールドを符号部、指数部、仮数部に分離
して表現される。浮動小数点データでの四則演算におい
ては、その演算過程で、決められた仮数部のデータ長を
越える場合が頻繁に起こる。例えば、浮動小数点の乗算
の場合には仮数部は掛は算となり、真の仮数の演詐結果
は表わし得る仮数データ長の2倍のデータ長となる。こ
の時、真の演算結果を表わし得る仮数データ長内に収め
ようとするのが丸め処理であり、この丸め処理を経て最
終演算結果を得ることになる。
Generally, the format of floating point data is expressed by separating fields into a sign part, an exponent part, and a mantissa part, as shown in FIG. In arithmetic operations on floating point data, the data length of the mantissa often exceeds the predetermined data length during the operation process. For example, in the case of floating-point multiplication, the mantissa part is multiplied by arithmetic, and the result of computation of the true mantissa has a data length twice the mantissa data length that can be represented. At this time, rounding is an attempt to fit the true calculation result within the mantissa data length that can represent it, and the final calculation result is obtained through this rounding process.

通常、浮動小数点データを扱う計算機においては演算過
程で、仮数部の最下位ビットよりあふれるデータを何ら
かの形で記憶しておく為の手段を有し、あふれ出たデー
タの内容及び丸めのモードにより、仮数部の途中結果を
切り上げるかもしくは切り捨てるかして最終演算結果を
得る。すなわち、丸め処理では、丸めモードと、あふれ
出たデータの内容とにより、仮数部の途中結果に1を加
えるか、そのままにするかに帰着する。
Normally, computers that handle floating-point data have some form of means to store data that overflows from the least significant bit of the mantissa during the calculation process, and depending on the content of the overflowing data and the rounding mode, The final operation result is obtained by rounding up or discarding the intermediate result of the mantissa. That is, in the rounding process, depending on the rounding mode and the contents of the overflowing data, it is decided whether to add 1 to the intermediate result of the mantissa part or leave it as is.

しかしながら、第2図に示されるように仮数部の途中結
果がオール「】」であるようなデータを丸める場合には
lを加えることによって、キャリーが発生し、仮数部は
オール「0」となる。これは仮数部の最上位ピットより
桁あふれを生じたことであり仮数データを「lOO・・
・・・・0」と補正し。
However, as shown in Figure 2, when rounding data where the intermediate result of the mantissa is all "]", by adding l, a carry occurs and the mantissa becomes all "0". . This is due to an overflow from the topmost pit of the mantissa, and the mantissa data is
...0" and corrected it.

ならびに指数のインクリメントが行なわれなければなら
な(・1、従って、上記の特殊な場合を考慮して丸め処
理を行なう必要がある。
and the exponent must be incremented by (.1).Therefore, it is necessary to perform rounding taking into account the above special case.

従来1、丸め処理は第3図に示されるフローチャートの
手順に従(・、仮数をインクリメントした後に、その結
果のキャリーを見て指数をインクリメントするかどうか
を決めていた。従って、大量の浮動小数点データを扱う
場合、丸め処理で仮数を1インクリメントした結果のキ
ャリーが「1」になるようなことは頻繁には起こらない
が、これを考慮して仮数を1インクリメントした後にキ
ャリーをチェックしなければならず、キャリーをチェ、
りするのに要する時間も丸め処理時間に含まれていた。
Conventionally, rounding processing followed the steps in the flowchart shown in Figure 3. When handling data, it does not often happen that the carry of the result of incrementing the mantissa by 1 due to rounding processing becomes "1", but it is necessary to take this into consideration and check the carry after incrementing the mantissa by 1. Don't check Carrie,
The rounding time also included the time required to complete the rounding process.

さらに、仮数を1インクリメントした結果、キャリーが
「1」となった場合には仮数及び指数の補正を行々う為
、丸め処理全体で約2倍の時間を要することになり、処
理速度を著しく低下させる欠点があった。
Furthermore, if the carry becomes "1" as a result of incrementing the mantissa by 1, the mantissa and exponent are corrected, so the entire rounding process takes about twice as much time, significantly reducing processing speed. There were drawbacks that made it worse.

本発明は仮数のインクリメントを行なう前に、仮数デー
タがインクリメントされてキャリーを出力するかどうか
を検知することにより上記欠点を解決し、丸め処理を高
速にできるようにした丸め制御回路を提供するものであ
る。
The present invention solves the above-mentioned drawbacks by detecting whether the mantissa data is incremented and outputs a carry before incrementing the mantissa, and provides a rounding control circuit that can speed up the rounding process. It is.

上記目的を達成する為に、本発明の丸め制御回路は、浮
動小数点データの下位桁あふれに対して切上げか切捨て
かを判定する判定回路と、仮数データが全ピット論理「
1」であることを検出する検出回路と、仮数部の加算器
と、指数部の加算器とを有し、浮動小数点データが前記
判定回路により切上げと判定され、かつ前記検出回路に
より仮数データが全ビット論理rlJであることが検出
された場合に指数データを前記指数部の加算器で1イン
クリメントしかつ仮数データの最上位ビ。
In order to achieve the above object, the rounding control circuit of the present invention includes a determination circuit that determines whether to round up or truncate when the lower digits overflow in floating point data, and a judgment circuit that determines whether to round up or truncate the lower digits of floating point data.
1, an adder for the mantissa part, and an adder for the exponent part. When it is detected that all bits are logic rlJ, the exponent data is incremented by 1 in the adder of the exponent part, and the most significant bit of the mantissa data is added.

トを強制的に論理「1」とすることを特徴とする。It is characterized by forcibly setting the output to logic "1".

以下に本発明の一実施例を図面に基いて説明する。第4
図は本発明の一実施例のブロック図である。第4図を参
照すると本発明の第1の実施例は丸め処理前の仮数デー
タを格納する24ビツト長のレジスタ101と、仮数デ
ータの下位あぶれを記憶する3ビツトの丸め用レジスタ
102と、丸めのモードを記憶する2ビツト長の丸めモ
ードレジスタ103と、仮数の符号を記憶する符号ピッ
ト104と、前記24ビツト長のレジスタ101の最下
位ピット、前記丸め用レジスタ10203ビツトデータ
、前記丸めモードレジスタ103の2ビツトデータ、及
び前記符号ピット10401ビツトデータを入力し仮数
データを切り上げるか切り捨てるかを判定する切上げ/
切捨て判定回路105と、前記24ビツト長のレジスタ
101の24ビツトデータ、及び切上げ/切捨て判定回
路105の出力である判定信号106を入力し仮数デー
タを丸めた場合に桁上りがあるかどうかを検出する桁上
げ先見回路]07と、前記24ビツト長のレジスタ10
1の24ビツトデータを仮数データバス108を介して
入力し、前記判定信号106によってインクリメントを
行なう24ビツト長の仮数部加算器109と、24ビツ
ト長定数「100・・・・・・0」を発生する定数発生
回路110と、前記桁上げ先見回路107の出力である
桁上げ信号111によって前記定数発生回路110の内
容を前記仮数データバス108に出力させるゲー)11
2と、前記桁上げ先見回路107の出力である桁上げ信
号111によって前記仮数部加算器109の演算結果を
前記仮数データバス108に出力させるゲー)113と
、丸め処Wlの仮数データを格納する24ビツト長のV
ラスタ114と、丸め処理前の指数データを格納する7
ビツト長のレジスタ115と、前記7ビツト長長のレジ
スタ115の7ビツトデータを指数データバス116を
介して入力し、前記桁上げ信号111によってインクリ
メントを行ガ57ビツト長の指数部加算器117と、丸
め処理後の指数データを格納する7ビツト長のレジスタ
118とを含む。次に第1の実施例の動作を第4図及び
第5図を参照して詳細に説明する1、第5図は第1の実
施例における丸め処理過程を示す簡単なタイミング図で
ある。
An embodiment of the present invention will be described below based on the drawings. Fourth
The figure is a block diagram of one embodiment of the present invention. Referring to FIG. 4, the first embodiment of the present invention includes a 24-bit long register 101 that stores mantissa data before rounding, a 3-bit rounding register 102 that stores the lower part of the mantissa data, and a rounding register 101 that stores the mantissa data before rounding. a 2-bit long rounding mode register 103 that stores the mode of the rounding, a code pit 104 that stores the sign of the mantissa, the lowest pit of the 24-bit long register 101, the rounding register 10203 bit data, the rounding mode register 103 2-bit data and the code pit 10401-bit data are input, and the rounding/up/down process determines whether to round up or discard the mantissa data.
The 24-bit data of the 24-bit length register 101 and the judgment signal 106 which is the output of the round-up/round-down judgment circuit 105 are input to the round-down judgment circuit 105, and it is detected whether there is a carry when the mantissa data is rounded. carry lookahead circuit] 07 and the 24-bit long register 10
24-bit data of 1 is input via the mantissa data bus 108, and a 24-bit length mantissa adder 109 is incremented by the judgment signal 106, and a 24-bit length constant "100...0" is input. A game in which the contents of the constant generation circuit 110 are output to the mantissa data bus 108 by the constant generation circuit 110 generated and the carry signal 111 which is the output of the carry look ahead circuit 107.
2, a game) 113 for outputting the calculation result of the mantissa part adder 109 to the mantissa data bus 108 by a carry signal 111 which is the output of the carry look ahead circuit 107, and a game) 113 for storing the mantissa data of the rounding unit Wl. 24 bit length V
7 to store raster 114 and exponent data before rounding
The 7-bit data of the bit length register 115 and the 7-bit length register 115 are inputted via the exponent data bus 116, and incremented by the carry signal 111. , and a 7-bit register 118 for storing rounded exponent data. Next, the operation of the first embodiment will be explained in detail with reference to FIGS. 4 and 5. FIGS. 1 and 5 are simple timing charts showing the rounding process in the first embodiment.

まずT1のダ2の期間に丸め処理前の仮数部データ、指
数部データ、符号がそれぞれVジメタ1011レジスク
115*n号ビット104に格納される。
First, during the period of T1, the mantissa data, the exponent data, and the sign before rounding are stored in the V dimeta 1011 register 115*n bit 104, respectively.

またT1の戸2期間までには周定の丸めモードが丸めモ
ードレジスタ103に格納され′C(・る。次にT1の
グ1の期間で切上げ/切捨て判定回路105と桁上げ先
見回路107とが動作する。つまり、切上げ/切捨て判
定回路105では丸めモードレジスタ103内のデータ
と丸め用レジスタ102内のデータと符号ビット104
かもの符号データとを入力し、浮動小数点データを丸め
るのに第1表に示される論理に従って、切り上げるか切
り捨てるかを判定し、切り上げであれば判定信号106
を「1」で出力し、切り捨てであれば判定信号106を
「0」で出力する。また桁上げ先見回路107ではレジ
スタ101内の24ビツト長板数データと前記判定16
号106とを入力し。
Also, by the second period of T1, the rounding mode is stored in the rounding mode register 103.Next, in the second period of T1, the rounding up/down judgment circuit 105 and the carry look ahead circuit 107 are activated. In other words, the rounding up/down determination circuit 105 uses the data in the rounding mode register 103, the data in the rounding register 102, and the sign bit 104.
When rounding the floating point data, it is determined whether to round up or down according to the logic shown in Table 1, and if it is rounded up, a determination signal 106 is sent.
is output as "1", and if it is truncated, the determination signal 106 is output as "0". Further, the carry look ahead circuit 107 uses the 24-bit long plate number data in the register 101 and the judgment 16.
Enter number 106.

丸め処理において、仮数の桁あぶれが発生するがどうか
を事前に検出する。すなわち、24ビツト長板数データ
がオール「1」でかっMR’+M−f−!t106が「
l」となる状]MTh検出する。桁あふれが発生すると
わかれは前記桁上は信号111を「1」で出力し、桁あ
ぶれが発生しな(・とゎかれは前記桁上げ信号111を
「Olて出力する。さらにT 1のOlの期間にお(・
又、仮数部はレジスフ101024ピツトテータが仮数
データバス108 f(通って仮数部加算器109洗ラ
ツチされ、指数部はレジスタl15の7ビツトデータが
指数データバス116を通って指数部データ、117に
2ツチされる。次にT2の1;2jlJj間で仮数1j
IX7Il# a l O9(!:指数敷部n器117
とが動作する。この時仮数部加算器109においては切
上け/切捨″′C判定+Pl路105から出力されてい
る判定信号106を最下位ビットのキャリー人カとじて
使う。すなわち、判定信号106が「l」であれは仮数
部加算器109は前タイミングで2ツチした仮数データ
を1インクリメントする。逆に、判定信号106が「0
」であれば仮数部加算器109は前タイミングでラッチ
した仮数データをインクリメントせずにそのままの形と
して残す。また指数部加算器117においては桁上げ先
見回路107から出力されている桁上げ信号111を最
下位ビットのキャリー人力として使う。すなわち、桁J
信曳11が「1士あれば、指数部加算器117は前タイ
ミングでラッチした指数データを1インクリメントする
。逆に桁上げ信号111が「0」であれば指数部加算器
117は前タイミングでラッチした指数データをインク
リメントせずにそのままの形として残す。最後に、T2
のダ1期間で仮数部はレジスタ114に丸め後の仮数デ
ータが転送され、指数部はレジスタ118に丸め後の指
数データが転送される。この時仮数部においては前タイ
ミングで出力された桁上げ信号111が「0」であれば
ゲート113がオンして、仮数部加算器109での演算
結果が仮数データバス108を介してレジスタ114に
転送される。逆に桁上げ信号111が「1」であればゲ
ート112がオンして、定数発生回路110内に格納さ
れている24ピツト長定数「100・・・・・・0」が
仮数データバス108を介してレジスタ114に転送さ
れる。また指数部においては指数部加算器117での演
算結果が指数データバス116を介してレジスタ118
に転送される。
To detect in advance whether a digit shift in a mantissa occurs in rounding processing. In other words, the 24-bit long plate number data is all "1" and is MR'+M-f-! t106 is “
MTh is detected. When an overflow occurs, the above-mentioned carry outputs the signal 111 as "1", and the overflow does not occur. During the period of (・
Also, for the mantissa part, the register l1024 bit data is passed through the mantissa data bus 108f (and is latched by the mantissa adder 109), and for the exponent part, the 7-bit data in register l15 is passed through the exponent data bus 116, and the exponent part data is sent to 117. Then, the mantissa is 1j between 1; 2jlJj of T2.
IX7Il# a l O9 (!: exponent base n unit 117
and works. At this time, the mantissa adder 109 uses the judgment signal 106 output from the round-up/truncation 'C judgment + Pl path 105 as the carry value of the least significant bit. In other words, the judgment signal 106 is ”, the mantissa adder 109 increments by 1 the mantissa data that was doubled at the previous timing. Conversely, the determination signal 106 is "0".
”, the mantissa adder 109 leaves the mantissa data latched at the previous timing as is without incrementing the mantissa data. Further, the exponent part adder 117 uses the carry signal 111 outputted from the carry look-ahead circuit 107 as a carry signal for the least significant bit. That is, digit J
If the signal 11 is "1", the exponent part adder 117 increments the exponent data latched at the previous timing by 1. Conversely, if the carry signal 111 is "0", the exponent part adder 117 increments the exponent data latched at the previous timing. Leave the latched index data as is without incrementing it. Finally, T2
In the da1 period, the mantissa data after rounding is transferred to the register 114 for the mantissa part, and the exponent data after rounding is transferred to the register 118 for the exponent part. At this time, in the mantissa part, if the carry signal 111 output at the previous timing is "0", the gate 113 is turned on, and the operation result in the mantissa part adder 109 is sent to the register 114 via the mantissa data bus 108. be transferred. Conversely, if the carry signal 111 is "1", the gate 112 is turned on and the 24-pit length constant "100...0" stored in the constant generation circuit 110 is transferred to the mantissa data bus 108. The data is transferred to the register 114 via the register 114. In addition, in the exponent part, the calculation result in the exponent part adder 117 is sent to the register 118 via the exponent data bus 116.
will be forwarded to.

従って、浮動小数点データを丸めて、所定のレジスタに
格納するのに2クロツクで済んでしま(・、丸め処理が
極めて高速に実現できる。
Therefore, it only takes two clocks to round floating-point data and store it in a predetermined register (--rounding processing can be realized at extremely high speed.

第6図は第4図における切上げ/切捨て判定回路105
を具体的に構成した場合の回路図の一例である。また第
1表は前記切上げ/切捨て判定回118105の働きを
論理的に表わしたものである。
FIG. 6 shows the round-up/round-down determination circuit 105 in FIG.
1 is an example of a circuit diagram of a specific configuration. Table 1 logically represents the function of the rounding up/down judgment circuit 118105.

切上げ/切捨て判定回路105は丸めモードを示すRM
IとRMOと、丸め用ビットG、R’、Sと丸め前板敷
部データの最下位ビットであるり。と仮数部データの符
号を示すBignとを入力し、第7図に示される論理図
に従い1判定信号106を出力するものである。丸めモ
ードにつ(・てはRMIとR,MOの値により最近似、
−〇〇大方向、+00大方向、0方向丸めの4種を規定
している。また丸め用の3ビ、トはそれぞれ重み付けが
されていて仮数データの最下位ビットD0の%がGでK
が几で、Sは仮数データとGとRより下位に桁あぶれを
生じたデータビットの論理和である。
Rounding up/rounding down determination circuit 105 selects RM indicating rounding mode.
I, RMO, rounding bits G, R', S, and the least significant bit of the rounding front board data. and Big indicating the sign of the mantissa data, and outputs a 1 determination signal 106 according to the logic diagram shown in FIG. Regarding the rounding mode (the closest approximation is determined by the values of RMI, R, MO,
Four types of rounding are defined: -〇〇 major direction, +00 major direction, and 0 direction rounding. Also, the 3 bits for rounding are weighted, and the percentage of the least significant bit D0 of the mantissa data is G and K.
is the logical sum of the mantissa data and the data bits with digits shifted below G and R.

第8図は第4図における桁上げ先見回路107を具体的
に構成した場合の回路図の一例である。
FIG. 8 is an example of a circuit diagram of a concrete configuration of the carry look-ahead circuit 107 in FIG. 4.

桁上げ先見回路107は、24ビツト長の仮数部データ
D、、、 D、、・・・・・・Do と前記切上げ/切
捨て判定回路105かも出力される判定信号106とを
入力し、桁上げ信号111を出力するものである。まず
第7図を参照して桁上げ先見回路107の構成を示す。
The carry look-ahead circuit 107 inputs the 24-bit length mantissa data D, , D, . . . It outputs a signal 111. First, the configuration of the carry look ahead circuit 107 will be shown with reference to FIG.

仮数部データD、、 、 D、2・・・・・・DI。Mantissa data D, , D, 2...DI.

Doがそれぞれインバータ素子を通して第23トランジ
スタ223.第22トランジスタ222゜・・・第1ト
ランジスタ201.第1トランジスタ201のゲートに
接続される。前記第23トランジスタ223〜第0トラ
ンジスタ200のドレイン側は仮数データオール「l」
検知線230で結ばれ、ソース側はそれぞれダ1をゲー
ト信号とするトランジスタを介してグランドに接続され
ている。プリチャージ用トランジスタ240はドレイン
側が電源に接続され、ソース側が前記仮数データオール
「1」検知線230に接続され、ゲートが02に接続さ
れている。また前記仮数データオール「1」検知線23
0はゲート信号が01の伝達トランジスタ250を通し
てインバータ素子2600Å力側に接続される。前記イ
ンバータ素子260の出力は2人力NOR素子270の
1人力となる。前記2人力NOR素子270のもう1つ
の入力線は判定信号106を反転したものである。
Do respectively pass through inverter elements to the 23rd transistors 223. 22nd transistor 222°...first transistor 201. Connected to the gate of the first transistor 201. The drain sides of the 23rd transistor 223 to the 0th transistor 200 have mantissa data all "l".
They are connected by a detection line 230, and their sources are connected to ground via transistors each using Da1 as a gate signal. The precharge transistor 240 has its drain side connected to the power supply, its source side connected to the mantissa data all "1" detection line 230, and its gate connected to 02. In addition, the mantissa data all “1” detection line 23
0 is connected to the power side of the inverter element 2600A through the transfer transistor 250 whose gate signal is 01. The output of the inverter element 260 is the output of a two-person NOR element 270. Another input line of the two-way NOR element 270 is an inverted version of the determination signal 106.

次に桁上げ先見回路107の動作を詳細に説明する。ま
ず、02が「1」の時に仮数データオール「1」検知線
230がプリチャージされて「1」となる。次にグ1が
「l」になった時に、仮数データD、、 、 D、・・
・Dl、 Doのうち少なくとも1ビツトが「0」であ
れば、そのビットに対応するトランジスタがオンして仮
数データオール「1」検知線230がディスチャージさ
れて「0」となり、前記インバータ素子260の出力が
「l」となる。
Next, the operation of the carry look ahead circuit 107 will be explained in detail. First, when 02 is "1", the mantissa data all "1" detection line 230 is precharged and becomes "1". Next, when G1 becomes "l", the mantissa data D, , , D,...
- If at least one bit among Dl and Do is "0", the transistor corresponding to that bit is turned on and the mantissa data all "1" detection line 230 is discharged to become "0", and the inverter element 260 The output becomes "l".

逆に仮数データI)ts t I)tt・・・Dl、 
Doの全ピットがrxJであれば第23トランジスタ2
23〜第0トランジスタ200がすべてオフし、仮数デ
ータオール「1」検知線230がチャージされたまま「
1」で、前記インバータ素子260の 出力が「0」と
なる。さらに前記インバータ素子260の出力が「0」
でかつ判定信号106が「1」の時にのみ2人力N0R
I子270の出力である桁上げ信号111が「1」とな
る、 このように本実施例によればどのような浮動小数点デー
タであってもソフトウェアでチェックするということは
せずに、簡単な回路構成により極めて高速に丸め処理を
実現することが可能である。
Conversely, mantissa data I) ts t I) tt...Dl,
If all pits of Do are rxJ, the 23rd transistor 2
The 23rd to 0th transistors 200 are all turned off, and the mantissa data all "1" detection line 230 remains charged.
1", the output of the inverter element 260 becomes "0". Furthermore, the output of the inverter element 260 is "0"
Two-man power N0R only when the judgment signal 106 is “1”
The carry signal 111, which is the output of the I-child 270, becomes "1".In this way, according to this embodiment, any kind of floating point data is not checked by software, but is simply Depending on the circuit configuration, it is possible to realize extremely high-speed rounding processing.

本実施例では仮数データ24ビツト長、指数データ7ビ
ツト長の浮動小数点データを取り上げたが、拡張された
フォーマットにお(・ても同様に構成すればよいことは
明らかである。
Although this embodiment deals with floating point data having a mantissa data length of 24 bits and an exponent data length of 7 bits, it is clear that the same structure may be applied to extended formats.

尚本実施例では24ビツト長定数「100・・・0」を
格納した定数発生回路110とグー)112とゲート1
13を用いて、桁上げ信号111が「1」の時にはゲー
ト113を閉じてゲート112を開けて定数「100・
・・0」を仮数データバス108に出力するようにして
いたが、グー)113を桁上げ信号111が「1」の時
にのみ加算器109からのデータの最上位ビットを論理
「1」にして24ビツトデータを仮数データバスlo8
に出力す、るように構成すれは、定数発生回路110と
ゲ−)112は不用となり、しかも第1寅施例と同等の
効果を得ることができる。
In this embodiment, a constant generating circuit 110 storing a 24-bit long constant "100...0", a gate 112, and a gate 1 are used.
13, when the carry signal 111 is "1", the gate 113 is closed and the gate 112 is opened, and the constant "100.
. . 0" was output to the mantissa data bus 108, but the most significant bit of the data from the adder 109 is set to logic "1" only when the carry signal 111 is "1". 24-bit data to mantissa data bus lo8
If the constant generating circuit 110 and the gate circuit 112 are configured to be outputted, the constant generating circuit 110 and the gate circuit 112 are unnecessary, and the same effect as the first embodiment can be obtained.

第9図は第1の実施例における定数発生回路110とゲ
ート112とゲート113の働きを他の方法で考えた場
合の回路である。仮数部加算器109024ビツト出力
結果its e ■22 t・・・■。を仮数データバ
ス108に出力する際のデータ出方制御回路113′は
第9図に示されるように仮数データバス108の最上位
線Duをドレイン側とし、桁上げ信号111の反転信号
をゲートするトランジスタ330と、仮数部加算器10
9024ビツト出力結果の最上位ビットであるXtSの
反転信号をゲートとし、ドレイン側を前記トランジスタ
330のンースとするトランジスタ323と、1110
反転化号をゲートとじドレイン側を仮数データバス10
8のり8.とするトランジスタ322と以下同様にIo
の反転信号をゲートとし、ドレイン側を仮数データバス
108のり。とするトランジスタ300とにまり構成さ
れる。ここで仮数部加算器109024ビツト出力結果
123sI12・・・■。
FIG. 9 shows a circuit in which the functions of the constant generating circuit 110, gates 112, and gates 113 in the first embodiment are considered in another way. Mantissa adder 109024-bit output result its e ■22 t...■. When outputting the signal to the mantissa data bus 108, the data output control circuit 113' sets the most significant line Du of the mantissa data bus 108 to the drain side, as shown in FIG. 9, and gates the inverted signal of the carry signal 111. Transistor 330 and mantissa adder 10
A transistor 323 whose gate is the inverted signal of XtS, which is the most significant bit of the 9024-bit output result, and whose drain side is the source of the transistor 330;
The inverted sign is gated and the drain side is connected to the mantissa data bus 10.
8 glue 8. Similarly, the transistor 322 and Io
The gate is the inverted signal of , and the drain side is the mantissa data bus 108 . The transistor 300 is configured to be integrated with the transistor 300 . Here, the mantissa adder 109024 bit output result 123sI12...■.

を仮数データバス108に出力する直前例は仮数データ
バス108はフ゛リチャージされて全データ線が「1」
になって(・るとする1、この時桁上げ信号111が「
1」である場合には、トランジスタ330がオフし、D
2.はチャージされたまま「]」となり、さらに仮数部
加算器109の24ビット出力結果11m、■2t・・
・工。はオール「0」とkることが予想され、トランジ
スタ322〜トランジスタ300がオンし1D2.〜1
〕。はディスチャージされてすべ゛(「0」となる。逆
に桁上げ信号111が「0」である場合にはトランジス
タ330はオンし、出力結呆ttstItt・・・工。
In the example just before outputting the data to the mantissa data bus 108, the mantissa data bus 108 is recharged and all data lines are set to "1".
1, at this time the carry signal 111 becomes "
1'', transistor 330 is turned off and D
2. remains charged and becomes "]", and furthermore, the 24-bit output result of the mantissa adder 109 is 11m, 2t...
・Eng. is expected to be all "0", transistors 322 to 300 are turned on, and 1D2. ~1
]. is discharged and becomes "0". Conversely, when the carry signal 111 is "0", the transistor 330 is turned on and the output voltage is ttstItt....

がそのまま仮数データバス108に出力されることは明
らかである。
It is clear that is output to the mantissa data bus 108 as is.

従って、データ出力制御回路113′を用(・でも同等
の効果は得られる、
Therefore, the same effect can be obtained by using the data output control circuit 113'.

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

第1図は浮動小数点データのフォーマット図である。第
2図(fま特殊な仮数データ時の丸め処理を示すフロー
図である。、第3図は従来の丸め処理の手順を示すフロ
ーチャートであるr第4図は本発明の第1の実施例にお
ける簡単なブロック図である。第5図は本発明の第1の
実施例におけるタイミング図である 第6図tit第4
図における切上げ/切捨て判定回路の一例を示す回路図
であZ)c第7図は第6図における切上げ/切捨て判定
回路の機能を表わす論理図である。、第8図&;IjJ
4図における桁上げ先見回路の一例を示す回路図である
。 第9図は第4図における定数発生回路110とグー)1
12とゲート113の働きを他の方法で実現した場合の
回路図である。 101・・・・・・レジスタ、102・・・・・・丸め
ビット。 103・・・・・・丸めモードレジズタ、104・・・
・・・符号ビット、105・・・・・・切上げ/切捨て
判定回路、106・・・・・・判定信号、107・・・
・・・桁上げ先見回路、108・・・・・・仮数データ
バス、109・・・・・・加算器、110・・・・・・
レジスタ、111・・・・・・桁上げ信号、112・・
・・・・ゲート、1 】 3・・・・・・ゲート、 1
14・・・レジスタ、】15・・・用レジスタ、116
・・・・・・指数データバス、117・・・・・・加算
器、118・・・・・・レジスタ、200〜223・旧
・・トランジスタ、230・・・・・・仮数データオー
ル「1」検知線、240・旧・・トランジスタ、250
・・・・・・トランジスタ、260・・・・・・インバ
ータ素子、270・・・・・・2人力NO几累子、30
0〜323・・・・・・トランジスタ、33o・・・ト
ランジスタ、113′・・・・・・データ出力制御回路
\、 ’5+’/’ 」旨波都 イ広峡喜p 陀 2 図 格3 図 第4図 1T11T21 第S 図 第6 ′図 /66 簗 8 図 砲 9 図
FIG. 1 is a format diagram of floating point data. Figure 2 is a flowchart showing the rounding process for special mantissa data, Figure 3 is a flowchart showing the procedure of conventional rounding process, and Figure 4 is the first embodiment of the present invention. FIG. 5 is a timing diagram in the first embodiment of the present invention. FIG.
7 is a circuit diagram showing an example of the round-up/round-down determination circuit shown in FIG. , FIG. 8 &;IjJ
FIG. 4 is a circuit diagram showing an example of the carry look ahead circuit in FIG. 4; FIG. 9 shows the constant generation circuit 110 in FIG.
12 is a circuit diagram in which the functions of gate 12 and gate 113 are realized by another method. 101...Register, 102...Rounding bit. 103...Rounding mode register, 104...
. . . Sign bit, 105 . . . Round up/down judgment circuit, 106 . . . Judgment signal, 107 .
... Carry look ahead circuit, 108... Mantissa data bus, 109... Adder, 110...
Register, 111...Carry signal, 112...
...Gate, 1] 3...Gate, 1
14...Register, ]15...Register, 116
...Exponent data bus, 117...Adder, 118...Register, 200-223 Old...Transistor, 230...Mantissa data all "1" ”Detection line, 240・Old...transistor, 250
...Transistor, 260...Inverter element, 270...2 human power NO Keiko, 30
0~323...Transistor, 33o...Transistor, 113'...Data output control circuit\, '5+'/' Fig.4 Fig.1T11T21 Fig.S Fig.6' Fig./66 Glans 8 Fig. Gun 9 Fig.

Claims (1)

【特許請求の範囲】[Claims] 浮動小数点演算の丸め制御回路において、仮数データの
下位桁あふれに対して切上げか切捨てかを判定する判定
回路と、仮数データが全ビット論理「1」であることを
検出する検出回路と、仮数部の加算器と、指数部の加算
器とを有し、浮動小数点データが前記判定回路により切
上げと判定され、かつ前記検出回路により仮数データが
全ビット論理「1」であることが検出された場合に指数
データを前記指数部の加算器でインクリメントし、かつ
仮数データの最上位ビットを強制的に論理・「l」とす
ることを特徴とする丸め制御回路。
In a rounding control circuit for floating point arithmetic, there is a determination circuit that determines whether to round up or truncate when the lower digits of mantissa data overflow, a detection circuit that detects that all bits of mantissa data are logic "1", and a mantissa part. and an exponent part adder, and when the floating point data is determined to be rounded up by the determination circuit, and the detection circuit detects that the mantissa data is all bits logical "1". A rounding control circuit characterized in that the exponent data is incremented by the adder of the exponent part, and the most significant bit of the mantissa data is forcibly set to logic "l".
JP58205214A 1983-11-01 1983-11-01 Rounding control circuit Pending JPS6097436A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP58205214A JPS6097436A (en) 1983-11-01 1983-11-01 Rounding control circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP58205214A JPS6097436A (en) 1983-11-01 1983-11-01 Rounding control circuit

Publications (1)

Publication Number Publication Date
JPS6097436A true JPS6097436A (en) 1985-05-31

Family

ID=16503290

Family Applications (1)

Application Number Title Priority Date Filing Date
JP58205214A Pending JPS6097436A (en) 1983-11-01 1983-11-01 Rounding control circuit

Country Status (1)

Country Link
JP (1) JPS6097436A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02201645A (en) * 1989-01-31 1990-08-09 Nec Corp Exception detecting circuit
US6314442B1 (en) 1998-06-19 2001-11-06 Mitsubishi Denki Kabushiki Kaisha Floating-point arithmetic unit which specifies a least significant bit to be incremented

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02201645A (en) * 1989-01-31 1990-08-09 Nec Corp Exception detecting circuit
US6314442B1 (en) 1998-06-19 2001-11-06 Mitsubishi Denki Kabushiki Kaisha Floating-point arithmetic unit which specifies a least significant bit to be incremented

Similar Documents

Publication Publication Date Title
JP2662196B2 (en) Calculation result normalization method and apparatus
US5272660A (en) Method and apparatus for performing integer and floating point division using a single SRT divider in a data processor
US6564239B2 (en) Computer method and apparatus for division and square root operations using signed digit
US6099158A (en) Apparatus and methods for execution of computer instructions
US5357237A (en) In a data processor a method and apparatus for performing a floating-point comparison operation
US5862065A (en) Method and circuit for fast generation of zero flag condition code in a microprocessor-based computer
US6301600B1 (en) Method and apparatus for dynamic partitionable saturating adder/subtractor
JP2618374B2 (en) Finding the position of the most significant digit
EP0530372B1 (en) Numerical expression converter and vector processor using the same
US5020016A (en) Circuit for detecting zero result of addition/subtraction by simultaneously processing each pair of corresponding bits of a pair of given numbers in parralel
JP3248743B2 (en) High-speed overflow / underflow limiter for signed adders
JPH0343645B2 (en)
US5337265A (en) Apparatus for executing add/sub operations between IEEE standard floating-point numbers
US7337202B2 (en) Shift-and-negate unit within a fused multiply-adder circuit
US5757687A (en) Method and apparatus for bounding alignment shifts to enable at-speed denormalized result generation in an FMAC
US5237525A (en) In a data processor an SRT divider having a negative divisor sticky detection circuit
JPH0619685A (en) Parallel multiplying circuit
JPS6097436A (en) Rounding control circuit
US7003540B2 (en) Floating point multiplier for delimited operands
EP0626638A1 (en) A one's complement adder and method of operation
US6301597B1 (en) Method and apparatus for saturation in an N-NARY adder/subtractor
Burgess et al. Efficient implementation of rounding units
US6272514B1 (en) Method and apparatus for interruption of carry propagation on partition boundaries
SU1019441A1 (en) Binary-decimal adder
JPS63208938A (en) Flag generating circuit