JP2530916B2 - Arithmetic circuit - Google Patents

Arithmetic circuit

Info

Publication number
JP2530916B2
JP2530916B2 JP1179793A JP17979389A JP2530916B2 JP 2530916 B2 JP2530916 B2 JP 2530916B2 JP 1179793 A JP1179793 A JP 1179793A JP 17979389 A JP17979389 A JP 17979389A JP 2530916 B2 JP2530916 B2 JP 2530916B2
Authority
JP
Japan
Prior art keywords
register
output
adder
data
cumulative
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 - Fee Related
Application number
JP1179793A
Other languages
Japanese (ja)
Other versions
JPH0343863A (en
Inventor
薫 中条
洋久 雁部
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP1179793A priority Critical patent/JP2530916B2/en
Publication of JPH0343863A publication Critical patent/JPH0343863A/en
Application granted granted Critical
Publication of JP2530916B2 publication Critical patent/JP2530916B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Complex Calculations (AREA)

Description

【発明の詳細な説明】 [概要] 入力データを取込んで所定演算の累積加算演算を行う
演算回路に関し、 簡単なハード構成で所定演算の累積加算演算を確実に
行うことを目的とし、 入力データの演算を行う演算器と、該演算器の出力を
受けてNサンプルの演算結果の累積加算を行う累積加算
器と、1サンプル前の累積加算結果を保持する第1のレ
ジスタと、前記演算器の出力を受けて現時点の入力デー
タの演算結果を保持する第2のレジスタと、前記演算器
の出力を受けてN+1サンプル前の演算結果を保持する
第3のレジスタと、第1のレジスタ及び第2のレジスタ
の出力を加算する加算器と、該加算器の出力から第3の
レジスタの出力を減算する減算器と、通常は減算器の出
力を第1のレジスタに接続し、Nサンプルに1回だけ累
積加算器の出力を第1のレジスタに接続すると共に前記
累積加算器をクリアする切り換え手段とによりなり、前
記減算器の出力をその出力とするように構成する。
DETAILED DESCRIPTION OF THE INVENTION [Outline] An arithmetic circuit for fetching input data and performing a cumulative addition operation of a predetermined arithmetic operation, in order to reliably perform a cumulative addition operation of a predetermined arithmetic operation with a simple hardware configuration, , A cumulative adder that receives the output of the computing unit and cumulatively adds the computation results of N samples, a first register that holds the cumulative addition result of one sample before, and the computing unit Second register for receiving the operation result of the input data at the present time and the third register for receiving the operation result N + 1 samples before in response to the output of the operation unit, the first register and the first register An adder for adding the outputs of the two registers, a subtractor for subtracting the output of the third register from the output of the adder, and usually the output of the subtractor is connected to the first register, and 1 is connected to N samples. Cumulative addition only once Switching means for connecting the output of the subtracter to the first register and clearing the cumulative adder, and is configured to use the output of the subtractor as its output.

[産業上の利用分野] 本発明は入力データを取込んで2乗和の累積加算演算
を行う演算回路に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an arithmetic circuit which takes in input data and performs cumulative addition operation of sum of squares.

現時点の入力データからNサンプル前までの入力デー
タをメモリに保持しておき、1サンプル周期内にそれら
N個のデータを用いて繰返し演算を行う処理は、さまざ
まな装置で必要とされている。例えば、Nサンプル前ま
でのパワーを求めるために、 Σxi2(xiはi時点前での入力データを示す。以下同
様)を求める場合や、Nサンプル間の1次相関を求める
際に Σxi・xi-1を算出する場合等がある。
Various devices require a process of holding input data up to N samples before the present input data in a memory and performing an iterative operation using the N data within one sampling period. For example, in order to obtain the power up to N samples before, Σxi 2 (xi represents the input data before the time point i. The same applies below), or when obtaining the first-order correlation between N samples, Σxi · x There are cases where i-1 is calculated.

[従来の技術] 第3図は従来回路の構成ブロック図で、2乗和の累積
加算を行う回路である。図において、1はN個のデータ
を保持するシフトレジスタで、現時点で取込んだデータ
x0からNサンプル前のデータxN-1までのN個のデータが
格納されている。このシフトレジスタ1はシフトクロッ
クによりデータが1個ずつシフトし、データが1個入力
する度に、溢れたデータが廃棄されるようになってい
る。シフトレジスタ1に入力したデータは、レジスタ2
A,2Bに保持され、これらレジスタ2A,2Bの出力xiは乗算
器3に入って2乗演算が行われる。乗算器3の出力xi2
は加算器4に入り、それまでの累積加算値Σxi2と加算
され、出力5となる。
[Prior Art] FIG. 3 is a configuration block diagram of a conventional circuit, which is a circuit for performing cumulative addition of sums of squares. In the figure, 1 is a shift register that holds N pieces of data, which is the data currently fetched.
N pieces of data from x 0 to data N times before N samples are stored. This shift register 1 shifts data one by one by a shift clock, and every time one data is input, overflow data is discarded. The data input to the shift register 1 is stored in the register 2
The outputs xi of the registers 2A and 2B are held in A and 2B and enter the multiplier 3 to be squared. Output xi 2 of multiplier 3
Enters the adder 4, and is added to the cumulative addition value Σxi 2 up to that point to become the output 5.

図に示す回路は、入力データをN個分シフトレジスタ
1に保持しておき、保持している入力データをシフトレ
ジスタ1からレジスタ2A,2Bに順次ストアし()、続
く乗算器3でxi2の乗算を行い()、乗算結果を加算
器4に入れてそれまでの累積加算値に加算する()と
いうシーケンスをN回繰返す。この結果、加算器4から
N個のデータの累積加算値Σxi2が得られる。
In the circuit shown in the figure, N pieces of input data are held in the shift register 1, the held input data are sequentially stored in the registers 2A and 2B from the shift register 1 (), and xi 2 Is performed (), the multiplication result is put into the adder 4, and the cumulative addition value up to that time is added () is repeated N times. As a result, the adder 4 obtains a cumulative addition value Σxi 2 of N pieces of data.

この方式は、N個のデータを保持しておくメモリ(こ
こではシフトレジスタ1)が必要であることと、Nに応
じた演算回数を必要とする。従って、この方式では、特
にNが大きくなると、ハード規模の増加,演算速度の低
下を招いてしまう。例えば、前記した3個のステップが
それぞれ1マシンサイクルで行えるとしても、1データ
に対して3マシンサイクルの演算時間を必要とすること
になる。従って、N個のデータに対しては3N個のマシン
サイクルを必要とすることになり、長時間の演算時間を
必要とする。
This method requires a memory (here, the shift register 1) for holding N pieces of data, and requires the number of calculations according to N. Therefore, in this method, particularly when N becomes large, the hardware scale increases and the calculation speed decreases. For example, even if each of the above-mentioned three steps can be performed in one machine cycle, an operation time of three machine cycles is required for one data. Therefore, 3N machine cycles are required for N data, which requires a long calculation time.

このような不具合を除去するため、第4図に示すよう
な演算回路が考案されている。この回路は、入ってくる
データの値と、廃棄されるデータの値との差分のみを累
積加算値に加えるようにしたもので、第3図に示す不具
合を除去している。第3図と同一のものは、同一の符号
を付して示す。図において、10はN個の累積加算値を保
持するレジスタ、11は現時点の入力データの2乗xo2
保持するレジスタ、12はN+1サンプル前の入力データ
の2乗xN 2を保持するレジスタである。13はレジスタ10
と11の出力の加算演算を行う加算器、14は該加算器13の
出力からレジスタ12の出力の減算を行う減算器である。
そして、該減算器14の出力15が回路の出力となってい
る。
In order to eliminate such a defect, an arithmetic circuit as shown in FIG. 4 has been devised. This circuit adds only the difference between the value of the incoming data and the value of the discarded data to the cumulative addition value, eliminating the inconvenience shown in FIG. The same parts as those in FIG. 3 are designated by the same reference numerals. In the figure, 10 is a register that holds N cumulative addition values, 11 is a register that holds the square xo 2 of the current input data, and 12 is a register that holds the square x N 2 of the input data N + 1 samples before. Is. 13 is register 10
Reference numeral 14 is an adder for performing an addition operation on the outputs of 11 and 11, and 14 is a subtractor for subtracting the output of the register 12 from the output of the adder 13.
The output 15 of the subtractor 14 is the output of the circuit.

このように構成された回路において、レジスタ2Aには
現時点の入力データxoが、レジスタ2BにはN+1サンプ
ル前の入力データxNが保持されており、それぞれが乗算
器3により2乗演算され、レジスタ11,12に保持され
る。レジスタ10には1サンプル前の累積加算値Σが保持
されている。新しいデータが1個入力されると、最も古
いデータは廃棄される。従って、その間の差分のみ累積
加算値に加算すれば、新しいデータが入力された後の累
積加算値を求めることができる。ここで、レジスタ10の
累積加算値をΣ,レジスタ11の出力をxo2とすれば、加
算器13の出力Out1は次式で表される。
In the circuit configured as described above, the register 2A holds the current input data xo, and the register 2B holds the input data x N before N + 1 samples, which are respectively squared by the multiplier 3 Held at 11,12. The register 10 holds the cumulative addition value Σ of one sample before. When one new data is input, the oldest data is discarded. Therefore, if only the difference between them is added to the cumulative addition value, the cumulative addition value after new data is input can be obtained. Here, if the cumulative addition value of the register 10 is Σ and the output of the register 11 is xo 2 , the output Out1 of the adder 13 is expressed by the following equation.

Out1=Σ+xo2 (1) 次に、加算器13の出力をその一方の+入力に、レジス
タ12の出力xN 2を他方の−入力に受ける減算器14の出力O
ut2は次式で表される。
Out1 = Σ + xo 2 (1) Next, the output O of the subtractor 14 which receives the output of the adder 13 at one of its + inputs and the output x N 2 of the register 12 at the other − input
ut2 is expressed by the following equation.

Out2=Out1−xN 2 =Σ+xo2−xN 2 (2) (2)式は、現時点の累積加算値を表している。このよ
うに、Σ,xo2及びxN 2の3個のデータを保持するレジス
タを設けてこれらデータを保持しておき、1サンプル前
までの累積加算器Σに対して現時点の入力データxo2
加算し、N+1サンプル前の入力データの2乗値xN 2
減算することにより第3図に示す演算回路と同じ機能を
持たせることができる(但し、最初の演算開始後Nサン
プルまでは除く)。
Out2 = Out1-x N 2 = Σ + xo 2 -x N 2 (2) (2) equation represents the accumulated value of the current. As described above, a register for holding three data of Σ, xo 2 and x N 2 is provided and these data are held, and the current input data xo 2 is input to the cumulative adder Σ one sample before. By adding and subtracting the squared value x N 2 of the input data N + 1 samples before can have the same function as the arithmetic circuit shown in FIG. 3 (however, until N samples after the start of the first arithmetic operation) except).

