JPH06103304A - Method and circuit for digital arithmetic - Google Patents

Method and circuit for digital arithmetic

Info

Publication number
JPH06103304A
JPH06103304A JP25308992A JP25308992A JPH06103304A JP H06103304 A JPH06103304 A JP H06103304A JP 25308992 A JP25308992 A JP 25308992A JP 25308992 A JP25308992 A JP 25308992A JP H06103304 A JPH06103304 A JP H06103304A
Authority
JP
Japan
Prior art keywords
circuit
rounding
arithmetic circuit
arithmetic
digital
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
JP25308992A
Other languages
Japanese (ja)
Inventor
Mitsuharu Oki
光晴 大木
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.)
Sony Corp
Original Assignee
Sony Corp
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 Sony Corp filed Critical Sony Corp
Priority to JP25308992A priority Critical patent/JPH06103304A/en
Publication of JPH06103304A publication Critical patent/JPH06103304A/en
Pending legal-status Critical Current

Links

Landscapes

  • Complex Calculations (AREA)

Abstract

PURPOSE:To eliminate deviation from the result of ideal calculation by subtracting deviation generated by a 1st rounding circuit before rounding by a 2nd rounding circuit. CONSTITUTION:Four data A, B, C, and D are inputted to a 1st arithmetic circuit (multipliers 1 and 2), and two primary inner products G=AXB and H=CXD are calculated and outputted. Then, G and H are rounded by 1st rounding circuits R11 and R12 to proper word length and then inputted to a 2nd arithmetic circuit (multipliers 3 and 4 and adder 5). Four data in total, i.e., data E and F which are newly inputted from outside and output data I and J of the 1st rounding circuits R11 and R12 are used to calculate a secondary inner products M=IXE+JXF, which is outputted. An error correcting circuit 6 consists of one subtracter and subtracts the error correction quantity S from the output M of the 2nd arithmetic circuit. This subtraction value N is rounded by the 2nd rounding circuit R2 to eliminate the deviation from the result of the ideal calculation. Then P is a calculation result which is finally obtained.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、ディジタル信号処理に
おける丸め計算を行うディジタル演算方法及び回路に関
するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a digital operation method and circuit for performing rounding calculation in digital signal processing.

【0002】[0002]

【従来の技術】ディジタル信号処理において複数の演算
処理は一般的によく行われる。例えば2つの演算処理を
行うことを考えてみることにする。この演算処理を実際
の回路で実現する場合、2つの演算回路を必要とする。
即ち1つめの演算処理を行う第1の演算回路L1及び2
つめの演算処理を行う第2の演算回路L2を用いて、そ
れらを直列に接続して、第1の演算回路L1に入力デー
タを入力し、そして第2の演算回路L2から出力データ
を取り出すことにより実現している。
2. Description of the Related Art In digital signal processing, a plurality of arithmetic processes are commonly performed. Consider, for example, performing two arithmetic processes. When this arithmetic processing is realized by an actual circuit, two arithmetic circuits are required.
That is, the first arithmetic circuits L1 and 2 for performing the first arithmetic processing
Using a second arithmetic circuit L2 for performing the third arithmetic process, connecting them in series, inputting input data to the first arithmetic circuit L1, and extracting output data from the second arithmetic circuit L2. It is realized by.

【0003】従って回路図は図4に示す図となる。図4
において、INは入力データを入力するための入力端子
であり、OUTは出力データを出力するための出力端子
である。またこの例では一般的に演算を行うことにより
出力データは語長が長くなっているので、下位数ビット
を丸めて(四捨五入して)語長を短くして出力する必要
があり、出力段に丸め回路(図中のR)を有している。
Therefore, the circuit diagram is shown in FIG. Figure 4
In, IN is an input terminal for inputting input data, and OUT is an output terminal for outputting output data. Also, in this example, the word length of the output data is generally long due to the calculation, so it is necessary to round (round off) the lower few bits and shorten the word length before outputting. It has a rounding circuit (R in the figure).

【0004】ところでこの回路において、丸め回路は最
終段に1つのみであり、演算途中では丸めによる誤差は
混入しない。即ち理想的な演算回路である。
By the way, in this circuit, only one rounding circuit is provided in the final stage, and no error due to rounding is mixed in during the calculation. That is, it is an ideal arithmetic circuit.

