JPS60191330A - Security system of data accuracy for operation - Google Patents

Security system of data accuracy for operation

Info

Publication number
JPS60191330A
JPS60191330A JP59045450A JP4545084A JPS60191330A JP S60191330 A JPS60191330 A JP S60191330A JP 59045450 A JP59045450 A JP 59045450A JP 4545084 A JP4545084 A JP 4545084A JP S60191330 A JPS60191330 A JP S60191330A
Authority
JP
Japan
Prior art keywords
data
length
mantissa
signal line
register
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
JP59045450A
Other languages
Japanese (ja)
Inventor
Chisato Konno
金野 千里
Shunichi Torii
俊一 鳥居
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP59045450A priority Critical patent/JPS60191330A/en
Publication of JPS60191330A publication Critical patent/JPS60191330A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To obtain the information on data comparison for each operation and to check the security of accuracy for the final result, by recording the minimum length of a mantissa part with a series of operations where plural expressions are used for variation of the length of an exponent part through fixture of data length. CONSTITUTION:The input data 1 is supplied to each operator 3 within a computer, and the output data 2 of the operator 3 is delivered to an output line. At the same time, the data 2 is supplied to detection circuit 4 for length of a mantissa part. The circuit 4 consists of a shift register, etc. and detects the number of mantissa parts of the data 2. The number of said mantissa parts is supplied to a comparator 6 for comparison with the signal applied from a register 5 through a signal line 8. Then the minimum length of the mantissa part is recorded in a series of operations, and the information on data comparison is obtained for each operation for check of accuracy security with the final result.

Description

【発明の詳細な説明】 〔発明の利用分野〕 本発明は計算機内で行なわれる演算の精度の保証に係り
、特に相対精度の算定に好適な情報の抽出に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Application of the Invention] The present invention relates to guaranteeing the accuracy of calculations performed within a computer, and particularly to extracting information suitable for calculating relative accuracy.

〔発明の背景〕[Background of the invention]