第4図に示す回路はNの値に関係なく、レジスタ(メ
モリ)は3ワード分あればよいため、ハードの規模は第
3図に示す回路の構成に比較して大幅に縮小される。次
に、演算速度を考えてみる。xo,xNをレジスタ2A,2Bに格
納し()、乗算器3によりこれらのデータの2乗値を
求め()、レジスタ11,12にそれぞれの2乗値を格納
し()、加算器13でΣにxo2を加算し()、減算器1
4で加算器出力からxN 2を減算し()、結果を再度レジ
スタ10に格納する()という6個のシーケンスより構
成されている。
In the circuit shown in FIG. 4, regardless of the value of N, the register (memory) needs to have three words, so that the scale of hardware is significantly reduced as compared with the configuration of the circuit shown in FIG. Next, consider the calculation speed. xo, x N is stored in registers 2A and 2B (), the square value of these data is obtained by the multiplier 3 (), each square value is stored in the registers 11 and 12 (), and the adder 13 Add xo 2 to Σ with () and subtracter 1
In step 4, x N 2 is subtracted from the adder output (), and the result is stored again in the register 10 ().

各動作シーケンスをそれぞれ1マシンサイクルで行う
ものとすると、〜はそれぞれ2個のデータxo,xN
対して行うことを考慮すると、計9マシンサイクルで演
算可能となる。第4図に示す回路はNの値に関係なく、
9サイクルで演算可能となるため、処理速度に関しても
大幅な時間短縮となっている。
Assuming that perform each operation sequence in each machine cycle, - the two data xo respectively, considering that performed on x N, it is possible operations in nine machine cycles. In the circuit shown in FIG. 4, regardless of the value of N,
Since the calculation can be performed in 9 cycles, the processing time has been greatly shortened.