【0005】図4に示す演算の例としては、例えば2次
元離散コサイン変換(Discrete Cosin
Transform:DCT)が知られている。即ち第
1の演算回路L1において縦方向の1次元DCTを計算
し、その後第2の演算回路L2において横方向の1次元
DCTを計算させればよい。
An example of the operation shown in FIG. 4 is, for example, a two-dimensional discrete cosine transform (Discrete Cosin).
Transform (DCT) is known. That is, the first arithmetic circuit L1 may calculate the vertical one-dimensional DCT, and then the second arithmetic circuit L2 may calculate the horizontal one-dimensional DCT.

【0006】さて実は図4はあまり実現性のある回路と
は言えない。なぜなら第1の演算回路L1での出力は1
つめの演算を行うことにより語長が長くなっており、こ
れにより、第1の演算回路L1の出力が第2の演算回路
L2の入力に直接に入力されているので、第2の演算回
路L2の入力データの語長が長くなり過ぎてしまうから
である。つまり入力語長の短いデータに対する演算回路
はその回路規模が小さくて済むが、図4の第2の演算回
路L2のように入力語長の長いデータに対する演算回路
はその回路規模が非現実的なほど大きくなってしまうた
め、実現性のない回路構成となってしまう。
Actually, FIG. 4 cannot be said to be a circuit having a high possibility of being realized. Because the output of the first arithmetic circuit L1 is 1
The word length is lengthened by performing the third arithmetic operation, whereby the output of the first arithmetic circuit L1 is directly input to the input of the second arithmetic circuit L2. This is because the word length of the input data of becomes too long. In other words, the circuit scale of the arithmetic circuit for the data having a short input word length can be small, but the circuit scale of the arithmetic circuit for the data having a long input word length is unrealistic like the second arithmetic circuit L2 in FIG. Since it becomes so large, the circuit configuration becomes unrealizable.

【0007】そこで図5に示すような実現性のある回路
がよく用いられている。図5においては、第1の丸め回
路R1と第2の丸め回路R2の合計2つを用いて、第1
の演算回路L1の出力である長い語長のデータを第1の
丸め回路R1で下位数ビット丸めて短い語長にして第2
の演算回路L2に入力している。従って第2の演算回路
L2への入力データは比較的短くなり、第2の演算回路
L2の回路規模は大きくならずに済む。第2の演算回路
L2の出力も当然2つめの演算を行うことにより語長が
伸びるので、第2の丸め回路R2で下位数ビット丸めて
所望の語長にして出力端子OUTより出力する。
Therefore, a feasible circuit as shown in FIG. 5 is often used. In FIG. 5, the first rounding circuit R1 and the second rounding circuit R2 are used in total to make the first rounding circuit R1.
The long word length data output from the arithmetic circuit L1 is rounded by the first rounding circuit R1 to the lower few bits to make a short word length.
Is input to the arithmetic circuit L2. Therefore, the input data to the second arithmetic circuit L2 becomes relatively short, and the circuit scale of the second arithmetic circuit L2 does not become large. Since the word length of the output of the second arithmetic circuit L2 is naturally extended by performing the second arithmetic operation, the second rounding circuit R2 rounds the lower few bits to the desired word length and outputs it from the output terminal OUT.

【0008】従来の回路構成(図5)の欠点を述べるた
めに、さらに具体例を用いて以降で説明していく。即ち
図6に示すように第1の演算回路L1として2つの1次
内積演算(乗算器1、2)、第2の演算回路L2として
1つの2次内積演算(乗算器3、4、加算器5)の場合
について説明していく。
In order to describe the drawbacks of the conventional circuit configuration (FIG. 5), a specific example will be used for the following description. That is, as shown in FIG. 6, two first-order inner product operations (multipliers 1 and 2) as the first operation circuit L1 and one second inner-product operation (multipliers 3 and 4 and adder as the second operation circuit L2). The case of 5) will be described.

