JPS6118782B2 - - Google Patents

Info

Publication number
JPS6118782B2
JPS6118782B2 JP53010463A JP1046378A JPS6118782B2 JP S6118782 B2 JPS6118782 B2 JP S6118782B2 JP 53010463 A JP53010463 A JP 53010463A JP 1046378 A JP1046378 A JP 1046378A JP S6118782 B2 JPS6118782 B2 JP S6118782B2
Authority
JP
Japan
Prior art keywords
calculation
value
division
remainder
output
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
Application number
JP53010463A
Other languages
Japanese (ja)
Other versions
JPS54104248A (en
Inventor
Hiroaki Aotsu
Yasuo Morooka
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 JP1046378A priority Critical patent/JPS54104248A/en
Publication of JPS54104248A publication Critical patent/JPS54104248A/en
Publication of JPS6118782B2 publication Critical patent/JPS6118782B2/ja
Granted legal-status Critical Current

Links

Description

【発明の詳細な説明】 本発明はデイジタル演算制御装置に係り、特に
整数演算時における切捨て誤差の補正を行なうデ
イジタル演算制御方法に関する。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a digital arithmetic control device, and more particularly to a digital arithmetic control method for correcting truncation errors during integer arithmetic.

デイジタル演算を行なうフイードバツク制御系
で、特に整数演算による切捨てあるいは桁落ちな
どによつて発生する演算誤差が、その後段で割算
あるいは積分などの演算が行なわれる場合に特に
大きな問題となる。
In a feedback control system that performs digital calculations, calculation errors caused by truncation or loss of digits caused by integer calculations become a particularly serious problem when calculations such as division or integration are performed in subsequent stages.

従来のデイジタル演算装置の1例として一次遅
れ要素の演算装置の例を第1図に示す。同図にお
いて、xは任意の入力信号値、zはフイードバツ
ク信号値、20はxとzの偏差値を形成する減算
器、10は20の出力である偏差値εを任意の
係数G1で除する除算器、21は10の出力であ
る除算後の商εと前記フイードバツク信号値z
とを加算する加算器、yは21の出力値、30は
yからzを形成するためのメモリを示す。
As an example of a conventional digital arithmetic device, an example of a first-order delay element arithmetic device is shown in FIG. In the figure, x is an arbitrary input signal value, z is a feedback signal value, 20 is a subtracter that forms a deviation value between x and z, and 10 is a subtracter that forms the deviation value ε 1 , which is the output of 20, by an arbitrary coefficient G 1. A divider 21 is the output of 10, which is the quotient ε2 after division and the feedback signal value z.
y is the output value of 21, and 30 is a memory for forming z from y.

また、第2図は第1図に示した従来方式におい
て、xにステツプ入力を印加したときのyの応答
特性B及び、第1図の演算を実数演算したときの
zのyの理論値Aを示したものである。
In addition, Fig. 2 shows the response characteristic B of y when a step input is applied to x in the conventional method shown in Fig. 1, and the theoretical value A of y of z when the calculation in Fig. 1 is performed with real numbers. This is what is shown.

第2図の比較から明らかなように、整数演算を
主体とするデイジタル演算装置により第1図に示
したようなフイードバツクループ内に除算及び加
算機能を有するデイジタル演算を実施した場合に
は、除算時における余りが整数演算の場合には切
捨てられるため、最終演算結果であるyの値は y=x−(G1−1)=z 迄到達すると、20の出力値である偏差値εは ε=(G1−1)<G1 となるため10の出力である商εはこの時点以
後は常に ε=(G1−1)/G1=0 となり、yの値は演算回数が進んでもこれ以上は
増大しなくなる。
As is clear from the comparison in FIG. 2, when a digital arithmetic device that mainly performs integer operations performs digital operations that have division and addition functions in the feedback loop as shown in FIG. Since the remainder at the time of division is rounded down in the case of integer operations, the value of y, which is the final operation result, reaches y = x - (G 1 - 1) = z, and the deviation value ε 1 , which is the output value of 20. Since ε 1 = (G 1 - 1) < G 1 , the quotient ε 2 which is the output of 10 will always be ε 2 = (G 1 - 1)/G 1 = 0 after this point, and the value of y is Even if the number of operations increases, it will no longer increase.

このため、演算結果yと真値間の誤差Δεは Δε=x−(G−1)/x×100(%) で与えられることになるため、前記演算誤差Δε
はxが小さい程、かつG1が大きい程、増大する
という欠点を有している。
Therefore, the error Δε between the calculation result y and the true value is given by Δε=x−(G 1 −1)/x×100(%), so the calculation error Δε
has the disadvantage that it increases as x becomes smaller and G 1 becomes larger.

この為、演算精度の向上を図るには、第3図に
示したように入力値xをG0倍した値x′を用いて第
1図の演算を行ない、その結果得られた出力値
y′を改めて1/G0倍することにより出力yを求め
る方式が採用される。そして通常このときのxと
x′の関係はxが1語長の数値の場合はG0倍するこ
とにより得られるx′は2語長の数値となるように
G0が設定されている。(以後この方式を倍長演算
方式と呼ぶものとする。) しかし、この倍長演算方式による場合において
も、第3図におけるx′とy′との関係は第1図のx
とyの関係と同一となるため、10における除算
時の切捨て誤差の影響を完全に除去することがで
きない。この結果、通常y′は演算回数が進んだ定
常状態においても y′=x′−(G1−1) 迄しか上昇してこない。従つて最終出力値yの定
常状態における値は、50による除算時の余りも
切捨てられるため y=y′/G=Gx−(G−1)/G =x−1≠x となる。
Therefore, in order to improve the calculation accuracy, as shown in Figure 3, the input value x is multiplied by G 0 and the calculation shown in Figure 1 is performed using the value
A method is adopted in which the output y is obtained by multiplying y′ again by 1/G 0 . And usually at this time, x and
The relationship between x' is such that if x is a number with a length of 1 word, then x' obtained by multiplying by 0 will be a number with a length of 2 words.
G 0 is set. (Hereafter, this method will be referred to as the double-precision calculation method.) However, even when using this double-precision calculation method, the relationship between x' and y' in FIG.
Since the relationship between and y is the same, the effect of truncation error when dividing by 10 cannot be completely eliminated. As a result, y' usually increases only up to y'=x'-(G 1 -1) even in a steady state where the number of calculations has increased. Therefore, the final output value y in steady state is determined by cutting off the remainder when divided by 50, so y=y'/G 0 =G 0 x-(G 1 -1)/G 0 =x-1≠x becomes.

従つて第3図に示した演算を第7図に示した演
算フローに従つて行なういわゆる倍長演算方式を
採用した場合においても、第4図に示したように
整数演算結果Bは定常状態においても入力値xよ
りも1だけ小さな値にとどまるという欠点を有し
ていた。
Therefore, even if the so-called double-length calculation method is adopted in which the calculations shown in Fig. 3 are performed according to the calculation flow shown in Fig. 7, the integer calculation result B will be in a steady state as shown in Fig. 4. also had the disadvantage that the value remains only 1 smaller than the input value x.

第1図あるいは倍長演算による第3図の場合の
ように演算精度のみを問題にする場合であればよ
いが、後段に積分要素が接続されるような場合、
例えば第5図に示すような場合は出力信号yとス
テツプ入力xとの突き合わせ点に加算器20′が
設けられ、その差信号y′を積分要素S1に入力して
出力y″を得るような場合には大きな問題にな
る。すなわち、本来yとxは一致するわけである
が、例えば割算部10でのビツト切捨てがある
と、ある時間経過後であつてもy′≠0であるから
積分要素により積分が行なわれ、遂にy″はオー
バーフローし、次段への影響も大きくなるのであ
る。演算精度のみを問題にする場合は倍長演算な
どにより精度を向上させることが出来るが、しか
しその限度は1ビツトの誤差までであつて、複雑
な倍長演算を行なつたにもかかわらずy′≠0で1
ビツトの誤差は残るからどうしてもS1による積分
動作により、y″のオーバーフローという現象は
さけられない。もしy′=0が存在したとしてもそ
れはxの信号と、例えば10の割算のところで割
切れるような数値の関係にあるときのみであつ
て、一般にはy′≠0である。
This is fine if only the calculation accuracy is a concern, as in the case of Figure 1 or Figure 3 with double-length calculation, but if an integral element is connected at the subsequent stage,
For example, in the case shown in Fig. 5, an adder 20' is provided at the matching point of the output signal y and the step input x, and the difference signal y' is input to the integral element S1 to obtain the output y''. In other words, y and x should originally match, but if, for example, bits are truncated in the divider 10, y'≠0 even after a certain amount of time has passed. Then, the integral element performs the integration, and finally y'' overflows, and the influence on the next stage becomes large. If only the calculation accuracy is a problem, it is possible to improve the accuracy by using double-length calculations, but this is limited to an error of 1 bit, and even though complex double-length calculations are performed, y ′≠0 and 1
Since a bit error remains, the phenomenon of overflow of y'' due to the integral operation by S 1 cannot be avoided. Even if y' = 0 exists, it is divisible by the signal of x, for example, by dividing by 10. Generally, y'≠0 only when the numerical relationships are as follows.

本発明の目的はこのような従来技術の欠点を改
良し、デイジタル演算における切捨て等による誤
差が発生しないようなデイジタル演算制御方法を
提供することにある。
SUMMARY OF THE INVENTION An object of the present invention is to improve the drawbacks of the prior art and to provide a digital calculation control method that does not cause errors due to truncation or the like in digital calculations.

本発明は、従来除算時等において切捨てられて
いた余りを抽出し、これを新たなフイードバツク
信号値として用いることにより、演算精度の向上
を実現したことに特徴がある。
The present invention is characterized in that calculation precision is improved by extracting the remainder, which was conventionally discarded during division, and using this as a new feedback signal value.

すなわち切捨て誤差を検出して誤差分だけをフ
イードバツクして入力信号に補正し、出力信号が
入力信号に一致するまで何回かの補正を行ない、
場合によつてはオーバーシユートも発生するが最
後には第5図で云うy′=0とし、積分要素への悪
影響をなくすことが出来る特徴がある。
In other words, the truncation error is detected, the error is fed back and corrected to the input signal, and the correction is performed several times until the output signal matches the input signal.
In some cases, overshoot may occur, but in the end y'=0 as shown in FIG. 5, which has the characteristic of eliminating any adverse effects on the integral element.

第6図は本発明の1実施例を示したもので、同
図において第1,3図と同等のものは同一の記
号、番号が付してある。第6図における15,4
0,31が除算時の余りを抽出していてそれぞれ
15は乗算器、40は減算器、31はフイードバ
ツク信号Δx形成の為のメモリである。また第8
図は第6図に示した本発明の入出力特性の1例を
示したもので第2,4図と同等のものは同一の記
号が付してある。
FIG. 6 shows one embodiment of the present invention, and in this figure, parts equivalent to those in FIGS. 1 and 3 are given the same symbols and numbers. 15,4 in Figure 6
0 and 31 extract the remainder upon division, 15 is a multiplier, 40 is a subtracter, and 31 is a memory for forming a feedback signal Δx. Also the 8th
The figure shows an example of the input/output characteristics of the present invention shown in FIG. 6, and the same symbols as in FIGS. 2 and 4 are given to the same parts.

第6図に示した本発明の例は整数演算による一
次遅れ特演算時の例を示したもので、その動作は
先ず加減算機能20は入力値xとメモリ30を介
することにより得られる出力値yの1演算ステツ
プ前の値zおよびメモリ31を介することにより
得られる除算器10による除算時の余りΔx′の1
演算ステツプ前の値Δxとの加減算を行なうこと
により偏差値ε ε=x−z+Δx (1) の形成を行なう。
The example of the present invention shown in FIG. 6 shows an example of a first-order lag special operation using integer operations. The value z of one operation step before
By performing addition and subtraction with the value Δx before the calculation step, the deviation value ε 1 ε 1 =x−z+Δx (1) is formed.

除算器10はこの偏差値εを入力として ε=ε/G1 (2) なる演算を行なう。(2)式の演算は整数演算である
ため、εには除算時の商のみが得られ、余りは
切捨てられる。
The divider 10 receives this deviation value ε 1 and performs the calculation ε 21 /G 1 (2). Since the operation in equation (2) is an integer operation, only the quotient at the time of division is obtained for ε2 , and the remainder is discarded.

従つて、乗算器15及び減算器40を用いて、 Δx′=ε−ε・G1 (3) なる演算を行なうことにより、Δx′には10によ
る除算時の余りが抽出できる。この余り抽出演算
結果Δx′は、当然の事ながら偏差値εが求まつ
た残で得られるため、Δx′は一旦メモリ機能31
に結果をストアし、次の演算時に改めてΔxとし
て20による偏差値形成に用いる。
Therefore, by using the multiplier 15 and the subtractor 40 and performing the calculation Δx'=ε 12 ·G 1 (3), the remainder upon division by 10 can be extracted from Δx'. This remainder extraction calculation result Δx' is naturally obtained from the remainder after the deviation value ε 1 has been found, so Δx' is temporarily stored in the memory function 31.
The result is stored in , and used to form a deviation value by 20 as Δx in the next calculation.

このため、例えばn演算ステツプ目における偏
差値ε1oが0<ε1o<G1となり、10による除
算結果 ε2o=ε1o/G1=0 となつても、このときの余り Δx′o=ε1o−ε2n×G1=ε1o が次の演算ステツプに加算されるため、次の演算
ステツプにおける偏差値ε1o+1は ε1o+1=xo+1−zo+1+ε1o の如く、前回の余りε1oの分だけは増大してゆ
くことになる。この結果、出力値yは演算ステツ
プ数が進めば必ずx=yなる定常状態すなわち、
ε=0へ到達するため、従来方式にみられるよ
うな演算誤差(すなわち定常状態においてもx=
yとならない)を完全に解消することができる。
又、第7図は第5図の演算ブロツクを実行する為
の演算フローを示したものである。
Therefore, for example, even if the deviation value ε 1o at the nth operation step becomes 0<ε 1o <G 1 and the division result by 10 becomes ε 2o1o /G 1 =0, the remainder at this time Δx′ o = Since ε 1o −ε 2 n×G 1 = ε 1o is added to the next calculation step, the deviation value ε 1o+1 in the next calculation step is ε 1o+1 = x o+1 −z o+1 + ε 1o , the previous remainder ε 1o will increase. As a result, the output value y is in a steady state where x = y as the number of calculation steps advances, that is,
In order to reach ε 1 = 0, the calculation error seen in the conventional method (i.e., x =
y) can be completely eliminated.
Further, FIG. 7 shows a calculation flow for executing the calculation blocks of FIG. 5.

第8図は第6図に示した本発明の実施例を用い
てxにステツプ入力を印加したときの応答特性を
示したもので、同図に示した曲線Cは本発明実施
後の出力値の応答特性、曲線Aが実数型演算で求
めた応答特性を表わしている。同図に示したよう
に特性曲線CはAをほぼ四捨五入した形となり、
かつ定常状態では完全に入力値=出力値なる状態
となり、従来方式にみられた如き、定常状態にお
けるオフセツトエラーの除去が完全に行なうこと
ができる。
FIG. 8 shows the response characteristics when a step input is applied to x using the embodiment of the present invention shown in FIG. Curve A represents the response characteristic obtained by real number type calculation. As shown in the figure, the characteristic curve C has a shape that is approximately rounded off from A.
Moreover, in a steady state, the input value is completely equal to the output value, and offset errors in the steady state, as seen in the conventional system, can be completely removed.

次に本発明の他の実施例として、本発明をいわ
ゆる計算機によるソフトウエアで処理した場合の
1実施例について第9図に示す。コンピユータプ
ログラムで本発明の除算時における余りを抽出
し、かつこの値を次の計算ステツプに対するフイ
ードバツク信号とするためには、通常除算命令を
実行した場合には商が求まるレジスタと余りが求
まるレジスタがあるので余りの抽出はこの除算命
令実施後において、前記後者のレジスタの内容を
任意の記憶エリアに一旦格納する命令を追加する
ことによつて成される。また、この除算時の余り
をフイードバツク信号値として取り出すために
は、すでに格納した記憶エリアの内容すなわち余
りを前記前者のレジスタへロードし、かつxとz
との偏差値に加算する加算命令の二つの命令を追
加することにより容易に成される。
Next, as another embodiment of the present invention, FIG. 9 shows an embodiment in which the present invention is processed by so-called computer software. In order for a computer program to extract the remainder during division according to the present invention and to use this value as a feedback signal for the next calculation step, when a normal division instruction is executed, a register for finding the quotient and a register for finding the remainder are required. Therefore, the remainder can be extracted by adding an instruction to temporarily store the contents of the latter register in an arbitrary storage area after executing this division instruction. In addition, in order to retrieve the remainder upon this division as a feedback signal value, the content of the storage area that has already been stored, that is, the remainder, is loaded into the former register, and x and z
This can be easily accomplished by adding two instructions: an addition instruction to add to the deviation value from

以上述べた本発明の効果は、特にデイジタル演
算装置において、除算が必要となる系の入力側に
何らかの形で除算結果がフイードバツクされてく
る演算により制御出力を求める必要がある場合に
除算時における切捨て誤差の影響を最小にし、演
算結果すなわち、制御出力の精度の向上を図るこ
とができることにある。
The effects of the present invention described above are particularly advantageous when, in a digital arithmetic device, when it is necessary to obtain a control output by an operation in which the result of division is fed back in some way to the input side of the system that requires division, truncation at the time of division is possible. It is possible to minimize the influence of errors and improve the accuracy of the calculation results, that is, the control output.

また、他の効果としては、ソフトウエアにより
本発明を実現する場合は、本発明方法は単精度演
算が基本となるため、例え入力信号xが倍長精度
の場合でも容易に実現できる。さらに、従来の倍
長演算方式の場合は入力信号xが倍長精度なら演
算は4倍長扱いが要求されるため、従来方式に比
べると特に入力信号が倍長精度の場合は本発明を
実施したことによりソフトウエア量の大幅低減、
処理時間低減、及び高精度化が図れるという効果
を同時に得ることができる。
Another effect is that when the present invention is implemented by software, the method of the present invention is based on single-precision arithmetic, so it can be easily implemented even when the input signal x is double-precision. Furthermore, in the case of the conventional double-precision arithmetic method, if the input signal x is double-precision, the calculation is required to be treated as quadruple-length. As a result, the amount of software has been significantly reduced.
The effects of reducing processing time and increasing accuracy can be obtained at the same time.

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

第1図は従来方式を示す略線図、第2図は従来
方式の特性を示す図、第3図は従来方式を示す略
線図、第4図は従来方式の特性を示す図、第5図
は積分要素と組合せた場合、第6図は本発明の1
実施例を示す図、第7図はフロー図、第8図は第
6図の特性を示す図、第9図はフロー図の1例を
示す。 10…除算器、20…偏差値形成のための加減
算器、30…出力値フイードバツクのためのメモ
リ、31…除算時の余りフイードバツクのための
メモリ、15…乗算器、40…減算器。
Fig. 1 is a schematic diagram showing the conventional method, Fig. 2 is a diagram showing the characteristics of the conventional method, Fig. 3 is a schematic diagram showing the conventional method, Fig. 4 is a diagram showing the characteristics of the conventional method, and Fig. 5 is a diagram showing the characteristics of the conventional method. When combined with an integral element, FIG.
7 is a flow diagram, FIG. 8 is a diagram showing the characteristics of FIG. 6, and FIG. 9 is an example of a flow diagram. DESCRIPTION OF SYMBOLS 10... Divider, 20... Adder/subtractor for forming a deviation value, 30... Memory for output value feedback, 31... Memory for remainder feedback during division, 15... Multiplier, 40... Subtractor.

Claims (1)

【特許請求の範囲】[Claims] 1 切捨て誤差が発生するデイジタル演算を含む
演算制御において、1回目の演算において切捨て
誤差を検出し、検出された切捨て誤差を記憶装置
に記憶し、次の演算ステツプで該記憶装置に記憶
されている切捨て誤差量を読出し、入力信号の一
つとして処理することにより演算信号の補償を行
なうことを特徴とするデイジタル演算制御方法。
1. In calculation control including digital calculations in which truncation errors occur, a truncation error is detected in the first calculation, the detected truncation error is stored in a storage device, and is stored in the storage device in the next calculation step. A digital calculation control method characterized in that a calculation signal is compensated by reading out a truncation error amount and processing it as one of the input signals.
JP1046378A 1978-02-03 1978-02-03 Digital arithmetic control method Granted JPS54104248A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1046378A JPS54104248A (en) 1978-02-03 1978-02-03 Digital arithmetic control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1046378A JPS54104248A (en) 1978-02-03 1978-02-03 Digital arithmetic control method

Publications (2)

Publication Number Publication Date
JPS54104248A JPS54104248A (en) 1979-08-16
JPS6118782B2 true JPS6118782B2 (en) 1986-05-14

Family

ID=11750820

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1046378A Granted JPS54104248A (en) 1978-02-03 1978-02-03 Digital arithmetic control method

Country Status (1)

Country Link
JP (1) JPS54104248A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0321292A (en) * 1989-06-17 1991-01-30 Masaru Nakayama Bobbin thread winding device of sewing machine

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62260227A (en) * 1986-05-06 1987-11-12 Yamaha Corp Multiplication circuit

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0321292A (en) * 1989-06-17 1991-01-30 Masaru Nakayama Bobbin thread winding device of sewing machine

Also Published As

Publication number Publication date
JPS54104248A (en) 1979-08-16

Similar Documents

Publication Publication Date Title
US5452241A (en) System for optimizing argument reduction
US20070033152A1 (en) Digital signal processing device
JPS6118782B2 (en)
EP3757755A1 (en) Operator for combined addition and multiplication for numbers with mixed precision floating comma for performing correct rounding off
JPH07107664B2 (en) Multiplication circuit
Scraton The solution of linear differential equations in Chebyshev series
JPH0833809B2 (en) Floating point display data calculation method
JPH07146777A (en) Arithmetic unit
JP3201097B2 (en) Multiplication prescription method in multiplier
JPS59116852A (en) High-speed divider
JPS62550B2 (en)
JPH0831024B2 (en) Arithmetic processor
JPS61213926A (en) Dsp arithmetic processing system
JPH0449138B2 (en)
JPH04281524A (en) Floating point arithmetic processor
JP2960595B2 (en) Digital signal processor
JPH0260005B2 (en)
JPH0330170B2 (en)
JPS62131334A (en) Division device
JPS61150034A (en) Operation processing system
JP2000231476A (en) Fixed point type multiplier and adder
JPH0553759A (en) Fixed decimal point arithmetic unit
JP2624738B2 (en) Rounding method
JP3139011B2 (en) Fixed-point processor
JPS5952375A (en) Arithmetic device