[発明が解決しようとする課題] しかしながら、第4図に示す回路はN個の入力データ
を保持するメモリ(乃至はレジスタ)を持っていないた
め、落雷等により電源電圧が変動し、レジスタ10の内容
が破壊されると、以後は正常な加算演算を行うことがで
きないという問題があった。例えば、第3図の例で考え
ると、xo及びxNが破壊された場合には、Nサンプル間の
みその影響が残るだけで、N+1サンプル以降は正しい
演算値を求めることができる。これに対して、第4図に
示す回路の場合、Σを保持するレジスタ10が破壊される
と、Σの影響を永久に取り除くことはできなくなってし
まう。
[Problems to be Solved by the Invention] However, since the circuit shown in FIG. 4 does not have a memory (or register) for holding N pieces of input data, the power supply voltage fluctuates due to a lightning strike, etc. If the contents are destroyed, there is a problem that a normal addition operation cannot be performed thereafter. For example, considering the example of FIG. 3, when xo and x N are destroyed, the effect remains only for N samples, and correct operation values can be obtained after N + 1 samples. On the other hand, in the case of the circuit shown in FIG. 4, if the register 10 holding Σ is destroyed, the influence of Σ cannot be permanently removed.

本発明はこのような課題に鑑みてなされたものであっ
て、簡単なハード構成で2乗和の累積加算演算を確実に
行うことができる演算回路を提供することを目的として
いる。
The present invention has been made in view of the above problems, and an object of the present invention is to provide an arithmetic circuit capable of reliably performing the cumulative addition operation of the sum of squares with a simple hardware configuration.