【0009】第1の演算回路の入力データとして、A
(8ビット語長)、B(8ビット語長)、C(8ビット
語長)、D(8ビット語長)の4つのデータとし、2つ
の1次内積演算 G=A×B H=C×D を計算し、第1の演算回路からG、Hを出力する。ちな
みに1次内積演算とは単なる1つの乗算である。G、H
はそれぞれ8ビット同士の乗算結果であるので、16ビ
ット語長となる。この計算における語長を図示したもの
が、図7−ア、イである。
As input data of the first arithmetic circuit, A
(8-bit word length), B (8-bit word length), C (8-bit word length), D (8-bit word length), and four primary inner product operations G = A × B H = C XD is calculated, and G and H are output from the first arithmetic circuit. Incidentally, the first-order inner product operation is just one multiplication. G, H
Is a multiplication result of 8 bits each, and therefore has a 16-bit word length. The word lengths used in this calculation are shown in FIGS.

【0010】第1の演算回路の出力であるG、Hは16
ビットと語長が長いため、直接に第2の演算回路に入力
すると、第2の演算回路の回路規模が大きくなり過ぎて
しまう。そこでG、Hは適切な語長(例えば10ビッ
ト)に丸められてから第2の演算回路に入力する。即ち
第1の丸め回路R11、R12により、 I=Gの下位6ビット丸め J=Hの下位6ビット丸め として、I、Jを第2の演算回路に入力する。この計算
における語長を図示したものが、図7−ウ、エである。
The outputs G and H of the first arithmetic circuit are 16
Since the bit and the word length are long, if directly input to the second arithmetic circuit, the circuit scale of the second arithmetic circuit becomes too large. Therefore, G and H are rounded to an appropriate word length (for example, 10 bits) and then input to the second arithmetic circuit. That is, the first rounding circuits R11 and R12 input I and J to the second arithmetic circuit as I = G lower 6-bit rounding and J = H lower 6-bit rounding. The word lengths used in this calculation are shown in FIGS.

【0011】第2の演算回路の入力データとして、外部
から新たに入力されるデータE(8ビット語長)、F
(8ビット語長)、及び、第1の丸め回路R11、R1
2の出力データI、Jの合計4つのデータとし、2次内
積演算 M=I×E+J×F を計算し、第2の演算回路からMを出力する。
Data E (8-bit word length) and F newly input from the outside as input data of the second arithmetic circuit.
(8-bit word length) and the first rounding circuits R11 and R1
The output data I and J of 2 are used as a total of four data, and a secondary inner product operation M = I × E + J × F is calculated, and M is output from the second arithmetic circuit.

【0012】また、K=I×E、L=J×Fとする。
K、Lは、それぞれ10ビットと8ビットの乗算結果で
あるので18ビット語長となる。M=K+Lは18ビッ
ト同士の加算結果であるので19ビット語長となる。第
2の演算回路内の2つの乗算器3、4は(10ビット語
長)×(8ビット語長)の計算を行う。この計算におけ
る語長を図示したものが、図7−オ、カ、キである。
Further, K = I × E and L = J × F.
Since K and L are the multiplication results of 10 bits and 8 bits, respectively, they have an 18-bit word length. Since M = K + L is the addition result of 18 bits, the word length is 19 bits. The two multipliers 3 and 4 in the second arithmetic circuit perform the calculation of (10-bit word length) × (8-bit word length). The word lengths used in this calculation are shown in FIG.

【0013】第2の演算回路の出力であるMは所望の語
長(例えば9ビット)に丸めらてから、出力結果として
取り出される。即ち第2の丸め回路R2により、 Q=Mの下位10ビット丸め として、Qを出力結果として取り出す。この計算におけ
る語長を図示したものが、図7−クである。
The output M of the second arithmetic circuit is rounded to a desired word length (for example, 9 bits) and then taken out as an output result. That is, the second rounding circuit R2 rounds out the lower 10 bits of Q = M and extracts Q as an output result. The word length in this calculation is shown in FIG.

【0014】参考までに、もし第1の丸め回路R11、
R12を省き、第1の演算回路の出力G、Hを直接に第
1の演算回路に入力すると、第2の演算回路内の2つの
乗算器3、4は(16ビット語長)×(8ビット語長)
という計算を行わなくてはいけない。これでは乗算器の
回路規模が大きくなり過ぎてしまう。従って、第1の演
算回路の出力結果の語長を短くする必要があり、そのた
めに第1の丸め回路R11、R12が設けられている。
For reference, if the first rounding circuit R11,
When R12 is omitted and the outputs G and H of the first arithmetic circuit are directly input to the first arithmetic circuit, the two multipliers 3 and 4 in the second arithmetic circuit are (16-bit word length) × (8 Bit word length)
Must be calculated. This would make the circuit scale of the multiplier too large. Therefore, it is necessary to shorten the word length of the output result of the first arithmetic circuit, and therefore the first rounding circuits R11 and R12 are provided.

