JPS63262723A - Arithmetic processing method - Google Patents

Arithmetic processing method

Info

Publication number
JPS63262723A
JPS63262723A JP62096548A JP9654887A JPS63262723A JP S63262723 A JPS63262723 A JP S63262723A JP 62096548 A JP62096548 A JP 62096548A JP 9654887 A JP9654887 A JP 9654887A JP S63262723 A JPS63262723 A JP S63262723A
Authority
JP
Japan
Prior art keywords
data
circuit
normalization
bits
input
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
JP62096548A
Other languages
Japanese (ja)
Inventor
Koichi Yoshida
孝一 吉田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP62096548A priority Critical patent/JPS63262723A/en
Publication of JPS63262723A publication Critical patent/JPS63262723A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To improve the operation speed by executing arithmetical operations by a data of a floating point format with respect to the number of bits of an input data, and executing the processing when its effective digit number becomes smaller than the effective digit number of the input data. CONSTITUTION:Data in input registers 2, 3 are calculated by a floating point arithmetical operation circuit 4 and its result is stored in a register 5, a prescribed bit portion of its output data is inputted to an AND circuit 6 and a NOR circuit 7, and its output is inputted to a normalization request flag register 9 through an OR circuit 8. Also, its output is inputted to AND circuits 11, 13, and a signal of a normalization permitting flag register 10 is inputted to the circuit 13 through the circuit 11 and a NOT circuit 12. In such a way, at the time of setting the register 10, the normalization processing is executed automatically, and at the time of resetting it, an interruption processing signal for urging the normalization processing is generated.

Description

【発明の詳細な説明】 産業上の利用分野 本発明は、浮動小数点演算過程において、演算のデータ
の有効桁数が入力データの有効桁数よりも少なくならな
いようにして演算精度を高めた演算処理方法に関するも
のである。
DETAILED DESCRIPTION OF THE INVENTION Field of Industrial Application The present invention relates to arithmetic processing that improves arithmetic accuracy by preventing the number of significant digits of calculation data from becoming less than the number of significant digits of input data in a floating point arithmetic process. It is about the method.