[課題を解決するための手段] 第1図は本発明の原理ブロック図である。第4図と同
一のものは、同一の符号を付して示す。図において、
3′は入力データの演算を行う演算器、20は該演算器
3′の出力を受けてNサンプルの演算結果の累積加算を
行う累積加算器、10は1サンプル前の累積加算結果を保
持する第1のレジスタ、11は前記演算器3′の出力を受
けて現時点の入力データの演算結果を保持する第2のレ
ジスタ、12は前記演算器3′の出力を受けてN+1サン
プル前の演算結果を保持する第3のレジスタ、13は第1
のレジスタ10及び第2のレジスタ11の出力を加算する加
算器、14は該加算器13の出力から第3のレジスタ12の出
力を減算する減算器、21は通常は減算器14の出力を第1
のレジスタ10に接続し、Nサンプルに1回だけ累積加算
器20の出力を第1のレジスタ10に接続すると共に前記累
積加算器20をクリアする切り換え手段としてのスイッチ
である。
[Means for Solving the Problems] FIG. 1 is a block diagram showing the principle of the present invention. The same parts as those in FIG. 4 are designated by the same reference numerals. In the figure,
Reference numeral 3'denotes an arithmetic unit for computing the input data, 20 denotes a cumulative adder for receiving the output of the arithmetic unit 3'and performing cumulative addition of the calculation results of N samples, and 10 holds the cumulative addition result of one sample before. A first register 11 is a second register which receives the output of the arithmetic unit 3'and holds the arithmetic result of the current input data, and 12 is an arithmetic result N + 1 samples before the output of the arithmetic unit 3 '. Is a third register for holding, 13 is the first
Of the register 10 and the second register 11, the adder 14 subtracts the output of the third register 12 from the output of the adder 13, and the output 21 of the subtractor 14 is usually the output of the subtracter 14. 1
The register 10 is connected to the register 10, the output of the cumulative adder 20 is connected to the first register 10 only once every N samples, and the switch is a switch means for clearing the cumulative adder 20.