【0015】さて丸めについて詳しく説明する。例えば
小数点以下3桁の2進数:X.YZV(Xは整数部、Y
は小数点以下第1位の数で0または1、Zは小数点以下
第2位の数で0または1、Vは小数点以下第3位の数で
0または1)を、下位3ビット丸めて整数部のみを出力
する場合を考える。
Now, the rounding will be described in detail. For example, a binary number with three digits after the decimal point: X. YZV (X is an integer part, Y
Is the number after the decimal point is 0 or 1, Z is the number after the decimal point is 0 or 1, and V is the number after the decimal point is 0 or 1) Consider the case of outputting only.

【0016】この時、 (X−1).100 (X−1).101 (X−1).110 (X−1).111 X.000 X.001 X.010 X.011 の8個の値は、全てXという整数に丸められる。他の値
についても同様である。この様子を図9に示す。
At this time, (X-1). 100 (X-1). 101 (X-1). 110 (X-1). 111 X. 000 X. 001 X. 010 X. The eight values of 011 are all rounded to the integer X. The same applies to other values. This state is shown in FIG.

【0017】ところで、上述の8個の値、 (X−1).100 (X−1).101 (X−1).110 (X−1).111 X.000 X.001 X.010 X.011 の平均値は、 {(X−1).100}×(1/8) +{(X−1).101}×(1/8) +{(X−1).110}×(1/8) +{(X−1).111}×(1/8) +{ X.000}×(1/8) +{ X.001}×(1/8) +{ X.010}×(1/8) +{ X.011}×(1/8) =(X−1).0001 である。このように各丸め回路で丸められた値と平均値
の間には0.0001分の違いを生じる。
By the way, the above eight values, (X-1). 100 (X-1). 101 (X-1). 110 (X-1). 111 X. 000 X. 001 X. 010 X. The average value of 011 is {(X-1). 100} * (1/8) + {(X-1). 101} * (1/8) + {(X-1). 110} * (1/8) + {(X-1). 111} × (1/8) + {X. 000} × (1/8) + {X. 001} x (1/8) + {X. 010} x (1/8) + {X. 011} x (1/8) = (X-1). It is 0001. In this way, there is a difference of 0.0001 minutes between the rounded value and the average value in each rounding circuit.

【0018】従って図6に示す回路に、A、B、C、
D、E、Fを乱数的に与えて、その出力結果Qの平均値
をみると、[{(A×B)×E+(C×D)×F}を計
算した後9ビットに丸めた値]の平均値と僅かにずれて
しまう。
Therefore, in the circuit shown in FIG. 6, A, B, C,
D, E, and F are given at random, and the average value of the output result Q is looked at. The value obtained by calculating [{(A × B) × E + (C × D) × F} and then rounding to 9 bits ] Is slightly deviated from the average value.

【0019】これは第1の丸め回路(R11、R12)
によりG、Hをそれぞれ丸めてI、Jにするときに、上
述に示したごとくG、Hの平均値からずれてしまうため
である。つまり、図8−ケ、コに示すg、h分の差をそ
れぞれ生じるためである。
This is the first rounding circuit (R11, R12).
This is because when G and H are rounded to I and J, respectively, they deviate from the average values of G and H as described above. That is, the difference between g and h shown in FIGS.

【0020】[0020]