従来の固定小数点演算、あるいは浮動小数点演算におい
ては、アンダー(もしくはオーバー)フローが発生した
場合、割り込みによってプログラム側に状況の発生を知
らせてきた。ところがこうした方式では、アンダーフロ
ー、オーツ(−フローが頻発し、その度に処理が中断せ
ざるを得なかった。これらを解決するための数値表現法
がいくつか考案され、実質的にはアンダーフロー、オー
ツ(−フローが生じないことが確証されてきた(例えば
、情報処理学会論文誌、第24巻第2号参照)。
In conventional fixed-point or floating-point arithmetic, when an underflow (or overflow) occurs, an interrupt is used to notify the program of the situation. However, with these methods, underflows and autoflows (-flows) occur frequently, and the processing has to be interrupted each time. Several numerical expression methods have been devised to solve these problems. , oats (-) has been confirmed to not occur (see, for example, Transactions of the Information Processing Society of Japan, Vol. 24, No. 2).

ところが、こうした数値表現は、固定長のデータの内部
を可変長の指数部(したがって仮数部も可変)を用いて
実現されている。したがって、一連の演算フローの最終
結果として得られるデータの信頼性が問題となる。
However, such numerical representation is realized by using a variable-length exponent part (therefore, the mantissa part is also variable) inside fixed-length data. Therefore, the reliability of data obtained as the final result of a series of calculation flows becomes a problem.

〔発明の目的〕[Purpose of the invention]

本発明の目的は、データ長固定でかつ指数部長可変の数
値表現において、一連の演算の結果として得られたデー
タの精度情@奢提供することにらるO 〔発明の概要〕 ユーザにとって従来はブラックボックスとして用いられ
てきた演算器において、オーバーフロー、アンダーフロ
ーが実質的に起こらない数値表現法を用いる場合、一連
の演算経過に現われる数値の精度情報を保存し、かつユ
ーザの要求に応じてその情報の読み出しを可能とするこ
とにより、演算結果の信頼性を保証しつる。
An object of the present invention is to provide information on the accuracy of data obtained as a result of a series of operations in a numerical expression with a fixed data length and a variable exponent length. In arithmetic units that have been used as black boxes, when using a numerical expression method that virtually does not cause overflow or underflow, the precision information of the numerical values that appear in the course of a series of calculations is stored, and the information can be changed according to the user's request. By making it possible to read information, the reliability of calculation results is guaranteed.

〔発明の実施例〕[Embodiments of the invention]

以下、本発明の一実施例を説明する。 An embodiment of the present invention will be described below.

まず初めに、本発明の適用対象となる数値表現の一例に
ついて述べる(情報処理学会論文誌、第24巻第2号参
照)。
First, an example of numerical expression to which the present invention is applied will be described (see Journal of the Information Processing Society of Japan, Vol. 24, No. 2).

表そうとする数をXとする。X=2°×fと、二つの数
eとfで表現する。ここで値を一意的にするため、e、
fに次の条件を設ける。まずX〉0の場合を先に考える
Let X be the number to represent. It is expressed as X=2°×f and two numbers e and f. Here, to make the value unique, e,
The following conditions are set for f. First, consider the case where X〉0.

e:整数 1くf<2 この時、計算機内の表現法を第1図に示すが、この点に
関する限り多くの浮動小数点表現と同じもので、符号部
S(: Sign bit )、指数部E(: Bxp
onent part )、仮数部F (: prac
tionpart)より成る。仮数fの値の2進数表現
を次のとおりとする。f=l、flf、・・・f、・・
・。この時、f、 f2・・・f、・・・を仮数部Fの
ビットバタンとする。
e: Integer 1 × f < 2 At this time, the representation method in the computer is shown in Figure 1, but as far as this point is concerned, it is the same as many floating point representations, and the sign part S (: Sign bit ), the exponent part E (: Bxp
onent part ), mantissa part F (: prac
tionpart). Let the binary representation of the value of the mantissa f be as follows. f=l, flf,...f,...
・. At this time, let f, f2...f,... be the bit bumps of the mantissa part F.

指数部Eを可変長とし、データ・フィールドの長さに自
己記述能力をもたせる次の方法を用いる。
The following method is used in which the exponent part E has a variable length and the length of the data field has self-descriptive ability.

なお以後二重指数表現を多用するので、印刷−Fの誤ま
りの発生を防ぐため、次の表現を用いることにする。
Since the double exponential expression will be frequently used hereinafter, the following expression will be used to prevent the occurrence of printing-F errors.

2″c)exp(n) まずe〉0のとき、eがちょうど2進m DO)桁で表
わせる範囲は次のとおりである。
2″c) exp(n) First, when e>0, the range where e can be represented by exactly binary mDO) digits is as follows.