[作用] 通常の演算動作は、第1〜第3のレジスタ10〜12に保
持されているデータから(2)式による演算を行いその
結果を再度第1のレジスタ10に格納する動作を繰り返す
ので、第4図に示す回路と同じ動作をする。一方、累積
加算器20では入力データの累積加算が行われており、N
サンプルに1回だけ、スイッチ21を累積加算器20側に切
換えて第1のレジスタ10に結果を格納し直している。従
って、本発明によれば第1のレジスタ10が破壊された場
合でも、最大Nサンプル間その影響が残るのみで、N+
1サンプル以降は正しい累積加算演算値を得ることがで
きる。しかも、N個の入力データを保持するメモリは必
要としないので、ハード構成も簡単なものですむ。
[Operation] In the normal arithmetic operation, the operation according to the equation (2) is performed from the data held in the first to third registers 10 to 12, and the operation of storing the result in the first register 10 again is repeated. , Operates in the same way as the circuit shown in FIG. On the other hand, the cumulative adder 20 is performing cumulative addition of the input data, and N
Only once in the sample, the switch 21 is switched to the cumulative adder 20 side and the result is stored again in the first register 10. Therefore, according to the present invention, even if the first register 10 is destroyed, its effect remains for a maximum of N samples, and N +
Correct accumulative addition operation values can be obtained after 1 sample. Moreover, since a memory for holding N pieces of input data is not required, the hardware configuration is simple.

[実施例] 以下、図面を参照して本発明の実施例を詳細に説明す
る。
[Example] Hereinafter, an example of the present invention will be described in detail with reference to the drawings.

第2図は本発明の一実施例を示す構成ブロック図であ
る。第1図,第4図と同一のものは、同一の符号を付し
て示す。図において、30Aは現時点での入力データxoを
保持するレジスタ、30BはN+1サンプル前の入力デー
タxNを保持するレジスタである。2A,2Bは2乗演算のた
めに同一データを保持するレジスタである。
FIG. 2 is a configuration block diagram showing an embodiment of the present invention. The same parts as those in FIGS. 1 and 4 are designated by the same reference numerals. In the figure, 30A is a register for holding the input data xo at the present time, and 30B is a register for holding the input data x N N + 1 samples before. 2A and 2B are registers that hold the same data for the square operation.

累積加算器20は加算器20aとレジスタ20bより構成さ
れ、レジスタ20bの出力は加算器20aの一方の入力にフィ
ードバックされている。加算器20aの他方の入力には、
演算器としての乗算器3′の2乗出力が入力されてい
る。31はNサンプルカウンタで、Nサンプルに1回だ
け、スイッチ21を減算器14側から累積加算器20側に切換
える制御を行っている。このように構成された回路の動
作を説明すれば、以下のとおりである。
The cumulative adder 20 is composed of an adder 20a and a register 20b, and the output of the register 20b is fed back to one input of the adder 20a. To the other input of the adder 20a,
The squared output of the multiplier 3'as an arithmetic unit is input. Reference numeral 31 denotes an N sample counter, which controls the switch 21 to switch from the subtractor 14 side to the cumulative adder 20 side only once every N samples. The operation of the circuit thus configured will be described below.

レジスタ30A,30Bに保持されている入力データのう
ち、先ずN+1サンプル前のデータxNがレジスタ30Bか
ら読出されてレジスタ2A,2Bに保持される。乗算器3′
はこれらレジスタ2A,2Bに保持されている同一データ同
志の乗算を行う。そして、乗算結果xN 2は第3のレジス
タ12(以下レジスタ3という)に保持される。なお、こ
の場合、乗算結果xN 2は加算器20aには入力されないよう
になっている。次に、現時点での入力データxoがレジス
タ30Aから読出されてレジスタ2A,2Bに保持される。乗算
器3′はこれらレジスタ2A,2Bに保持されている同一デ
ータ同志の乗算を行う。そして、乗算結果xo2は第2の
レジスタ11(以下レジスタ2という)に保持される。
Of the input data held in the registers 30A and 30B, the data x N before N + 1 samples are read from the register 30B and held in the registers 2A and 2B. Multiplier 3 '
Performs multiplication of the same data held in these registers 2A and 2B. Then, the multiplication result x N 2 is held in the third register 12 (hereinafter referred to as register 3). In this case, the multiplication result x N 2 is not input to the adder 20a. Next, the current input data xo is read from the register 30A and held in the registers 2A and 2B. The multiplier 3'multiplies the same data held in the registers 2A and 2B. The multiplication result xo 2 is held in the second register 11 (hereinafter referred to as register 2).