【発明が解決しようとする課題】解決しようとする問題
点は、従来の回路構成(図6)で計算された値[Qの平
均値]は、第1の演算回路と第2の演算回路の間で丸め
を行わない、回路規模は非現実的になるが理想的な計算
の結果[{(A×B)×E+(C×D)×F}を計算し
た後9ビットに丸めた値の平均値]とは、ずれてしまう
というものである。
The problem to be solved is that the value [average value of Q] calculated by the conventional circuit configuration (FIG. 6) is the same as that of the first arithmetic circuit and the second arithmetic circuit. No rounding is performed, the circuit scale becomes unrealistic, but the ideal calculation result [{(A × B) × E + (C × D) × F} is calculated and then rounded to 9 bits. [Average value] means that there is a deviation.

【0021】[0021]

【課題を解決するための手段】本発明による第1の手段
は、ディジタルデータの演算過程でn(nは2以上)回
の丸め演算を行うディジタル演算方法において、1回目
の上記丸め演算を除く全ての丸め演算の前段で誤差補正
分を減算させることを特徴とするディジタル演算方法で
ある。
The first means of the present invention is a digital operation method in which n (n is 2 or more) rounding operations are performed in the process of operating digital data, except the first rounding operation. This is a digital operation method characterized in that the error correction amount is subtracted before all rounding operations.

【0022】本発明による第2の手段は、上記誤差補正
分はE×g(但し、Eは前段の演算に新たに入力される
データ、gは前々段の演算の出力の最小値の1/2に相
当する値)であることを特徴とする第1の手段記載のデ
ィジタル演算方法である。
According to the second means of the present invention, the error correction amount is E × g (where E is data newly input to the operation of the previous stage, g is 1 which is the minimum value of the output of the operation of the previous stage). Is a value corresponding to / 2).

【0023】本発明による第3の手段は、ディジタルデ
ータの演算過程でn(nは2以上)回の丸め演算回路
(R11、R12、R2)を有するディジタル演算回路
において、1回目の上記丸め演算回路を除く全ての丸め
演算回路の前段に誤差補正分を減算させる誤差補正回路
6を設けたことを特徴とするディジタル演算回路であ
る。
The third means according to the present invention is the first rounding operation in a digital operation circuit having rounding operation circuits (R11, R12, R2) n (n is 2 or more) times in an operation process of digital data. The digital arithmetic circuit is characterized in that an error correction circuit 6 for subtracting the error correction amount is provided in the preceding stage of all the rounding arithmetic circuits except the circuits.