従来の技術 従来の浮動小数点演算処理方法においては、入力データ
に対し一演算を行い、データの精度を示す有効桁数が少
な(ならないようにその演算が終ればそのつど演算デー
タを正規化するか、あるいは演算を行うことによってデ
ータの精度が落ちる場合に対しても演算処理でデータの
変更を行わず1.ユーザーのプログラム等によりデータ
の持ち方に対し変更を加えていた。あるいは、データ精
度を無視して次の演算の実行に入っていた。
Conventional technology In conventional floating-point arithmetic processing methods, one operation is performed on input data, and the operation data is normalized each time the operation is completed to prevent the number of significant digits indicating the precision of the data from becoming small. Or, even if the accuracy of the data decreases due to calculation, the data is not changed by calculation processing. 1. The way the data is held is changed by the user's program etc. Or, the data accuracy is changed. It ignored it and started executing the next operation.

発明が解決しようとする問題点 一演算の終了毎にデータを正規化することは演算速度が
低下するという致命的な問題となる。またデータの正規
化を行わない場合にはデータの精度が低下するという致
命的な問題となる。
Problems to be Solved by the Invention: Normalizing data every time an operation is completed poses a fatal problem in that the operation speed decreases. Furthermore, if data is not normalized, the accuracy of the data decreases, which is a fatal problem.

たとえば具体的に、入力データを下記のA、BおよびC
の3データとして減算を行う場合の問題点を説明する。
For example, specifically input data as below A, B and C.
We will explain the problems when subtracting the three data.

データ形式としては、指数部が・℃ビットで仮数部が1
0ビツトのデータで共に2の補数表示をとるものとする
As for the data format, the exponent part is ・℃ bit and the mantissa part is 1.
It is assumed that both data are 0-bit data and are expressed in two's complement.

A=0111000000X2010000B=011
0000000X2010.000C=0101011
100X2”目00D=A−Bを実行すると下記のデー
タとなる。
A=0111000000X2010000B=011
0000000X2010.000C=0101011
Executing 100x2'' 00D=A-B results in the following data.

D=0001000000x2010000次に、E=
D−Cの実行する時、指数部の桁合せを行うためにCの
データに対し桁合せを行い、このデータをC1とすると CI=OOOOO10101X2”””となり、E=D
−Cを演算すると E=OOOO101011X2010000となる。一
方、八−Bを演算実行して得るDの値に対して正規化を
行い、この値をり、とするとDI=010000000
0X2001110となる。モしてE+=D+  Cの
演算を行うため、Cのデータに対し桁合せを行いC2と
するとC2=OO01010111X2”目10となる
。モしてE、=D、−C2を実行するとE+=OO10
101001X2’旧目0となる。EおよびE!に対し
て正規化を行い1.その値をE(正)およびE+(正〉
とすると、E(正)  =0101011000X2G
O口OIE+(正) =0101010010X200
+101となりE(正)とE+(正)の値が異なってい
るのがわかる。これはA−Bの演算を実行した時にデー
タの有効桁が減少したにもかかわらず、そのデータDを
正規化せずに次の演算D−Cを行うためにCのデータの
桁合せを行い演算を実行したため、桁合せしたCのデー
タの有効桁数が足りな(なって演算D−Cの値のEの値
が正確でなくなったためである。
D=0001000000x2010000 Then E=
When executing D-C, digit alignment is performed on the data in C to align the digits of the exponent part, and if this data is set as C1, CI=OOOOOO10101X2""", and E=D
When −C is calculated, E=OOOO101011X2010000. On the other hand, if we normalize the value of D obtained by executing 8-B and let this value be , then DI = 010000000
It becomes 0X2001110. In order to perform the calculation E+=D+C, we perform the digit alignment on the data of C and set it as C2, which becomes C2=OO01010111X2"th 10.Moreover, when we execute E,=D,-C2, E+=OO10
101001X2' becomes old 0. E and E! Perform normalization for 1. The values are E (positive) and E+ (positive)
Then, E (correct) =0101011000X2G
O mouth OIE+ (positive) =0101010010X200
It becomes +101, and it can be seen that the values of E (positive) and E+ (positive) are different. This is because even though the effective digits of the data decreased when the operation A-B was executed, the digits of the data C were aligned in order to perform the next operation D-C without normalizing the data D. Because the calculation was executed, the number of effective digits in the data of C which was digit-aligned was insufficient (this is because the value of E in the value of calculation D-C is no longer accurate).

またこのようなデータの持ち方をせずに、入力データA
、BおよびCに対し、内部データA3゜B、およびC1
の精度を高(するためにたとえば、指数部が8ビツトで
仮数部が16ビツトのデータ形式をとってDll=A、
−B、、E、=D、−Caの演算を正規化せずに行うと
、内部データAa、B、およびC3の値および演算結果
のD3とE、の値はそれぞれ下記のようになる。
Also, without holding data like this, input data A
, B and C, internal data A3゜B and C1
For example, in order to increase the precision of
If the calculations -B, ,E,=D, -Ca are performed without normalization, the values of the internal data Aa, B, and C3 and the values of the calculation results D3 and E are as follows.

A a = 0111000000000000 X 
20G010000B a =ouooooooooo
oooo X 200016000CI =01010
11100000000 X 20000+ 100D
 2 = 0001000000000000 X 2
00010000E * = 00001010100
10000 x 2 ’Go 1000G次にこの演算
の各過程で正規化を行って演算するとA、−B、の演算
により得られるり、の値に対して正規化したD 、Iの
値は Da+ =0100000000000000 X 2
”00””となりD a Iに対しCQを桁合せしCa
2とするとC12= 000101011100000
0 X 2 ””目IOとなる。モしてEal=I)a
l  Ca2の演算を行うとEa+ =0010101
001000000X 20000”10となるElI
およびEatに対して正規化を行い、その値をEa(正
)およびE−+ (正)とするとE、(正)=OIO1
010010000000x 200”’ ”IEa+
(正)=0101010010000000x  20
00’1101となり、この場合、演算の過程で正規化
を行わなかったE、(正)の値と正規化を行ったE9+
(正)の値とは等しくなり、E、(正)の値は正しく保
存される。この場合、入力データの仮数部のビット数よ
り内部データの仮数部のビット数を6ビツト余分に持つ
ことにより演算の精度を保証しているが、D、−C,の
演算を行った結果のE3を見ると仮数部の有効桁が3ビ
ット落ちていることがわかる。このデータ形式で内部デ
ータを持つことにより入力データの精度に対し6ビツト
の余裕はあるが、このデータE、を用いて次の数値演算
を行うと入力データの精度を保証できなくなる。
A a = 0111000000000000 X
20G010000B a =ouooooooooo
oooo X 200016000CI =01010
11100000000 x 20000+ 100D
2 = 0001000000000000 X 2
00010000E * = 00001010100
10000 x 2 'Go 1000G Next, if we perform normalization in each step of this calculation and calculate it, we can obtain it by calculating A, -B, and the value of D and I normalized to the value of is Da+ = 0100000000000000 X 2
“00””, aligning CQ with D a I and Ca
2, C12= 000101011100000
0 x 2 ""th IO. Mo and Eal=I)a
When calculating l Ca2, Ea+ =0010101
001000000X 20000”10 ElI
Normalize and Eat, and let the values be Ea (positive) and E-+ (positive), then E, (positive) = OIO1
010010000000x 200"'"IEa+
(Correct)=0101010010000000x 20
00'1101, and in this case, E, which was not normalized during the calculation process, (positive) value, and E9+, which was normalized.
(positive) values are equal, and E, (positive) values are correctly stored. In this case, the precision of the operation is guaranteed by having 6 bits more in the mantissa part of the internal data than the number of bits in the mantissa part of the input data, but the result of the operation of D, -C, Looking at E3, we can see that the significant digits of the mantissa have dropped by 3 bits. By having internal data in this data format, there is a margin of 6 bits for the accuracy of the input data, but if this data E is used to perform the next numerical operation, the accuracy of the input data cannot be guaranteed.

以上に示したように正規化せずに演算を行った場合間違
った値を示したりまた、入力データのビット数以上のビ
ット数を持つ内部データ形式を用いる場合にも、正規化
しなければいずれは有効桁数が足りなくなって間違った
値を示すようになる問題があった。
As shown above, if an operation is performed without normalization, it may give an incorrect value, or if an internal data format with a bit number greater than the number of bits of the input data is used, if it is not normalized, the result will be There was a problem where the number of significant digits was insufficient, causing incorrect values to be displayed.

問題点を解決するための手段 本発明の演算処理方法は入力データのビット数に対して
演算で使用する演算データのビット数を多くした浮動小
数点形式のデータで四則演算を行い、演算過程で前記演
算データの有効桁数が前記入力データの有効桁数より少
な(なる場合に、自動的に演算データの正規化処理を行
うか、もしくは演算システムに対して正規化処理をうな
がす割り込み処理を行うものである。
Means for Solving the Problems The arithmetic processing method of the present invention performs four arithmetic operations using floating point format data in which the number of bits of the operation data used in the operation is greater than the number of bits of the input data. If the number of valid digits of the calculation data is less than the number of valid digits of the input data, the calculation data is automatically normalized or an interrupt process is performed to prompt the calculation system to perform the normalization process. It is.

作用 本発明の演算処理方法によれば、演算データの有効桁数
が入力データの有効桁数より少な(なる場合のみ、正規
化処理を行うため、演算の実行を高速で行うことができ
るとともに、演算精度を落さないで演算することができ
る。
According to the arithmetic processing method of the present invention, the normalization process is performed only when the number of significant digits of the arithmetic data is less than the number of significant digits of the input data, so the arithmetic operation can be executed at high speed. Calculations can be performed without compromising accuracy.

実施例 本発明の演算処理方法の一実施例を第1図に示すブロッ
ク図を参照して説明する。
Embodiment An embodiment of the arithmetic processing method of the present invention will be described with reference to the block diagram shown in FIG.

指数部が6ビツトで仮数部が10ビツトのデータ形式の
入力データ1を指数部が8ビツトで仮数部が16ビツト
のデータ形式の内部データに変換して入力レジスタ2と
3に記憶する。なお、データは全て2の補数表示とする
Input data 1 having a data format of 6 bits in the exponent part and 10 bits in the mantissa part is converted into internal data in a data format of 8 bits in the exponent part and 16 bits in the mantissa part, and is stored in input registers 2 and 3. Note that all data are expressed in two's complement numbers.

次に、入力レジスタ2と3に格納されたデータを取り出
し、浮動小数点四則演算回路4で演算してその結果のデ
ータを演算結果格納レジスタ5に記憶する。そして演算
結果格納レジスタ5の出力データの上位6ビツト分をA
ND回路6およびNOR回路7に入力し、これらのAN
D回路6およびNOR回路7の出力をOR回路8に入力
する。このOR回路8の出力を正規化要求フラグレジス
タ9に入力し、正規化処理を自動で実行するかどうかを
決定する正規化許可フラグレジスタ10と正規化要求フ
ラグレジスタ9の出力をAND回路9に入力して正規化
処理の実行を行う制御信号を作成する。一方、正規化許
可フラグレジスタ10の信号の反転信号を作成するNO
T回路12の出力と正規化要求フラグレジスタ9の出力
をAND回路13に入力し、システムに対し正規化処理
のための割込み信号を作成する。
Next, the data stored in the input registers 2 and 3 is taken out, and the floating point arithmetic operation circuit 4 performs an operation, and the resulting data is stored in the operation result storage register 5. Then, the upper 6 bits of the output data of the operation result storage register 5 are
input to the ND circuit 6 and NOR circuit 7, and these AN
The outputs of the D circuit 6 and the NOR circuit 7 are input to the OR circuit 8. The output of this OR circuit 8 is input to the normalization request flag register 9, and the outputs of the normalization permission flag register 10 and the normalization request flag register 9, which determine whether or not to automatically execute normalization processing, are input to the AND circuit 9. Create a control signal to input and execute the normalization process. On the other hand, NO creates an inverted signal of the signal of the normalization permission flag register 10.
The output of the T circuit 12 and the output of the normalization request flag register 9 are input to an AND circuit 13, and an interrupt signal for normalization processing is generated for the system.

演算結果格納レジスタ5の出力データの上位6ビツトが
全てOあるいは全て1になった時に、OR回路8に出力
信号が現われ、この出力信号により正規化要求フラグレ
ジスタ9が七′ツトされる。この時の出力データの上位
6ビツトはサインビットになっているためデータ精度は
11ビツトにまで落ちているが、入力時のデータ精度の
10ビツトは保証されている。
When the upper six bits of the output data of the operation result storage register 5 are all O or all 1, an output signal appears in the OR circuit 8, and the normalization request flag register 9 is set to 7' by this output signal. Since the upper 6 bits of the output data at this time are sign bits, the data accuracy is reduced to 11 bits, but the 10 bits of data accuracy at the time of input is guaranteed.

ここで自動的に正規化を行うかどうかは、正規化許可フ
ラグレジスタ10のセットあるいはリセットの状態によ
り決まる。ここで正規化許可フラグレジスタ10のセッ
トあるいはリセットの状態はユーザープログラムにより
選択可能なものである。正規化許可フラグレジスタ10
がセットされている場合のみ自動的に正規化処理を行う
。正規化許可フラグレジスタ10がリセットされている
時には、出力データに対し何の処理も行なわないか、演
算システムに対し正規化処理をうながす割込み処理信号
を作成する。
Whether or not normalization is performed automatically here is determined by the set or reset state of the normalization permission flag register 10. Here, the setting or reset state of the normalization permission flag register 10 can be selected by the user program. Normalization permission flag register 10
Automatically performs normalization processing only when is set. When the normalization permission flag register 10 is reset, no processing is performed on the output data, or an interrupt processing signal is generated to prompt the arithmetic system to perform normalization processing.

このように入力データに対し6ビツト余分のビット長を
持つ内部データと本発明の演算処理方法により、1回の
数値演算で1ビツト分の有効桁を失うような演算におい
て、5回の演算を正規化処理をせずに実行できる。また
正規化を行う場合にも仮数部に対し左へ5ビツトシフト
し、指数部に対しては5桁分の値を増減すればよ(、シ
フト量等を検出するための処理を必要としない。このた
め高速に出力データを正規化することができ、また演算
の精度も落とすこともない。
In this way, by using the internal data that has an extra bit length of 6 bits compared to the input data and the arithmetic processing method of the present invention, it is possible to perform five operations in an operation where one significant digit is lost in one numerical operation. It can be executed without normalization processing. Also, when performing normalization, the mantissa part is shifted 5 bits to the left, and the exponent part is increased or decreased by 5 digits (there is no need for processing to detect the amount of shift, etc.). Therefore, output data can be normalized at high speed, and the accuracy of calculations is not degraded.

なお、この実施例でのデータの持ち方は0.5≦1仮数
部1<1 0≦1指数部1<128 までの表現を用いることにより四則演算結果の出力デー
タの仮数部が !入力データ仮数部1〉1出力デ一タ仮数部1となる演
算について述べている。
In addition, in this example, the way of holding data is as follows: 0.5≦1 mantissa part 1<1 0≦1 exponent part 1<128 By using the following expressions, the mantissa part of the output data of the four arithmetic operations can be changed! An operation in which input data mantissa part 1>1 output data mantissa part 1 is described.

1人カデータ仮数部1<1出力デ一タ仮数部1となる演
算に対しても対応するためには、内部データ形式におい
て、最上位の桁のビット(MSB)に対してもビット長
を拡張することにより同様の処理が実現できる。
In order to support operations where 1 person data mantissa part 1 < 1 output data mantissa part 1, the bit length is also extended to the most significant bit (MSB) in the internal data format. Similar processing can be achieved by doing so.

なお、内部データ形式のビット数をより多くすることに
より正規化処理を行う回数を減することができ、演算の
高速化を図ることも可能である。
Note that by increasing the number of bits in the internal data format, the number of times the normalization process is performed can be reduced, and it is also possible to speed up the calculation.

発明の効果 本発明の演算処理方法によれば、演算データの有効桁数
が入力データの有効桁数より少なくなる場合のみ、正規
化処理を行うため、演算の実行を高速で行うことができ
るとともに、演算精度を落さないで演算することができ
、経済的効果が大きい。
Effects of the Invention According to the arithmetic processing method of the present invention, normalization processing is performed only when the number of significant digits of the arithmetic data is less than the number of significant digits of the input data. , it is possible to perform calculations without compromising calculation accuracy and has great economical effects.

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

第1図は本発明の演算処理方法の一実施例を示すブロッ
ク図である。 1・・・・・・入力データ、2,3・・・・・・入力レ
ジスタ、4・・・・・・浮動小数点四則演算回路、5・
・・・・・演算結果格納レジスタ、6,11.13・・
・・・・AND回路、7・・・・・・NOR回路、8・
・・・・・OR回路、9・・・・・・正規化要求フラグ
レジスタ、10・・・・・・正規化許可フラグレジスタ
、12・・・・・・NOT回路。 代理人の氏名 弁理士 中尾敏男 ほか1名第 メ 5
FIG. 1 is a block diagram showing an embodiment of the arithmetic processing method of the present invention. 1... Input data, 2, 3... Input register, 4... Floating point four arithmetic circuit, 5.
...Arithmetic result storage register, 6, 11.13...
...AND circuit, 7...NOR circuit, 8.
. . . OR circuit, 9 . . . Normalization request flag register, 10 . . . Normalization permission flag register, 12 . . . NOT circuit. Name of agent Patent attorney Toshio Nakao and 1 other person 5

Claims (1)

【特許請求の範囲】[Claims] 入力データのビット数に対して演算で使用する演算デー
タのビット数を多くした浮動小数点形式のデータで四則
演算を行い、演算過程で前記演算データの有効桁数が前
記入力データの有効桁数より少なくなる場合に、自動的
に演算データの正規化処理を行うか、もしくは演算シス
テムに対して正規化処理をうながす割り込み処理を行う
ことを特徴とする演算処理方法。
Four arithmetic operations are performed using floating point format data in which the number of bits of the calculation data used in the calculation is greater than the number of bits of the input data, and during the calculation process, the number of significant digits of the calculation data is greater than the number of significant digits of the input data. 1. An arithmetic processing method characterized by automatically normalizing the arithmetic data or performing an interrupt process to prompt the arithmetic system to perform the normalization process when the number of arithmetic data decreases.
JP62096548A 1987-04-20 1987-04-20 Arithmetic processing method Pending JPS63262723A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62096548A JPS63262723A (en) 1987-04-20 1987-04-20 Arithmetic processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62096548A JPS63262723A (en) 1987-04-20 1987-04-20 Arithmetic processing method

Publications (1)

Publication Number Publication Date
JPS63262723A true JPS63262723A (en) 1988-10-31

Family

ID=14168143

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62096548A Pending JPS63262723A (en) 1987-04-20 1987-04-20 Arithmetic processing method

Country Status (1)

Country Link
JP (1) JPS63262723A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105972996A (en) * 2016-07-23 2016-09-28 芜湖长启炉业有限公司 Low-resistance grain drying system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59226944A (en) * 1983-06-09 1984-12-20 Fujitsu Ltd Floating point data addition/subtraction method
JPS6097434A (en) * 1983-11-02 1985-05-31 Hitachi Ltd Floating point arithmetic processor

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59226944A (en) * 1983-06-09 1984-12-20 Fujitsu Ltd Floating point data addition/subtraction method
JPS6097434A (en) * 1983-11-02 1985-05-31 Hitachi Ltd Floating point arithmetic processor

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105972996A (en) * 2016-07-23 2016-09-28 芜湖长启炉业有限公司 Low-resistance grain drying system

Similar Documents

Publication Publication Date Title
EP0450802B1 (en) Floating point arithmetic unit
JPH0644225B2 (en) Floating point rounding normalization circuit
JPH02294819A (en) Floating point arithmetic processor
JP3418460B2 (en) Double precision division circuit and method
KR950006580B1 (en) Division calculator
JPS61237133A (en) Arithmetic circuit
JPH0228830A (en) Integer number dividing circuit
JPS62191926A (en) Arithmetic unit
US7752250B2 (en) Rounding floating point division results
JPS6227412B2 (en)
JPS63262723A (en) Arithmetic processing method
JPH0380324A (en) Central processing unit
JPH1091395A (en) Processor
US7467178B2 (en) Dual mode arithmetic saturation processing
CN118819465B (en) Floating-point data floating-point multiplication and addition operation method, device, electronic device and storage medium
JPS62128331A (en) Information processor
JP4109181B2 (en) Logic circuit, and floating-point arithmetic circuit and microprocessor using the same
JPS60167030A (en) System and circuit for shift flag generation
JPS59160235A (en) Dividing device
JPH0330170B2 (en)
JPH0357019A (en) Floating-point data adding and subtracting circuit
JP3522387B2 (en) Pipeline arithmetic unit
JP2508269B2 (en) Square root calculator
JPS5940665Y2 (en) Power calculation control device
JPH01195532A (en) Microprocessor