一方、第1のレジスタ10(以下レジスタ1という)に
は2乗和の累積値Σが保持されている。スイッチ21が減
算器14側に接続されている間、図に示す演算回路は
(2)式で示される演算を行い、新しいデータが入力さ
れる度に減算器14からは最新のNサンプルの累積加算値
が出力され、レジスタ10に保持される。
On the other hand, the cumulative value Σ of the sum of squares is held in the first register 10 (hereinafter referred to as register 1). While the switch 21 is connected to the subtractor 14 side, the arithmetic circuit shown in the figure performs the operation represented by the equation (2), and the latest N samples are accumulated from the subtractor 14 every time new data is input. The added value is output and held in the register 10.

また、累積加算器20側では、乗算器3′から入力デー
タxiの2乗データが出力される度にそれまでの加算値に
加算される。具体的には、加算器20aがレジスタ20bに保
持されている累積加算値と入力される2乗データを加算
し、その結果を再度レジスタ20bに加算する動作を繰返
している。従って、両方の回路の動作が正常な場合に
は、Nサンプルの累積加算結果は、レジスタ20bの出力
値と減算器14の出力値とで等しくなる。
Also, on the cumulative adder 20 side, every time the square data of the input data xi is output from the multiplier 3 ', it is added to the addition value up to that point. Specifically, the operation in which the adder 20a adds the cumulative addition value held in the register 20b and the input squared data and adds the result to the register 20b again is repeated. Therefore, when the operation of both circuits is normal, the cumulative addition result of N samples is equal to the output value of the register 20b and the output value of the subtractor 14.

一方、Nサンプルカウンタ31は新しいデータが入力さ
れるたびに+1ずつのカウントアップを行っており、カ
ウント値がNになったら、スイッチ21をそれまでの減算
器14側から累積加算器20側に切換え、レジスタ10に累積
加算器20の演算結果を格納する。この時、累積加算器20
の内容はクリアされる。次の累積加算に備えるためであ
る。両方の演算回路が動作正常な場合には、レジスタ10
のデータを累積演算回路20の出力で置換しても結果は変
わらない。
On the other hand, the N sample counter 31 counts up by +1 each time new data is input, and when the count value reaches N, the switch 21 is moved from the subtractor 14 side up to that time to the cumulative adder 20 side. Switching is performed, and the calculation result of the cumulative adder 20 is stored in the register 10. At this time, the accumulator 20
The content of is cleared. This is to prepare for the next cumulative addition. If both arithmetic circuits are operating normally, register 10
Even if the data of is replaced by the output of the cumulative operation circuit 20, the result does not change.

ところが、落雷等でレジスタ10の内容が失われると、
第4図に示す回路部分は以降は正常な演算を行うことは
不可能となる。しかしながら、本発明によれば、Nサン
プル待てば、累積加算器20の正しい累積値がレジスタ10
にセットされるので、N+1サンプル以降は正確な累積
加算演算を行うことができる。
However, if the contents of register 10 are lost due to a lightning strike,
After that, the circuit portion shown in FIG. 4 cannot perform a normal operation. However, according to the present invention, if N samples are waited, the correct cumulative value of the cumulative adder 20 is set in the register 10.
Is set to, the accurate cumulative addition operation can be performed after N + 1 samples.

次に、本発明の処理速度について考えてみる。本発明
は、第4図に示す回路の動作に加えて、Nサンプルをカ
ウントするシーケンス()と、加算器20aによりレジ
スタ20bの内容と入力データの2乗を加算するシーケン
ス()と、加算結果をレジスタ20bに格納するシーケ
ンス()と、丁度Nサンプル目になった時にレジスタ
20bの内容をレジスタ1に格納するように制御し、格納
した後にレジスタ20bの内容をクリアし、またそれ以外
のシーケンスでは従来の出力値をレジスタ1に格納する
シーケンス()が付加される。
Next, consider the processing speed of the present invention. The present invention includes, in addition to the operation of the circuit shown in FIG. 4, a sequence () for counting N samples, a sequence () for adding the contents of the register 20b and the square of the input data by the adder 20a, and an addition result. The sequence () that stores the value in the register 20b and the register when the Nth sample is reached
The content of 20b is controlled to be stored in the register 1, the content of the register 20b is cleared after the storage, and the sequence () for storing the conventional output value in the register 1 is added in other sequences.