【0024】本発明による第4の手段は、上記誤差補正
分はE×g(但し、Eは前段の演算回路(乗算器3、
4)に新たに入力されるデータ、gは前々段の演算回路
(乗算器1、2)の出力の最小値の1/2に相当する
値)であることを特徴とする第3の手段記載のディジタ
ル演算回路である。
In a fourth means according to the present invention, the error correction amount is E × g (where E is an arithmetic circuit (multiplier 3,
4) The data newly input to g, g is a value corresponding to ½ of the minimum value of the output of the arithmetic circuit (multipliers 1 and 2) at the previous stage before the third means. It is the described digital arithmetic circuit.

【0025】[0025]

【作用】これによれば、第1の丸め回路により生じたず
れ分を第2の丸め回路で丸める前に誤差補正回路にて引
くことによって、理想的な計算の結果とのずれをなくす
ことができる。
According to this, the deviation caused by the first rounding circuit is subtracted by the error correction circuit before being rounded by the second rounding circuit, thereby eliminating the deviation from the ideal calculation result. it can.

【0026】[0026]

【実施例】本発明の一実施例を図1に示す。図1は従来
例(図6)に誤差補正回路6が付加された以外は同じで
あり、その説明は重複するので省略する。また誤差補正
回路6は1つの減算器よりなり、第2の演算回路の出力
MにS=E×g+F×hを減算するための回路である。
FIG. 1 shows an embodiment of the present invention. 1 is the same as the conventional example (FIG. 6) except that an error correction circuit 6 is added, and the description thereof will be omitted to avoid duplication. The error correction circuit 6 is composed of one subtractor and is a circuit for subtracting S = E × g + F × h from the output M of the second arithmetic circuit.

【0027】ここでSは、詳しくは後述するが、従来の
問題点であった[ずれ分]であり、本発明においてはこ
の[ずれ分(S)]を誤差補正回路6にて減算すること
によりずれを補正できるので、理想的な計算の結果
[{(A×B)×E+(C×D)×F}を計算した後9
ビットに丸めた値の平均値]とのずれはなくなる。
Although S will be described in detail later, S is a [deviation amount] which has been a problem in the prior art. In the present invention, this [deviation amount (S)] is subtracted by the error correction circuit 6. Since the deviation can be corrected by, 9 after calculating the ideal calculation result [{(A × B) × E + (C × D) × F}
The average value of the values rounded to bits] is eliminated.

【0028】図1についてさらに詳しく説明をする。図
1における記号A、B、C、D、E、F、G、H、I、
J、K、L、Mは、従来例(図6)において述べたもの
と同じであり、その説明を省略する。即ち、図7−ア〜
カに示す関係がある。
Further details of FIG. 1 will be described. Symbols A, B, C, D, E, F, G, H, I in FIG.
J, K, L, and M are the same as those described in the conventional example (FIG. 6), and the description thereof will be omitted. That is, FIG.
There is a relationship shown to mosquitoes.

【0029】さて従来のところで述べたように、図8−
ケ、コに示す関係 Gの平均値=Iの平均値−g(gは定数) Hの平均値=Jの平均値−h(hは定数) がある。
Now, as described in the conventional section, FIG.
There is a mean value of G = mean value of I−g (g is a constant), and a mean value of H = mean value of J−h (h is a constant).

【0030】従って、 (G×E)の平均値=(I×E)の平均値−(g×E)
の平均値 (H×F)の平均値=(J×F)の平均値−(h×F)
の平均値 である。
Therefore, the average value of (G × E) = the average value of (I × E) − (g × E)
Average value of (H × F) average value = (J × F) average value− (h × F)
Is the average value of.

【0031】故に、 {(A×B)×E+(C×D)×F}の平均値 (G×E+H×F)の平均値 ={(I×E+J×F)の平均値}−{(g×E+h×
F)の平均値} ={(K+L)の平均値}−{(g×E+h×F)の平
均値} ={Mの平均値}−{(g×E+h×F)の平均値} である。
Therefore, the average value of {(A × B) × E + (C × D) × F} The average value of (G × E + H × F) = {the average value of (I × E + J × F)}-{( g × E + h ×
F) average value} = {(K + L) average value}-{(g × E + h × F) average value} = {M average value}-{(g × E + h × F) average value} .

【0032】つまり、第1の演算回路と第2の演算回路
の間で丸めを行わない、回路規模は非現実的になるが理
想的な計算の結果[{(A×B)×E+(C×D)×
F}を計算した後9ビットに丸めた値の平均値]は、
[{M−(g×E+h×F)}を計算した後9ビットに
丸めた値の平均値]と等しくなる。
That is, without rounding between the first arithmetic circuit and the second arithmetic circuit, the circuit scale becomes unrealistic but the ideal calculation result [{(A × B) × E + (C × D) ×
The average value of the values rounded to 9 bits after calculating F}] is
It becomes equal to [average value of values rounded to 9 bits after calculating {M− (g × E + h × F)}].

【0033】図1において、Mから[ずれ分(S=g×
E+h×F)]を誤差補正回路6にて減算すること(N
=M−S)により、 Nの平均値={(A×B)×E+(C×D)×F}の平
均値 となる。
In FIG. 1, [deviation from M (S = g ×
E + h × F)] is subtracted by the error correction circuit 6 (N
= M−S), the average value of N = {(A × B) × E + (C × D) × F}.

【0034】この値Nを第2の丸め回路R2にて9ビッ
トに丸めることで、理想的な計算の結果[{(A×B)
×E+(C×D)×F}を計算した後9ビットに丸めた
値の平均値]とのずれはなくなる。本発明における、誤
差補正回路6及び第2の丸め回路R2における計算を図
2−サ、シに示す。なお図1及び図2−シにおけるPが
最終的に得られる計算結果である。
By rounding this value N to 9 bits by the second rounding circuit R2, the ideal calculation result [{(A × B)
XE + (C × D) × F} is calculated and then the average value of values rounded to 9 bits] is eliminated. Calculations in the error correction circuit 6 and the second rounding circuit R2 in the present invention are shown in FIGS. Note that P in FIGS. 1 and 2 is the calculation result finally obtained.

【0035】誤差補正回路6で減算する値Sは、外部か
ら入力されるデータE、Fにより変化する値、即ちS=
g×E+h×Fでもよいし、またS=g×(Eの平均
値)+h×(Fの平均値)=定数でもよい。
The value S subtracted by the error correction circuit 6 is a value that changes depending on the data E and F input from the outside, that is, S =
It may be g × E + h × F, or S = g × (average value of E) + h × (average value of F) = constant.

【0036】さらに第2の演算回路の後段の加算器5と
誤差補正回路6の減算器をまとめて、1つの3入力加減
算器で計算を行っても良い。即ちM=K+Lを計算する
加算器とN=M−Sを計算する減算器の代わりに、N=
K+L−Sを計算する3入力加減算器を用いても良い。
Further, the adder 5 and the subtractor of the error correction circuit 6 in the subsequent stage of the second arithmetic circuit may be combined and the calculation may be performed by one 3-input adder / subtractor. That is, instead of an adder for calculating M = K + L and a subtractor for calculating N = MS, N =
A three-input adder / subtractor that calculates K + LS may be used.

【0037】こうして上述の装置によれば、第1の丸め
回路R11、R12により生じたずれ分(図8−ケ、コ
のg、h)を第2の丸め回路R2で丸める前に誤差補正
回路6にて引く(S=E×g+F×hを減算する)こと
によって、理想的な計算の結果[{(A×B)×E+
(C×D)×F}を計算した後9ビットに丸めた値の平
均値]とのずれをなくすことができるものである。
Thus, according to the above-described apparatus, the error correction circuit is provided before the second rounding circuit R2 rounds the shift amount (FIG. 8-C, g, h) generated by the first rounding circuits R11 and R12. By subtracting 6 (subtracting S = E × g + F × h), the ideal calculation result [{(A × B) × E +
[C × D) × F} is calculated and then rounded to 9 bits].

【0038】さらに図3に、図1を一般化した回路図を
示す。これは丁度従来例(図5)に対応する本発明の実
施例である。
Further, FIG. 3 shows a generalized circuit diagram of FIG. This is just an embodiment of the present invention corresponding to the conventional example (FIG. 5).

【0039】[0039]

【発明の効果】この発明によれば、第1の丸め回路によ
り生じたずれ分を第2の丸め回路で丸める前に誤差補正
回路にて引くことによって、理想的な計算の結果とのず
れをなくすことができるようになった。
According to the present invention, the deviation caused by the first rounding circuit is subtracted by the error correction circuit before being rounded by the second rounding circuit, so that the deviation from the ideal calculation result can be obtained. I can now lose it.

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

【図1】本発明によるディジタル演算回路の一例の構成
図である。
FIG. 1 is a configuration diagram of an example of a digital arithmetic circuit according to the present invention.

【図2】その説明のための図である。FIG. 2 is a diagram for explaining the explanation.

【図3】本発明によるディジタル演算回路を一般化した
構成図である。
FIG. 3 is a generalized block diagram of a digital arithmetic circuit according to the present invention.

【図4】2つの演算処理を行うための非現実的ではある
が理想的な回路図である。
FIG. 4 is an unrealistic but ideal circuit diagram for performing two arithmetic processes.

【図5】従来の現実的な回路図である。FIG. 5 is a conventional realistic circuit diagram.

【図6】従来のディジタル演算回路の回路図である。FIG. 6 is a circuit diagram of a conventional digital arithmetic circuit.

【図7】その説明のための図である。FIG. 7 is a diagram for explaining the explanation.

【図8】その説明のための図である。FIG. 8 is a diagram for explaining the explanation.

【図9】丸めの説明のための図である。FIG. 9 is a diagram for explaining rounding.

【符号の説明】[Explanation of symbols]

1、2 第1の演算回路を構成する乗算器 3、4 第2の演算回路を構成する乗算器 5 第2の演算回路を構成する加算器 6 誤差補正回路(減算器) R11、R12 第1の丸め回路 R2 第2の丸め回路 1, 2 Multiplier that constitutes the first arithmetic circuit 3, 4 Multiplier that constitutes the second arithmetic circuit 5 Adder that constitutes the second arithmetic circuit 6 Error correction circuit (subtractor) R11, R12 1st Rounding circuit R2 Second rounding circuit

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 ディジタルデータの演算過程でn(nは
2以上)回の丸め演算を行うディジタル演算方法におい
て、 1回目の上記丸め演算を除く全ての丸め演算の前段で誤
差補正分を減算させることを特徴とするディジタル演算
方法。
1. A digital calculation method for performing rounding calculation n times (n is 2 or more) in a process of calculating digital data, wherein an error correction amount is subtracted in a stage before all rounding calculations except the first rounding calculation. A digital operation method characterized by the above.
【請求項2】 上記誤差補正分はE×g(但し、Eは前
段の演算に新たに入力されるデータ、gは前々段の演算
の出力の最小値の1/2に相当する値)であることを特
徴とする請求項1記載のディジタル演算方法。
2. The error correction amount is E × g (where E is data newly input to the operation of the previous stage, and g is a value corresponding to ½ of the minimum value of the output of the operation of the previous stage). The digital operation method according to claim 1, wherein
【請求項3】 ディジタルデータの演算過程でn(nは
2以上)回の丸め演算回路を有するディジタル演算回路
において、 1回目の上記丸め演算回路を除く全ての丸め演算回路の
前段に誤差補正分を減算させる誤差補正回路を設けたこ
とを特徴とするディジタル演算回路。
3. A digital arithmetic circuit having a rounding arithmetic circuit n times (n is 2 or more) in a digital data arithmetic process, wherein an error correction component is provided in a preceding stage of all the rounding arithmetic circuits except the first rounding arithmetic circuit. A digital arithmetic circuit characterized in that an error correction circuit for subtracting is provided.
【請求項4】 上記誤差補正分はE×g(但し、Eは前
段の演算回路に新たに入力されるデータ、gは前々段の
演算回路の出力の最小値の1/2に相当する値)である
ことを特徴とする請求項3記載のディジタル演算回路。
4. The error correction amount is E × g (where E is data newly input to the arithmetic circuit of the preceding stage, g is equivalent to ½ of the minimum value of the output of the arithmetic circuit of the preceding stage). 4. The digital arithmetic circuit according to claim 3, wherein the digital arithmetic circuit is a value.
JP25308992A 1992-09-22 1992-09-22 Method and circuit for digital arithmetic Pending JPH06103304A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP25308992A JPH06103304A (en) 1992-09-22 1992-09-22 Method and circuit for digital arithmetic

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP25308992A JPH06103304A (en) 1992-09-22 1992-09-22 Method and circuit for digital arithmetic

Publications (1)

Publication Number Publication Date
JPH06103304A true JPH06103304A (en) 1994-04-15

Family

ID=17246341

Family Applications (1)

Application Number Title Priority Date Filing Date
JP25308992A Pending JPH06103304A (en) 1992-09-22 1992-09-22 Method and circuit for digital arithmetic

Country Status (1)

Country Link
JP (1) JPH06103304A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6010063A (en) * 1996-10-31 2000-01-04 Nec Corporation Multiplying method with a round-off function and circuitry therefor

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6010063A (en) * 1996-10-31 2000-01-04 Nec Corporation Multiplying method with a round-off function and circuitry therefor

Similar Documents

Publication Publication Date Title
US4381547A (en) Picture deforming process
US5181184A (en) Apparatus for multiplying real-time 2's complement code in a digital signal processing system and a method for the same
US5745399A (en) Decimal arithmetic apparatus and method
JPH06103304A (en) Method and circuit for digital arithmetic
JPH07283737A (en) Filter method of digital value array and circuit device
US5463572A (en) Multi-nary and logic device
US11494165B2 (en) Arithmetic circuit for performing product-sum arithmetic
KR0146656B1 (en) Multi-nary or logic device
EP0279419A2 (en) Image signal binary encoder
US5485413A (en) Multiplier utilizing the booth algorithm
JPH02287874A (en) Product sum arithmetic unit
JP3071607B2 (en) Multiplication circuit
KR0182169B1 (en) Log arithmathic value calculator
KR950010822B1 (en) Exclusive logic adding system and its method of binary level logic and multiple level logic
JP2869668B2 (en) Discrete Fourier or cosine transform device for digital data
GB2067799A (en) Improvements in or Relating to Digital Filters
KR0146654B1 (en) Multi-nary exclusive or logic device
RU2096911C1 (en) Digital filter
JPS62182841A (en) Square root arithmetic system
JPH0241051B2 (en) SAIKINCHIHANTEIKAIRO
JP2000347834A (en) Arithmetic circuit by sw number system
JP3230349B2 (en) Decimal multiplier
KR950010823B1 (en) Exclusive logic adding system and its method of binary level logic and multiple level logic
JPS58119046A (en) Adder and subtracter
JPH05108308A (en) Multiplication circuit