2=’<e <2” −1 Xの範囲で表わせば、1くf<2より eXp(2′″−’ )<x<exp (2’″)であ
る。eく0のときは対称性を考慮して、exp(−2’
″) <x<exp (−2−’ )に対して、 −2” <8<−2’″−1 となり、補数表現を用いる。
If expressed in the range of 2 = '< e <2'' - 1 X, then e Considering the gender, exp(-2'
'') <x<exp (-2-'), -2"<8<-2'"-1, and complement representation is used.

eがちょうど2進m桁で表わされる場合の整数eの内部
表現は次のとおりとなる。
The internal representation of the integer e when e is represented by exactly m binary digits is as follows.

e〉0のとき、00 ・・・01 e、、−s ”・e
! ele〈0のとき、11・・・10eゆ−1・・・
e2e。
When e>0, 00...01 e,, -s ''・e
! When ele〈0, 11...10eyu-1...
e2e.

ここで定めたmとeゆ−0・・・e2e、とから、mの
識別ピット列を左に追加して指数部を次のとおりにeく
0のとき、0・・・01 e、、−、・・・e、 e。
From m and eyu-0...e2e defined here, add the identification pit row of m to the left and make the exponent part as follows.When it is 0, 0...01 e,, -,...e, e.

x (Qの時も同様に、指数部、仮数部が定義される。x (Similarly, the exponent and mantissa parts are defined for Q.

さて、第2図は本発明の構成例である。Now, FIG. 2 shows an example of the configuration of the present invention.

3は計算機内に存在する各演算器である。1は演算器へ
の入力データの流れる信号線であシ、2は演算器からの
出力データの流れる信号線で、このデータは出力される
と同時に仮数部長検出回路4にも与えられる。この仮数
部長検出回路4は主としてシフトレジスタ等によって構
成され、信号線2を介して与えられたデータの仮数部長
を検出する回路である。
3 is each arithmetic unit existing in the computer. 1 is a signal line through which input data to the arithmetic unit flows, and 2 is a signal line through which output data from the arithmetic unit flows, and this data is also provided to the mantissa length detection circuit 4 at the same time as it is output. This mantissa length detection circuit 4 is mainly composed of a shift register or the like, and is a circuit for detecting the mantissa length of data applied via the signal line 2.

本数値表現においては、上で述べたように、仮数部長の
算定が0または1の連のとぎれ目を検出することによっ
て行なわれ、これはシフトレジスタとカウンタ等によっ
て容易に構成することができる。第3図にその構成例を
示す。18はシフトレジスタ、19はカラ/り、20は
排他的論理和(XOFL)をとる素子である。信号m1
5には前記信号線2により与えられたデータの第1ビツ
トが、信号線16にはシフトレジスタから出力される第
nピットが順次与えられ、その排他的論理和の結果が、
信号線17によってカウンタ19に与えられる。カウン
タ19は、信号線17から初めて0が与えられる迄、カ
ウントアツプする。これにより指数部長が、従って(全
体は固定長であるので)仮数部長も判明する。
In this numerical representation, as described above, the calculation of the mantissa length is performed by detecting a break in a run of 0 or 1, and this can be easily constructed using a shift register, a counter, etc. FIG. 3 shows an example of its configuration. 18 is a shift register, 19 is a color register, and 20 is an element that performs an exclusive OR (XOFL). signal m1
The first bit of the data given by the signal line 2 is sequentially given to the signal line 5, and the nth pit output from the shift register is sequentially given to the signal line 16, and the result of their exclusive OR is as follows.
The signal is applied to a counter 19 via a signal line 17. The counter 19 counts up until it receives 0 from the signal line 17 for the first time. This determines the exponent length and therefore also the mantissa length (since the whole is of fixed length).

第2図にもどって信号線7は仮数部長検出回路4によっ
て検出された仮数部長の流れる信号線であり、8はレジ
スタに既にラッチされているデータの流れる信号線であ
る。6は各信号線7.8によって与えられたデータの小
さい方を出力する比較回路で、その結果は再び信号線1
1を経てレジスタ5に与えられる。9はレジスタをオン
/オフ、す・セットする信号の流れる信号線であり、1
0はレジスタ5に保持されているデータを外部へ取り出
す信号線である。
Returning to FIG. 2, a signal line 7 is a signal line through which the mantissa length detected by the mantissa length detection circuit 4 flows, and a signal line 8 is a signal line through which data already latched in the register flows. 6 is a comparison circuit that outputs the smaller of the data given by each signal line 7.8, and the result is sent back to signal line 1.
1 and is applied to register 5. 9 is a signal line through which signals for turning on/off, setting, and setting the register flow;
0 is a signal line that takes out the data held in the register 5 to the outside.

次に本実施例の動作例を説明する。ユーザは一連の演算
に先立ち、信号線9によってレジスタ5をリセットする
。リセット時、レジスタ5の値は+M、(仮数部長のと
りつる最大値)が設定される。
Next, an example of the operation of this embodiment will be explained. The user resets the register 5 using the signal line 9 prior to a series of operations. At the time of reset, the value of register 5 is set to +M (the maximum value that the mantissa length can handle).

以後、演算器3における演算結果の仮数部長が比較回路
6に与えられ、既にラッチされていたデータが8により
6に与えられ、両者の内の小さい方が11により出力さ
れて再びレジスタ5にラッチされる。
Thereafter, the mantissa part of the operation result in the arithmetic unit 3 is given to the comparison circuit 6, the data that was already latched is given to 6 by 8, and the smaller of the two is outputted by 11 and latched into the register 5 again. be done.

この動作は、演算器から演算結果が出力される毎に、ま
たユーザが信号線9によりリセットする迄続けられる。
This operation continues every time the calculation result is output from the calculation unit and until the user resets the signal line 9.

従ってユーザにとっての一連の演算の期間を自由に設定
でき、また必要に応じて、信号線lOを介して、レジス
タ5の内容を読み出すことが可能である。
Therefore, the user can freely set the period for a series of calculations, and the contents of the register 5 can be read out via the signal line 10 as necessary.

〔発明の効果〕〔Effect of the invention〕

本発明によれば、一連の演算において、その最終結果だ
けでなく、演算のたびごとに表われたデータの大小情報
を捕えることが可能となるので、最終結果への精度保証
が検証できる。
According to the present invention, in a series of calculations, it is possible to capture not only the final result but also the size information of the data appearing for each calculation, so it is possible to verify the accuracy guarantee of the final result.

また、同一の演算に対する演算順序による結果の違いも
、本レジスタの値によって、より望ましい演算順序を決
定できる。
Furthermore, even if the results of the same operation differ due to the order of operations, a more desirable order of operations can be determined by the value of this register.

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

第1図は、計算機内における数値表現の説明図、第2図
は、本発明の構成図、第3図は指数部長および仮数部長
の検出回路の構成図である。
FIG. 1 is an explanatory diagram of numerical representation in a computer, FIG. 2 is a block diagram of the present invention, and FIG. 3 is a block diagram of a detection circuit for an exponent part and a mantissa part.

Claims (1)

【特許請求の範囲】[Claims] 加算器や乗算器などより成る演算器において、データ長
固定で指数部長可変の数値表現を用いた一連の演算にお
ける仮数部長の最小値を記録するレジスタを設けたこと
を特徴とする、演算におけるデータ精度の保証方式。
Data in operations, in an arithmetic unit consisting of an adder, a multiplier, etc., characterized in that a register is provided for recording the minimum value of the mantissa length in a series of operations using a numerical expression with a fixed data length and a variable exponent length. Accuracy guarantee method.
JP59045450A 1984-03-12 1984-03-12 Security system of data accuracy for operation Pending JPS60191330A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP59045450A JPS60191330A (en) 1984-03-12 1984-03-12 Security system of data accuracy for operation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59045450A JPS60191330A (en) 1984-03-12 1984-03-12 Security system of data accuracy for operation

Publications (1)

Publication Number Publication Date
JPS60191330A true JPS60191330A (en) 1985-09-28

Family

ID=12719675

Family Applications (1)

Application Number Title Priority Date Filing Date
JP59045450A Pending JPS60191330A (en) 1984-03-12 1984-03-12 Security system of data accuracy for operation

Country Status (1)

Country Link
JP (1) JPS60191330A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6054004A (en) * 1995-07-14 2000-04-25 Mag Co., Ltd. Heat-insulating structure and method of manufacturing the same

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6054004A (en) * 1995-07-14 2000-04-25 Mag Co., Ltd. Heat-insulating structure and method of manufacturing the same

Similar Documents

Publication Publication Date Title
EP0328619B1 (en) Apparatus and method for using a single carry chain for leading one detection and for &#39;&#39;sticky&#39;&#39; bit calculation
US4110831A (en) Method and means for tracking digit significance in arithmetic operations executed on decimal computers
US4941119A (en) Method and apparatus for predicting an overflow in an integer multiply
US3678259A (en) Asynchronous logic for determining number of leading zeros in a digital word
JPH0480815A (en) Absolute value computing circuit
JPH0343645B2 (en)
US4538238A (en) Method and apparatus for calculating the residue of a signed binary number
US4728927A (en) Apparatus and method for performing comparison of two signals
JP3012357B2 (en) Shift amount detection circuit
JPS60191330A (en) Security system of data accuracy for operation
JP2695178B2 (en) Arithmetic circuit
JPH09128213A (en) Block floating processing system/method
US4150337A (en) Comparator circuit apparatus
US6128636A (en) Method for interfacing floating point and integer processes in a computer system
SU1383345A1 (en) Logarithmic converter
SU962921A1 (en) Device for analysis and processing number digits
JPS6162931A (en) Data processor
JPS61282928A (en) Floating-point arithmetic unit
SU1113798A1 (en) Device for computing values of trigonometrical and hyperbolic functions
JPS61275936A (en) Condition determining device
JPH07104777B2 (en) Floating point adder / subtractor
SU1401456A1 (en) Digital device for computing the logarithm of a number
JPS63255735A (en) Floating-point multiplier
SU1151955A1 (en) Dividing device
SU370605A1 (en) DEVICE FOR READING