,はそれぞれ1マシンサイクル、は約10マシン
サイクル、は約7マシンサイクルで、合計約19サイク
ルの増となる。従来が約9マシンサイクルで実行してい
た場合を考慮して、本発明では約28マシンサイクルとな
る。従来の第3図に示す回路の場合にはNに比例してマ
シンサイクルが増加し、3Nマシンサイクルを必要として
いたことに比べると、本発明ではNの値の如何に拘らず
28マシンサイクルで処理が可能となる。本発明では、N
が大きい場合でも演算速度の大幅な向上が図れる。
, Is 1 machine cycle, is about 10 machine cycles, is about 7 machine cycles, which is a total increase of about 19 cycles. In consideration of the case where the conventional process is executed in about 9 machine cycles, the number of machine cycles is 28 machine cycles in the present invention. In the case of the conventional circuit shown in FIG. 3, the number of machine cycles increases in proportion to N, and 3N machine cycles are required, but in the present invention, regardless of the value of N,
It can be processed in 28 machine cycles. In the present invention, N
Even if is large, the calculation speed can be significantly improved.

一方、ハード的にも、第4図の回路に比較してレジス
タがレジスタ1,2,3の3個からレジスタ20bの1個の増加
ですみ、従来回路と比較しても殆ど増加しない。メモリ
を削減したことにより、落雷等によって電源電圧が変動
した場合でも、その影響を受ける確率を4/Nに減少する
ことが可能であり、メモリ(レジスタ)が破壊されても
一定時間内に正しく動作し直すことができる。
On the other hand, in terms of hardware, the number of registers is increased from three registers 1, 2, and 3 to one register 20b as compared with the circuit of FIG. 4, and there is almost no increase compared with the conventional circuit. By reducing the memory, even if the power supply voltage fluctuates due to lightning, it is possible to reduce the probability of being affected to 4 / N, and even if the memory (register) is destroyed, it will be correct within a certain time. Can work again.

上述の説明では、累積加算器20として加算器20aとレ
ジスタ20bの組合わせを用いた場合を例にとったが、本
発明はこれに限るものではなく、繰返し演算により累積
加算結果を得るものであれば、どのようなものであって
もよい。また、演算器3′も乗算器に限らず、複数個の
データに対してある演算を行うものであればどのような
ものであってもよい。
In the above description, the case where the combination of the adder 20a and the register 20b is used as the cumulative adder 20 is taken as an example, but the present invention is not limited to this, and the cumulative addition result can be obtained by iterative calculation. If it is, it may be anything. Further, the arithmetic unit 3'is not limited to the multiplier, but may be any unit as long as it performs a certain arithmetic operation on a plurality of data.

[発明の効果] 以上、詳細に説明したように、本発明によれば(2)
式による累積演算結果を得る一方で、Nサンプルのデー
タの累積加算を行う累積加算器により入力データの累積
加算を求めておき、Nサンプルに1回だけこの加算結果
を(2)式の演算回路のレジスタにセットするように構
成することにより、簡単なハード構成で2乗和の累積加
算演算を確実に行うことができる。
EFFECTS OF THE INVENTION As described in detail above, according to the present invention (2)
While obtaining the cumulative calculation result by the formula, the cumulative addition of the input data is obtained by the cumulative adder that performs the cumulative addition of the data of N samples, and the calculation result of the calculation formula (2) is obtained only once every N samples. By configuring the register to be set in the register, the cumulative addition operation of the sum of squares can be reliably performed with a simple hardware configuration.

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

第1図は本発明の原理ブロック図、 第2図は本発明の一実施例を示す構成ブロック図、 第3図は従来回路の構成ブロック図、 第4図は従来回路の他の構成ブロック図である。 第1図において、 3′は演算器、 10,11,12はレジスタ、 13は加算器、 14は減算器、 20は累積加算器、 21はスイッチである。 1 is a block diagram showing the principle of the present invention, FIG. 2 is a block diagram showing a configuration of an embodiment of the present invention, FIG. 3 is a block diagram showing a conventional circuit, and FIG. 4 is a block diagram showing another configuration of the conventional circuit. Is. In FIG. 1, 3'is an arithmetic unit, 10,11,12 are registers, 13 is an adder, 14 is a subtractor, 20 is a cumulative adder, and 21 is a switch.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】入力データの演算を行う演算器と、 該演算器の出力を受けてNサンプルの演算結果の累積加
算を行なう累積加算器と、 1サンプル前の累積加算結果を保持する第1のレジスタ
と、 前記演算器の出力を受けて現時点の入力データの演算結
果を保持する第2のレジスタと、 前記演算器の出力を受けてN+1サンプル前の演算結果
を保持する第3のレジスタと、 第1のレジスタ及び第2のレジスタの出力を加算する加
算器と、 該加算器の出力から第3のレジスタの出力を減算する減
算器と、 通常は減算器の出力を第1のレジスタに接続し、Nサン
プルに1回だけ累積加算器の出力を第1のレジスタに接
続すると共に前記累積加算器をクリアする切り換え手段
とによりなり、前記減算器の出力をその出力とする演算
回路。
1. A computing unit for computing input data, a cumulative adder for receiving the output of the computing unit and cumulatively adding the computation results of N samples, and a first holding unit for holding the cumulative addition result of one sample before. A second register for receiving the output of the arithmetic unit and holding the arithmetic result of the current input data; and a third register for receiving the output of the arithmetic unit and holding the arithmetic result N + 1 samples before. , An adder for adding the outputs of the first register and the second register, a subtractor for subtracting the output of the third register from the output of the adder, and usually the output of the subtractor for the first register Arithmetic circuit which connects the output of the cumulative adder to the first register once every N samples and clears the cumulative adder, and uses the output of the subtractor as its output.
JP1179793A 1989-07-11 1989-07-11 Arithmetic circuit Expired - Fee Related JP2530916B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1179793A JP2530916B2 (en) 1989-07-11 1989-07-11 Arithmetic circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1179793A JP2530916B2 (en) 1989-07-11 1989-07-11 Arithmetic circuit

Publications (2)

Publication Number Publication Date
JPH0343863A JPH0343863A (en) 1991-02-25
JP2530916B2 true JP2530916B2 (en) 1996-09-04

Family

ID=16071993

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1179793A Expired - Fee Related JP2530916B2 (en) 1989-07-11 1989-07-11 Arithmetic circuit

Country Status (1)

Country Link
JP (1) JP2530916B2 (en)

Also Published As

Publication number Publication date
JPH0343863A (en) 1991-02-25

Similar Documents

Publication Publication Date Title
EP0136834A2 (en) A digital circuit performing an arithmetic operation with an overflow
GB2330226A (en) Digital signal processor for performing fixed-point and/or integer arithmetic
JPH0661792A (en) Digital filter
US6182100B1 (en) Method and system for performing a logarithmic estimation within a data processing system
WO1986002181A1 (en) A digital signal processor for single cycle multiply/accumulation
JP2530916B2 (en) Arithmetic circuit
KR100382018B1 (en) Processor device
JPS5834037B2 (en) address calculation device
JPS63187366A (en) Arithmetic unit for moving average
JP3334901B2 (en) Programmable controller
RU2694743C1 (en) Digital signal processor with system of commands vliw
KR100335252B1 (en) Fast digital filter
US6314132B1 (en) Microprocessor structure and method for implementing digital filter operations
JP3953220B2 (en) Euclidean mutual division method execution circuit and arithmetic circuit
SU1658150A2 (en) Device for square root extraction
SU962926A1 (en) Device for taking logarithms
CN116248088A (en) Data delay method, device, circuit, electronic equipment and readable storage medium
SU1765830A1 (en) Device for finding extremum of multivariable additive function
JPH0816366A (en) Divider and dividing method for the same
JP2651300B2 (en) Timer circuit
JPH06152330A (en) Digital filter
SU1591042A1 (en) Interpolator
RU2020757C1 (en) Device for calculating absolute values of square remainders
SU915095A1 (en) Analyzing filter of digital vocoder
SU788363A1 (en) Digital frequency multiplier

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees