JPH0651956A - Difference absolute value cumulative adder circuit - Google Patents

Difference absolute value cumulative adder circuit

Info

Publication number
JPH0651956A
JPH0651956A JP5114997A JP11499793A JPH0651956A JP H0651956 A JPH0651956 A JP H0651956A JP 5114997 A JP5114997 A JP 5114997A JP 11499793 A JP11499793 A JP 11499793A JP H0651956 A JPH0651956 A JP H0651956A
Authority
JP
Japan
Prior art keywords
adder
bit
input
absolute value
circuit
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
JP5114997A
Other languages
Japanese (ja)
Inventor
Munehiro Uratani
宗宏 浦谷
Aoi Kitaura
あおい 北浦
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.)
Sharp Corp
Original Assignee
Sharp 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 Sharp Corp filed Critical Sharp Corp
Priority to JP5114997A priority Critical patent/JPH0651956A/en
Publication of JPH0651956A publication Critical patent/JPH0651956A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To provide a difference absolute value cumulative adder circuit in which the whole circuit scale can be decreased when the amount of data and the number of bits of the data in each adder is equal, respectively, and the amount of input data or the number of bits can be increased when the circuit scale is equal by reducing the required number of adders. CONSTITUTION:Difference absolute value arithmetic circuits 101-10N each are comprised of subtractors which find the difference value of two numerals consisting of (i) bits and a bit inversion switching circuit which outputs a subtraction result as it is when no borrow-output is issued from the subtractor and finds the (complement on 1) of a difference absolute value by inverting a bit of subtraction result when the borrow-output is issued. A multi-input adder 112 inputs a borrow to the least significant bit, and also, adds the computed result of each difference absolute value arithmetic circuit, and the adder 113 adds the output value of the multi-input adder 112 cumulatively.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、2つのデータの相関性
を求める場合などに用いられる差分絶対値累積加算回路
に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a differential absolute value cumulative addition circuit used for obtaining a correlation between two data.

【0002】[0002]

【従来の技術】従来、たとえば画像処理技術分野で、2
つの画像データのパターンマッチングなどを行う際に、
両画像データの相関性が求められる。画像データの相関
性は、2つの画像データにおける同一座標の画素データ
の差分の絶対値を各画素毎に求め、それらを累積加算す
ることによって求められる。たとえば、図7において、
画面Aおよび画面Bで表す2つの画像データの相関性を
求める場合、(A1−B1)、(A2−B2)、(A3
−B3)、…、(AK−BK)、…の絶対値をそれぞれ
順に求め、それらの差分絶対値を累積加算することによ
って、1つの相関性を表す値を求めることができる。A
1〜AK,B1〜BKは、各座標の画素データの階調の
値を表す。添字1〜Kを省略してAおよびBとし、画像
データとして総括的に示すことがある。このような演算
処理は、特に動画像符号化手法であるフレーム間の動き
ベクトル検出の必須技術である。
2. Description of the Related Art Conventionally, for example, in the field of image processing technology, 2
When performing pattern matching of two image data,
Correlation between both image data is required. The correlation of the image data is obtained by obtaining the absolute value of the difference between the pixel data of the same coordinates in the two image data for each pixel and cumulatively adding them. For example, in FIG.
When obtaining the correlation between two image data represented by screen A and screen B, (A1-B1), (A2-B2), (A3
-B3), ..., (AK-BK), ... Absolute values are sequentially obtained, and the absolute values of the differences are cumulatively added to obtain a value representing one correlation. A
1 to AK and B1 to BK represent gradation values of pixel data at each coordinate. The subscripts 1 to K may be omitted and designated as A and B, which may be collectively shown as image data. Such arithmetic processing is an essential technique for motion vector detection between frames, which is a moving image coding method.

【0003】ここで、従来の差分絶対値累積加算回路の
構成を図8に示す。図8において、A1,A2,…,A
Nは、それぞれiビットから成るN個の第1のデータで
あり、これはたとえば図7に示した画面Aの画像データ
のうちA1〜ANのN個の画素データに相当する。ま
た、図8において、B1,B2,…,BNはそれぞれi
ビットから成るN個の第2のデータであり、これは図7
に示した画面Bの画像データのうちB1〜BNのN個の
画素データに相当する。ここで、一般にN<Kである。
また、図8において、差分絶対値演算器11はA1−B
1の絶対値を求め、差分絶対値演算器12はA2−B2
の絶対値を求め、差分絶対値演算器1NはAN−BNの
絶対値を求める。多入力加算器2は、N個の差分絶対値
演算器11,12,…,1Nの出力を全て加算する。加
算器3は、多入力加算器2の加算結果をアキュームレー
タ4に一時格納し、次の多入力加算器2の加算結果が入
力されると、その加算結果をアキュームレータ4の値に
対し加算する。このようにして、加算器3は、多入力加
算器2の演算結果を累積加算することができる。したが
って、以上のような回路を用いて、画面Aおよび画面B
の画像データの変化に伴い、画素データA1,A2,
…,ANおよび画素データB1,B2,…,BNを順次
入力することによって、加算器3は、差分絶対値累積加
算結果を求めることができる。
FIG. 8 shows the configuration of a conventional differential absolute value cumulative addition circuit. In FIG. 8, A1, A2, ..., A
N is N first data each consisting of i bits, which corresponds to N pixel data A1 to AN among the image data of the screen A shown in FIG. 7, for example. Further, in FIG. 8, B1, B2, ..., BN are i
It is N second data consisting of bits, which is shown in FIG.
It corresponds to N pixel data B1 to BN of the image data of the screen B shown in FIG. Here, generally N <K.
Further, in FIG. 8, the absolute difference calculator 11 is A1-B.
1, the absolute value of the difference is calculated by A2-B2.
The absolute value of the difference is calculated, and the difference absolute value calculator 1N calculates the absolute value of AN-BN. The multi-input adder 2 adds all the outputs of the N absolute difference value calculators 11, 12, ..., 1N. The adder 3 temporarily stores the addition result of the multi-input adder 2 in the accumulator 4, and when the addition result of the next multi-input adder 2 is input, the addition result is added to the value of the accumulator 4. In this way, the adder 3 can cumulatively add the calculation results of the multi-input adder 2. Therefore, using the circuit as described above, the screen A and the screen B are
Of the pixel data A1, A2,
, AN and pixel data B1, B2, ..., BN are sequentially input, the adder 3 can obtain the difference absolute value cumulative addition result.

【0004】次に、図8に示した差分絶対値演算器1
1,12,…,1Nの異なる2つの構成例を図9および
図10に示す。iビット減算器5は、A−Bの減算を行
う減算器であり、iビット反転器6は、iビット減算器
5から出力されるiビットの減算結果の各ビットを反転
する反転器(インバータ)である。このiビット反転器
6と、+1インクリメンタ7とによって「2の補数」を
求める。セレクタ8は、減算器5の減算結果が正(符号
=0)のとき、減算器5の減算結果をそのまま出力し、
減算結果が負(符号=1)の場合には、減算結果の「2
の補数」を出力する。このことによって、A−Bの絶対
値を求める。
Next, the absolute difference value calculator 1 shown in FIG.
9 and 10 show two different configuration examples of 1, 12, ..., 1N. The i-bit subtractor 5 is a subtractor that performs a subtraction of AB, and the i-bit inverter 6 is an inverter (inverter) that inverts each bit of the i-bit subtraction result output from the i-bit subtractor 5. ). The "2's complement" is obtained by the i-bit inverter 6 and the +1 incrementer 7. When the subtraction result of the subtractor 5 is positive (sign = 0), the selector 8 outputs the subtraction result of the subtractor 5 as it is,
If the subtraction result is negative (sign = 1), the subtraction result “2
Is output. By this, the absolute value of AB is obtained.

【0005】図10において、減算器5はA−Bの減算
を行い、減算器9はB−Aの減算を行う。セレクタ8
は、減算器5の減算結果が正(符号=0)のとき、減算
器5の減算結果をそのまま出力し、減算器5の減算結果
が負(符号=1)のときには、減算器9の減算結果が正
になるまで減算器9の減算結果を出力する。このことに
よって、A−Bの絶対値を求める。
In FIG. 10, the subtractor 5 subtracts AB, and the subtractor 9 subtracts BA. Selector 8
When the subtraction result of the subtractor 5 is positive (sign = 0), the subtraction result of the subtractor 5 is output as it is, and when the subtraction result of the subtractor 5 is negative (sign = 1), the subtraction of the subtractor 9 is performed. The subtraction result of the subtractor 9 is output until the result becomes positive. By this, the absolute value of AB is obtained.

【0006】図11は、図9および図10に示した差分
絶対値演算器の減算器5および減算器9の回路構成例を
示す。減算器5および減算器9は、i個の加算器(フル
アダー、略称「FA」)21〜2iで構成され、各加算
器21〜2iでキャリーが発生したとき、キャリーが発
生した加算器のキャリー出力端子Cから上位ビットの加
算器のキャリー入力端子C0へキャリーが出力される。
加算器21〜2iの入力端子Uには、被減数である入力
データa11〜a1iが入力され、入力端子Vには減数
である入力データb11〜b1iの値が反転(「1」の
とき「0」になり、「0」のとき「1」になる。)され
て入力され、最下位ビットのキャリー入力端子C0には
1が入力され、入力データb11〜b1iの反転した値
に1が加算される。したがって、入力データa11〜a
1iと入力データb11〜b1iの「2の補数」とが加
算されるので、すなわち入力データa11〜a1iと入
力データb11〜b1iとの減算が行われる。減算した
結果、加算器21〜2iの出力端子Sおよび最上位ビッ
トの加算器2iのキャリー出力端子から減算値S1〜S
iおよびキャリーCiが出力される。減算結果が正のと
き、キャリーCiは1になり、負の場合はキャリーCi
は0になるので、このキャリーCiによって符号を判断
することができる。
FIG. 11 shows an example of the circuit configuration of the subtracter 5 and the subtractor 9 of the difference absolute value calculator shown in FIGS. 9 and 10. The subtractor 5 and the subtractor 9 are composed of i adders (full adders, abbreviated as “FA”) 21 to 2i, and when a carry occurs in each of the adders 21 to 2i, the carry of the adder in which the carry occurs The carry is output from the output terminal C to the carry input terminal C0 of the adder for the upper bits.
Input data a11 to a1i, which are the minuends, are input to the input terminals U of the adders 21 to 2i, and the values of the input data b11 to b1i, which are the subtraction, are inverted to the input terminal V (when it is "1", "0" , And becomes "1" when it is "0".) Is input, 1 is input to the carry input terminal C0 of the least significant bit, and 1 is added to the inverted value of the input data b11 to b1i. . Therefore, the input data a11 to a
1i and the “two's complement” of the input data b11 to b1i are added, that is, the input data a11 to a1i and the input data b11 to b1i are subtracted. As a result of the subtraction, the subtracted values S1 to S from the output terminals S of the adders 21 to 2i and the carry output terminals of the most significant bit adder 2i.
i and carry Ci are output. The carry Ci is 1 when the subtraction result is positive, and the carry Ci is negative when the result is negative.
Becomes 0, the code can be judged by this carry Ci.

【0007】図12は、図9に示した差分絶対値演算器
の+1インクリメンタ7の回路構成例を示す。+1イン
クリメンタ7は、i個の加算器(フルアダー、略称「F
A」)31〜3iから構成され、各加算器31〜3iで
キャリーが発生したとき、キャリーの発生した加算器の
キャリー出力端子C0から上位ビットの加算を行う加算
器のキャリー入力端子Cへキャリーが出力される。加算
器31〜3iの入力端子Uには、被加数である入力デー
タa21〜a2iが入力され、最下位ビットの加算器3
1の入力端子Vには、加数である1が入力され、その他
の上位ビット加算器32〜3iの入力端子Vは0に固定
され、加算が行われる。加算した結果、ビット加算器3
1〜3iの出力端子Sおよび最上位ビット加算器3iの
キャリー端子Cから、加算値S11〜S1iおよびキャ
リーC1iが出力される。最下位ビットの加算器31の
キャリー入力端子C0の入力データは、0に固定され
る。
FIG. 12 shows an example of the circuit configuration of the +1 incrementer 7 of the difference absolute value calculator shown in FIG. The +1 incrementer 7 includes i adders (full adder, abbreviated as “F”).
A ”) 31 to 3i, and when a carry occurs in each of the adders 31 to 3i, a carry is carried from the carry output terminal C0 of the adder in which the carry is generated to the carry input terminal C of the adder for performing the addition of the upper bit. Is output. Input data a21 to a2i, which are augends, are input to the input terminals U of the adders 31 to 3i, and the adder 3 of the least significant bit is input.
The adder 1 is input to the input terminal V of 1 and the input terminals V of the other high-order bit adders 32 to 3i are fixed to 0 and addition is performed. Bit adder 3 as a result of addition
The addition values S11 to S1i and the carry C1i are output from the output terminals S of 1 to 3i and the carry terminal C of the most significant bit adder 3i. The input data of the carry input terminal C0 of the adder 31 of the least significant bit is fixed at 0.

【0008】図13は、図8に示した多入力加算器2の
構成を示す。図13において、第1ビット加算器41、
第2ビット加算器42、…、第iビット加算器4iはそ
れぞれ第1ビット、第2ビット、…、第iビットについ
て|A−B|の加算を行う。|A−B|iは、|A−B
|の第iビット目の値を表す。ここで、第iビット加算
器4i〜第1ビット加算器41はそれぞれ入力数Nの多
入力加算器であり、たとえば第iビット加算器4iはN
個の差分絶対値演算器11〜1Nから出力される各演算
結果の第iビットを加算し、第1ビット加算器はN個の
差分絶対値演算器11〜1Nから出力される各演算結果
の第1ビットを加算する。
FIG. 13 shows the configuration of the multi-input adder 2 shown in FIG. In FIG. 13, the first bit adder 41,
The second bit adder 42, ..., The i-th bit adder 4i add | AB | for the first bit, the second bit ,. | AB | i is | AB
Represents the value of the i-th bit of |. Here, each of the i-th bit adder 4i to the first-bit adder 41 is a multi-input adder having an input number N. For example, the i-th bit adder 4i is N
The i-th bit of each operation result output from each of the absolute difference value calculators 11 to 1N is added, and the first bit adder adds the i-th bit of each operation result output from the N difference absolute value calculators 11 to 1N. Add the first bit.

【0009】このような多入力加算器としては、Wallac
e Tree 加算回路を用いることができる。ここで、たと
えば8入力の多入力加算器の構成例を図14に示す。8
入力加算器50は、8入力 Wallace Tree 加算回路51
と、2入力の高速加算器(Carry Look Ahead 加算器)
52とで構成され、8入力 Wallace Tree 加算回路51
の回路図を図15に示す。
As such a multi-input adder, Wallac
An e Tree adder circuit can be used. Here, FIG. 14 shows a configuration example of a multi-input adder having, for example, 8 inputs. 8
The input adder 50 is an 8-input Wallace Tree adder circuit 51.
And 2-input high-speed adder (Carry Look Ahead adder)
8 input Wallace Tree adder circuit 51
FIG. 15 shows a circuit diagram of the above.

【0010】8入力 Wallace Tree 加算回路51は、第
1ビット加算器61〜第8ビット加算器68から構成さ
れ、第n(nは1〜8の整数)ビット加算器では、第n
ビットの入力データdn1〜dn8が入力される。各ビ
ット加算器61〜68は、図15で示されるように、基
本的には3入力の複数の加算器(略称「FA」)から構
成され、その加算器では入力データおよび下位ビット加
算器からのキャリー入力の加算を順次行い、キャリーが
発生すれば上位ビット加算器へ出力する。各ビット加算
器61〜68の加算器は、図15で示されるように、ツ
リー状に配置され、順次入力数を減らしてゆき、最終的
には、各ビット加算器61〜68におけるキャリーC2
1〜2Aと加算値S21〜2Aを算出し、出力する。こ
のようにして、各ビット加算器において、加算を行うこ
とによって、加算器の数を削減することができ、効率的
に加算を行うことができる。
The 8-input Wallace Tree adder circuit 51 is composed of a first bit adder 61 to an eighth bit adder 68, and an nth (n is an integer of 1 to 8) bit adder is an nth bit adder.
Bit input data dn1 to dn8 are input. As shown in FIG. 15, each of the bit adders 61 to 68 is basically composed of a plurality of three-input adders (abbreviated as “FA”), and the adder includes input data and a lower bit adder. The carry inputs are sequentially added, and if a carry occurs, the carry input is output to the upper bit adder. The adders of the bit adders 61 to 68 are arranged in a tree shape as shown in FIG. 15, and the number of inputs is sequentially reduced, and finally, the carry C2 in each of the bit adders 61 to 68.
1-2A and addition value S21-2A are calculated and output. By thus performing addition in each bit adder, the number of adders can be reduced, and addition can be performed efficiently.

【0011】たとえば、第4ビット加算器64において
は、加算器71は、入力データd41〜d43の加算を
行い、加算器72は、入力データd44〜d46の加算
を行い、加算器73は、入力データd47,d48の加
算を行う。加算器71〜73は、入力データd41〜d
48を加算した結果、その加算値Sを加算器74,75
へ出力し、キャリーCを第5ビット加算器65へ出力す
る。加算器74は、第3ビット加算器63から入力され
るキャリーCと加算器71から入力される加算値Sとの
加算を行い、加算器75は第3ビット加算器63からの
入力されるキャリーCと加算器72,73から入力され
る加算値Sとの加算を行う。
For example, in the fourth bit adder 64, the adder 71 adds input data d41 to d43, the adder 72 adds input data d44 to d46, and the adder 73 inputs The data d47 and d48 are added. The adders 71 to 73 input the input data d41 to d.
As a result of adding 48, the added value S is added to the adders 74 and 75.
And carry C to the fifth bit adder 65. The adder 74 adds the carry C input from the third bit adder 63 and the added value S input from the adder 71, and the adder 75 adds the carry C input from the third bit adder 63. C is added to the added value S input from the adders 72 and 73.

【0012】加算器74は、前述のデータを加算した結
果、その加算値Sを加算器77へ出力し、キャリーCを
第5ビット加算器65へ出力する。加算器75は、前述
のデータを加算した結果、その加算値Sを加算器76へ
出力し、キャリーCを第5ビット加算器65へ出力す
る。加算器76は、第3ビット加算器63から入力され
るキャリーCと加算器75から入力される加算値Sとの
加算を行い、その加算値Sを加算器77へ出力し、キャ
リーCが発生すれば、第5ビット加算器65へ出力す
る。加算器77は、第3ビット加算器63から入力され
るキャリーCと、加算器74および加算器76から入力
される加算値Sとの加算を行い、第4ビットにおける加
算値S24とキャリーC24を出力する。また、第4ビ
ット加算器〜第7ビット加算器の回路構成は同一であ
る。
As a result of adding the above-mentioned data, the adder 74 outputs the addition value S to the adder 77 and the carry C to the fifth bit adder 65. As a result of adding the above-mentioned data, the adder 75 outputs the addition value S to the adder 76 and the carry C to the fifth bit adder 65. The adder 76 adds the carry C input from the third bit adder 63 and the addition value S input from the adder 75, outputs the addition value S to the adder 77, and the carry C is generated. If it does, it outputs to the 5th bit adder 65. The adder 77 adds the carry C input from the third bit adder 63 and the addition value S input from the adders 74 and 76 to obtain the addition value S24 and the carry C24 at the fourth bit. Output. The circuit configurations of the fourth bit adder to the seventh bit adder are the same.

【0013】このようにして、各ビット加算器において
加算を行うけれども、第8ビット加算器68において発
生したキャリーCについて順次そのキャリーCの加算を
行い、加算器81〜83は、第9ビットの加算を行い、
加算器84においては第10ビットの加算を行う。次
に、第1ビット加算器61〜第8ビット加算器68の各
加算器で求めた加算値S21〜S2AとキャリーC21
〜C2Aは、図8で示されるように、2入力の高速加算
器52によって順次累積加算が行われ、最終的な加算値
を最大11ビットで出力する。
In this way, although the addition is performed in each bit adder, the carry C generated in the eighth bit adder 68 is sequentially added, and the adders 81 to 83 add the ninth bit. And add
The adder 84 adds the 10th bit. Next, the addition values S21 to S2A obtained by the adders of the first bit adder 61 to the eighth bit adder 68 and the carry C21.
8 to C2A, as shown in FIG. 8, the 2-input high-speed adder 52 sequentially performs cumulative addition, and outputs a final addition value with a maximum of 11 bits.

【0014】図13で示される多入力加算回路2におい
ても、図15の8入力加算回路50と同様な加算が行わ
れ、第1ビット加算器41〜第iビット加算器4iの各
加算器で求まった加算値SとキャリーCは、図6で示さ
れるように Carry LookAhead 加算器などの高速加算器
30によって累積加算が行われ、最終的な多入力加算回
路2の加算結果|A−B|を、加算器3へ出力すること
ができる。 CarryLook Ahead 加算器40は、加数と被
加数の各ビット毎の加算を行うと同時に、キャリーの計
算を独立して行うことによって加算処理速度を向上させ
ている。
Also in the multi-input adder circuit 2 shown in FIG. 13, the same addition as in the 8-input adder circuit 50 of FIG. 15 is performed, and each of the first bit adder 41 to the i-th bit adder 4i is added. The added value S and the carry C obtained are cumulatively added by a high-speed adder 30 such as a Carry LookAhead adder as shown in FIG. 6, and the final addition result | AB of the multi-input adder circuit 2 is obtained. Can be output to the adder 3. The CarryLook Ahead adder 40 improves the addition processing speed by performing addition of each bit of the addend and the augend and performing the carry calculation independently.

【0015】[0015]

【発明が解決しようとする課題】このように、従来の差
分絶対値累積加算回路においては、差分絶対値演算器1
1〜1Nを図9のように構成した場合、入力データの各
ビット毎に加算器が必要なため、図11で示されるよう
に、加算器の個数はiビット減算器にi個、図12で示
されるように+1インクリメンタにi個で合計2i個必
要であり、また図10に示した構成にする場合にも、1
つのiビット減算器にi個の加算器を設けるため、2つ
合わせて2i個の加算器が必要となる。そのため、図8
に示したN個の差分絶対値演算器11〜1Nが使用され
る差分絶対値累積加算回路においては、差分絶対値演算
部分についてだけでも2Ni個の加算器が必要となる。
As described above, in the conventional difference absolute value cumulative addition circuit, the difference absolute value calculator 1 is used.
When 1 to 1N are configured as shown in FIG. 9, an adder is required for each bit of the input data. Therefore, as shown in FIG. 11, the number of adders is i for the i-bit subtractor, and FIG. As shown in FIG. 10, +1 incrementer requires i in total of 2i, and in the case of the configuration shown in FIG.
Since one i-bit subtractor is provided with i adders, a total of 2i adders are required. Therefore, FIG.
In the difference absolute value cumulative addition circuit in which the N difference absolute value calculators 11 to 1N shown in (1) are used, 2Ni adders are required even only for the difference absolute value calculation part.

【0016】このように従来の差分絶対値累積加算回路
においては、多数の加算器を必要とするため、全体の回
路規模が大きくなり、入力データのデータ数および各デ
ータのビット数をあまり大きくできないという問題があ
った。
As described above, in the conventional differential absolute value cumulative addition circuit, since a large number of adders are required, the overall circuit scale becomes large, and the data number of input data and the bit number of each data cannot be increased so much. There was a problem.

【0017】本発明の目的は、加算器の必要個数を減少
させて、データ数および各データのビット数が同一であ
る場合には全体の回路規模を削減し、また同一回路規模
である場合には入力データ数またはビット数を増大でき
るようにした差分絶対値累積加算回路を提供することで
ある。
An object of the present invention is to reduce the required number of adders, to reduce the overall circuit scale when the number of data and the number of bits of each data are the same, and to reduce the total circuit scale. Is to provide a difference absolute value cumulative addition circuit capable of increasing the number of input data or the number of bits.

【0018】[0018]

【課題を解決するための手段】本発明は、それぞれiビ
ットから成る2数の差分値を求めるiビット減算器と、
前記iビット減算器からボロー出力がないとき前記iビ
ット減算器の減算結果をそのまま出力し、前記iビット
減算器からボロー出力があるとき前記iビット減算器の
減算結果をビット反転して出力するビット反転切換回路
とを含む複数の差分絶対値演算回路と、各差分絶対値演
算回路のボローを最下位ビットとして入力するととも
に、各差分絶対値演算回路の減算結果を加算する多入力
加算回路と、前記多入力加算回路の出力を累積加算する
累積加算回路とを含むことを特徴とする差分絶対値累積
加算回路である。
SUMMARY OF THE INVENTION The present invention comprises an i-bit subtractor for determining two difference values each consisting of i-bits,
When there is no borrow output from the i-bit subtractor, the subtraction result of the i-bit subtractor is output as it is, and when there is borrow output from the i-bit subtractor, the subtraction result of the i-bit subtractor is bit-inverted and output. A plurality of differential absolute value arithmetic circuits including a bit inversion switching circuit, and a multi-input adder circuit that inputs the borrow of each differential absolute value arithmetic circuit as the least significant bit and adds the subtraction result of each differential absolute value arithmetic circuit And a cumulative addition circuit that cumulatively adds the outputs of the multi-input addition circuit.

【0019】[0019]

【作用】本発明に従えば、差分絶対値累積加算回路は、
複数の差分絶対値演算回路と多入力加算回路および累積
加算回路から成る。各差分絶対値演算回路のiビット減
算器は、それぞれiビットから成る2数の差分値を求
め、ビット反転切換回路は、iビット減算器からボロー
出力がないときiビット減算器の減算結果をそのまま出
力し、前記ボロー出力があるときiビット減算器の減算
結果をビット反転して出力する。したがって、ボロー出
力がないときには、そのまま前記2数の差分絶対値が出
力され、ボロー出力があるときには、前記2数の差分値
の「1の補数」が出力されることになる。一方、多入力
加算回路が各差分絶対値演算回路のボローを最下位ビッ
トとして入力するとともに、各差分絶対値演算回路の演
算結果を加算する。差分絶対値演算回路からボローが出
力された場合には、その差分絶対値演算回路の演算結果
は2数の差分値の「1の補数」であるから、その最下位
ビットにボロー、すなわち1を加算することは、差分値
の「2の補数」とをとることに相当し、2数の差分絶対
値を加算した場合と等しくなる。なお、差分絶対値演算
回路からボロー出力がない場合には、最下位ビットに0
が加算されるだけであるから、正しく2数の差分絶対値
が加算されることになる。このようにして、多入力加算
回路は、それぞれ対をなす複数のデータについて、差分
絶対値の加算結果を求める。そして、累積加算回路は、
多入力加算回路の出力を累積加算することによって、差
分絶対値累積加算結果を求める。
According to the present invention, the absolute difference cumulative addition circuit is
It is composed of a plurality of absolute difference value calculation circuits, a multi-input addition circuit, and a cumulative addition circuit. The i-bit subtractor of each difference absolute value calculation circuit obtains two difference values each consisting of i-bits, and the bit inversion switching circuit outputs the subtraction result of the i-bit subtractor when there is no borrow output from the i-bit subtractor. When the borrow output is present, the subtraction result of the i-bit subtractor is bit-inverted and output. Therefore, when there is no borrow output, the difference absolute value of the two numbers is output as it is, and when there is a borrow output, the “1's complement” of the difference value of the two numbers is output. On the other hand, the multi-input adder circuit inputs the borrow of each difference absolute value operation circuit as the least significant bit and adds the operation results of each difference absolute value operation circuit. When a borrow is output from the difference absolute value calculation circuit, the calculation result of the difference absolute value calculation circuit is the “1's complement” of the difference value between two numbers, so a borrow, that is, 1 is set to the least significant bit. Adding is equivalent to taking the “two's complement” of the difference value, and is equivalent to adding two difference absolute values. If there is no borrow output from the difference absolute value calculation circuit, the least significant bit is set to 0.
Is added, the two absolute difference values are correctly added. In this way, the multi-input addition circuit obtains the addition result of the absolute difference values for each of a plurality of pairs of data. And the cumulative addition circuit
The output of the multi-input adder circuit is cumulatively added to obtain the difference absolute value cumulative addition result.

【0020】[0020]

【実施例】この発明の実施例である差分絶対値累積加算
回路の構成を図1に示す。図1において、X1,X2,
…,XNは、それぞれiビットから成るN個の第1の入
力データ、Y1,Y2,…,YNは、それぞれiビット
から成るN個の第2の入力データである。差分絶対値演
算器101,102,…,10Nは、従来例として図8
に示した差分絶対値演算器11,12,…,1Nとは異
なり、後述するように、ボローとともに、2数の差分絶
対値または2数の差分値の「1の補数」を出力する。多
入力加算器112は、各差分絶対値演算器101,10
2,…,10Nから出力されるiビットの減算結果を入
力して加算するとともに、各差分絶対値演算器101,
102,…,10Nから出力されるボローb1,b2,
…,bNを、多入力加算器112の最下位ビット加算器
に入力して加算する。
FIG. 1 shows the configuration of a differential absolute value cumulative addition circuit according to an embodiment of the present invention. In FIG. 1, X1, X2,
, XN are N first input data each consisting of i bits, and Y1, Y2, ..., YN are N second input data each consisting of i bits. The absolute difference calculators 101, 102, ..., 10N are shown in FIG.
Unlike the absolute difference value calculators 11, 12, ..., 1N shown in FIG. 1, as will be described later, it outputs two differential absolute values or “one's complement” of two differential values together with borrow. The multi-input adder 112 includes the difference absolute value calculators 101, 10
2, ..., 10N, the i-bit subtraction results are input and added, and the difference absolute value calculators 101,
102, ..., borrows b1, b2 output from 10N
, BN are input to the least significant bit adder of the multi-input adder 112 and added.

【0021】加算器113は、多入力加算器112の加
算結果をアキュームレータ114に一時格納し、次の多
入力加算器112の加算結果が入力されると、その加算
結果をアキュームレータ114の値に対して加算する。
したがって、このような回路を用いて、第1入力データ
X1,X2,…,XN、第2入力データY1,Y2,
…,YNを順次入力することによって、加算器113
は、差分絶対値累積加算結果を求めることができる。第
1入力データX1〜XNおよび第2入力データY1〜Y
Nの添字1〜Nを省略して、XおよびYとし、入力デー
タとして総括的に示すことがある。
The adder 113 temporarily stores the addition result of the multi-input adder 112 in the accumulator 114. When the addition result of the next multi-input adder 112 is input, the addition result is compared with the value of the accumulator 114. And add.
Therefore, by using such a circuit, the first input data X1, X2, ..., XN and the second input data Y1, Y2,
, YN are sequentially input to adder 113
Can obtain the difference absolute value cumulative addition result. First input data X1 to XN and second input data Y1 to Y
The suffixes 1 to N of N may be omitted and designated as X and Y, which may be collectively shown as input data.

【0022】図2は、図1に示した差分絶対値演算器1
01〜10Nの構成を示す。図2において、減算器11
5はX−Yの演算を行う減算器で、ビット反転器(イン
バータ)116は減算器115から出力されるiビット
の減算結果の各ビットを反転する。セレクタ118は、
減算器115の減算結果が正(ボローb=0)であると
き、X−Yの値をそのまま出力し、減算器115の減算
結果が負(ボローb=1)であるとき、ビット反転器1
16によりビット反転された値すなわちX−Yの「1の
補数」をボローとともに出力する。ここでは、差分絶対
値演算器101〜10Nの出力をまとめて|X−Y|で
表す。
FIG. 2 is a difference absolute value calculator 1 shown in FIG.
The structure of 01-10N is shown. In FIG. 2, the subtractor 11
Reference numeral 5 denotes a subtracter for performing an X-Y operation, and a bit inverter (inverter) 116 inverts each bit of the i-bit subtraction result output from the subtractor 115. The selector 118 is
When the subtraction result of the subtractor 115 is positive (borrow b = 0), the XY value is output as it is, and when the subtraction result of the subtractor 115 is negative (borrow b = 1), the bit inverter 1
The value bit-inverted by 16, that is, the "1's complement" of XY is output together with borrow. Here, the outputs of the absolute difference value calculators 101 to 10N are collectively represented by | X−Y |.

【0023】図3は、図2に示した差分絶対値演算器の
減算器115の回路構成例を示す。減算器115は、i
個の加算器(フルアダー、略称「FA」)121〜12
iで構成され、各加算器121〜12iでキャリーが発
生したとき、キャリーが発生した加算器のキャリー出力
端子Cから上位ビットの加算器のキャリー入力端子C0
へキャリーが出力される。加算器121〜12iの入力
端子Uには、被減数である入力データx11〜x1iが
入力され、入力端子Vには減数である入力データy11
〜y1iの値が反転(「1」のとき「0」になり、
「0」のとき「1」になる。)されて入力される。最下
位ビットのキャリー入力端子C0には1が入力され、入
力データy11〜y1iの反転した値に1が加算され
る。したがって、入力データx11〜x1iと入力デー
タy11〜y1iの「2の補数」とが加算されるので、
すなわち入力データx11〜x1iと入力データy11
〜y1iとの減算が行われる。減算した結果、加算器1
21〜12iの出力端子Sおよび最上位ビットの加算器
12iのキャリー出力端子から減算値S51〜S5iお
よびキャリーC5iが出力される。減算結果が正のと
き、キャリーC5iは1になり、負の場合はキャリーC
5iは0になるので、このキャリーC5iによって符号
を判断することができる。
FIG. 3 shows a circuit configuration example of the subtractor 115 of the difference absolute value calculator shown in FIG. The subtractor 115 uses i
Adders (full adder, abbreviated as “FA”) 121 to 12
i, and when a carry occurs in each of the adders 121 to 12i, the carry output terminal C of the adder in which the carry occurs to the carry input terminal C0 of the adder of the higher bit.
The carry is output. Input data x11 to x1i, which are the minuends, are input to the input terminals U of the adders 121 to 12i, and input data y11, which is the subtraction, are input to the input terminal V.
~ The value of y1i is inverted (when it is "1", it becomes "0",
When it is "0", it becomes "1". ) Is input. 1 is input to the carry input terminal C0 of the least significant bit, and 1 is added to the inverted value of the input data y11 to y1i. Therefore, since the input data x11 to x1i and the “two's complement” of the input data y11 to y1i are added,
That is, the input data x11 to x1i and the input data y11
~ Y1i is subtracted. Result of subtraction, adder 1
Subtracted values S51 to S5i and carry C5i are output from the output terminals S of 21 to 12i and the carry output terminal of the most significant bit adder 12i. The carry C5i becomes 1 when the subtraction result is positive, and the carry C5i when the subtraction result is negative.
Since 5i becomes 0, the code can be determined by this carry C5i.

【0024】図4は、図1に示した多入力加算器112
の構成を示す。図4において、第1ビット加算器13
1、第2ビット加算器132、…、第iビット加算器1
3iはそれぞれ第1ビット、第2ビット、…、第iビッ
トについて|X−Y|の加算を行う。|X−Y|iは、
|X−Y|の第iビット目の値を示す。ここで、第iビ
ット加算器13i〜第2ビット加算器132はそれぞれ
入力数Nの多入力加算器であり、たとえば第iビット加
算器13iはN個の差分絶対値演算器101〜10Nか
ら出力される各演算結果の第iビットを加算し、第2ビ
ット加算器132はN個の差分絶対値演算器101〜1
0Nから出力される各演算結果の第2ビットを加算す
る。第1ビット加算器131は、入力数2Nの多入力加
算器であり、N個の差分絶対値演算器から出力される各
演算結果の第1ビットとともに、各差分絶対値演算器か
ら出力されるボローb1,b2,…,bNを加算する。
FIG. 4 shows the multi-input adder 112 shown in FIG.
Shows the configuration of. In FIG. 4, the first bit adder 13
1, 2nd bit adder 132, ..., i-th bit adder 1
3i performs | X−Y | addition for the first bit, the second bit, ..., And the i-th bit, respectively. | X−Y | i is
The value of the i-th bit of | X−Y | is shown. Here, each of the i-th bit adder 13i to the second bit adder 132 is a multi-input adder having the number of inputs N. For example, the i-th bit adder 13i outputs from the N difference absolute value calculators 101 to 10N. The i-th bit of each calculated result is added, and the second bit adder 132 outputs N difference absolute value calculators 101 to 1
The second bit of each operation result output from 0N is added. The first bit adder 131 is a multi-input adder with 2N inputs, and is output from each difference absolute value calculator together with the first bit of each calculation result output from the N difference absolute value calculators. The borrows b1, b2, ..., BN are added.

【0025】このように、多入力加算器112におい
て、差分絶対値演算回路101〜10Nからボローが出
力されたとき、差分絶対値演算回路から出力される演算
結果の「1の補数」とともに、そのボローを加算してい
るので、演算結果の「2の補数」をとることに相当し、
演算結果の絶対値を得ることができる。
In this way, in the multi-input adder 112, when the borrow is output from the difference absolute value operation circuits 101 to 10N, the operation result "1's complement" output from the difference absolute value operation circuit and its Since borrow is added, it is equivalent to taking the "2's complement" of the operation result,
The absolute value of the calculation result can be obtained.

【0026】このような多入力加算器としては、Wallac
e Tree 加算回路を用いることができる。ここで、たと
えば8入力の多入力加算器の構成例を図5に示す。ただ
し、第1ビット加算器は、ボローが入力されるので、入
力データの数は16である。8入力加算器150は、8
入力 Wallace Tree 加算回路151と、高速加算器(Ca
rry Look Ahead 加算器)152で構成され、8入力 Wa
llace Tree 加算回路151の回路図を図6に示す。
As such a multi-input adder, Wallac
An e Tree adder circuit can be used. Here, for example, a configuration example of an 8-input multi-input adder is shown in FIG. However, since the borrow is input to the first bit adder, the number of input data is 16. The 8-input adder 150 has 8
Input Wallace Tree Adder circuit 151 and high-speed adder (Ca
rry Look Ahead adder) 152, 8 input Wa
A circuit diagram of the llace Tree adder circuit 151 is shown in FIG.

【0027】8入力 Wallace Tree 加算回路151は、
第1ビット加算器161〜第8ビット加算器168から
構成され、第1ビット加算器を除く第n(nは2〜8の
整数)ビット加算器では、第nビットの入力データen
1〜en8が入力され、第1ビット加算器では入力デー
タe11〜e18およびボローb1〜b8が入力され
る。各ビット加算器は、図6で示されるように基本的に
は3入力の加算器(フルアダー、略称「FA」)で構成
され、各加算器では入力データおよび下位ビット加算器
から入力されるキャリーの加算を順次行い、キャリーが
発生すれば上位ビット加算器へ出力する。各ビット加算
器161〜168の加算器は、図6で示されるように、
ツリー状に配置され、順次入力数を減らしてゆき、最終
的には、各ビット加算器161〜168において、キャ
リーC61〜6Aと加算値S61〜6Aとを算出し、出
力する。このようにして、各ビット加算器161〜16
8において、加算を行うことによって、加算器の数を削
減することができ、効率的に加算を行うことができる。
The 8-input Wallace Tree adder circuit 151
In the n-th (n is an integer of 2 to 8) bit adder including the first bit adder 161 to the eighth bit adder 168, the n-th bit input data en
1 to en8 are input, and input data e11 to e18 and borrows b1 to b8 are input to the first bit adder. As shown in FIG. 6, each bit adder is basically composed of a three-input adder (full adder, abbreviated as “FA”), and each adder carries input data and a carry input from the lower bit adder. Are sequentially added, and if a carry occurs, it is output to the upper bit adder. The adders of the bit adders 161 to 168 are, as shown in FIG.
The bits are arranged in a tree shape and the number of inputs is sequentially reduced. Finally, in each bit adder 161-168, carry C61-6A and addition value S61-6A are calculated and output. In this way, each bit adder 161-16
In 8, the number of adders can be reduced by performing addition, and the addition can be performed efficiently.

【0028】たとえば、第4ビット加算器164におい
ては、加算器171は、入力データe41〜e43の加
算を行い、加算器172は、入力データe44〜e47
の加算を行い、加算器173は、入力データe47,e
48の加算を行う。加算器171〜173は、入力デー
タe41〜e48を加算した結果、その加算値Sを加算
器174,175へ出力し、キャリーCを第5ビット加
算器165へ出力する。加算器174は、第3ビット加
算器163から入力されるキャリーCと加算器171か
ら入力される加算値Sとの加算を行い、加算器175
は、第3ビット加算器163から入力されるキャリーC
と加算器172および173から入力される加算値Sと
の加算を行う。
For example, in the fourth bit adder 164, the adder 171 adds the input data e41 to e43, and the adder 172 inputs the input data e44 to e47.
Of the input data e47, e
Add 48. As a result of adding the input data e41 to e48, the adders 171 to 173 output the added value S to the adders 174 and 175 and the carry C to the fifth bit adder 165. The adder 174 adds the carry C input from the third bit adder 163 and the addition value S input from the adder 171, and adds the adder 175.
Is the carry C input from the third bit adder 163.
And the addition value S input from the adders 172 and 173 are added.

【0029】加算器174は、前述のデータを加算した
結果、その加算値Sを加算器176へ出力し、キャリー
Cを第5ビット加算器165へ出力する。加算器175
は、前述のデータを加算した結果、その加算値Sを加算
器177へ出力し、キャリーCを第5ビット加算器16
5へ出力する。加算器176は、第3ビット加算器16
3から入力されるキャリーCと加算器174から入力さ
れる加算値Sとの加算を行い、その加算値Sを加算器1
77へ出力し、キャリーCが発生すれば、第5ビット加
算器165へ出力する。加算器177は、第3ビット加
算器165から入力されたキャリーCと、加算器175
および加算器176から入力される加算値Sとの加算を
行い、第4ビットにおける加算値S64とキャリーC6
4を出力する。また、第4ビット加算器〜第7ビット加
算器の回路構成は同一である。
As a result of adding the above-mentioned data, the adder 174 outputs the addition value S to the adder 176 and the carry C to the fifth bit adder 165. Adder 175
Outputs the addition value S to the adder 177 as a result of adding the above-mentioned data, and the carry C to the fifth bit adder 16
Output to 5. The adder 176 is the third bit adder 16
Carry C input from 3 and addition value S input from adder 174 are added, and the addition value S is added to adder 1
When the carry C is generated, it is output to the fifth bit adder 165. The adder 177 adds the carry C input from the third bit adder 165 and the adder 175.
And the addition value S input from the adder 176 are added, and the addition value S64 and the carry C6 in the fourth bit are added.
4 is output. The circuit configurations of the fourth bit adder to the seventh bit adder are the same.

【0030】このようにして、各ビット加算器161〜
168において加算を行うけれども、第8ビット加算器
においては、発生したキャリーCについて順次そのキャ
リーCの加算を行い、加算器181〜183において
は、第9ビットの加算を行い、加算器184において
は、第10ビットの加算を行う。次に、第1ビット加算
器161〜第8ビット加算器168の各加算器で求めた
加算値S61〜S6AとキャリーC61〜C6Aとは、
図4で示されるように、高速加算器152によって加算
が行われ、最終的な加算値を最大11ビットで出力す
る。
In this way, each bit adder 161 ...
Although addition is performed in 168, the carry C generated in the eighth bit adder is sequentially added in the carry C, the ninth bit is added in adders 181 to 183, and the adder 184 adds , The 10th bit is added. Next, the addition values S61 to S6A and the carrys C61 to C6A obtained by the adders of the first bit adder 161 to the eighth bit adder 168 are:
As shown in FIG. 4, the addition is performed by the high-speed adder 152, and the final addition value is output with 11 bits at maximum.

【0031】また、第1ビット加算器161の入力デー
タの数は、図15で示される従来の第1ビット加算器6
1に比べて、ボロー入力データb1〜b8の増加分、す
なわち8入力多い。このボロー入力データb1〜b8の
増加に伴い、第1ビット加算器161においては、加算
器191〜194が増加し、第2ビット加算器162に
おいては、加算器191〜194からキャリーCが出力
され、その加算を行うために、加算器195,196が
増加し、合計6個の加算器が増加している。
The number of input data of the first bit adder 161 is the same as that of the conventional first bit adder 6 shown in FIG.
Compared to 1, there is an increase of borrow input data b1 to b8, that is, there are eight more inputs. As the borrow input data b1 to b8 increase, the adders 191 to 194 increase in the first bit adder 161, and the carry C is output from the adders 191 to 194 in the second bit adder 162. In order to perform the addition, the number of adders 195 and 196 is increased, and the total of six adders is increased.

【0032】多入力加算回路112においても、図6で
示される8入力加算回路150と同様な加算が行われ、
第1ビット加算器131〜第iビット加算器13iの各
加算器で求まった加算値SとキャリーCは、図4で示さ
れるように Carry LookAhead 加算器などの2入力の高
速加算器130によって累積加算が行われ、最終的な多
入力回路の加算結果|X−Y|を、加算器113へ出力
することができる。 Carry Look Ahead 加算器は、加数
と被加数の各ビット毎の加算を行うと同時に、キャリー
の計算を独立して行うことによって加算処理速度を向上
させている。
Also in the multi-input adder circuit 112, the same addition as in the 8-input adder circuit 150 shown in FIG. 6 is performed,
The addition value S and carry C obtained by the adders of the first bit adder 131 to the i-th bit adder 13i are accumulated by the 2-input high-speed adder 130 such as the Carry LookAhead adder as shown in FIG. The addition is performed, and the final addition result | X−Y | of the multi-input circuit can be output to the adder 113. The Carry Look Ahead adder improves the addition processing speed by performing the carry calculation independently while performing addition for each bit of the addend and the augend.

【0033】図4に示した第iビット加算器13i、
…、第2ビット加算器132はそれぞれの入力数Nの W
allace Tree 加算回路で構成することができ、第1ビッ
ト加算器131は、入力数2Nの Wallace Tree 加算回
路で構成することができる。このように、Wallace Tree
加算回路は、加算器をツリー状に接続して、入力数を
増加させる回路であるため、入力数が1個増加する毎に
必要とされる加算器の数は1個以内に抑えられる。
The i-th bit adder 13i shown in FIG.
..., the second bit adder 132 has W for each input number N
The first bit adder 131 can be configured by an allace Tree adder circuit, and the first bit adder 131 can be configured by a Wallace Tree adder circuit having 2N inputs. Like this, Wallace Tree
Since the adder circuit is a circuit in which adders are connected in a tree shape to increase the number of inputs, the number of adders required for each increase in the number of inputs can be suppressed to one or less.

【0034】図13に示される従来の差分絶対値累積加
算回路における多入力加算回路2に比較して、図1に示
す本発明の差分絶対値累積加算回路における多入力加算
器112の異なる点は、第1ビット加算器131の入力
数が、ボローb1〜bnの入力が増加したため、入力数
がNから2Nに増加したことである。また、それに伴
い、図6の構成例に示されるように、第1ビット加算器
131の加算器が増加し、その加算器から第2ビット加
算器132へキャリーCが出力されるので、第2ビット
多入力加算器132において、そのキャリーCを加算す
るための加算器が増加し、同様にしてさらに上位ビット
の多入力加算器の加算が増加する。この各ビット加算器
における増加した加算器の数の合計は、第1ビット加算
器131における入力数がN個増加した場合、約N個と
見積もることができる。
Compared with the multi-input adder circuit 2 in the conventional differential absolute value cumulative addition circuit shown in FIG. 13, the multi-input adder 112 in the differential absolute value cumulative addition circuit shown in FIG. 1 is different. The input number of the first bit adder 131 is increased from N to 2N because the inputs of the borrows b1 to bn are increased. Further, along with this, as shown in the configuration example of FIG. 6, the number of adders of the first bit adder 131 increases, and the carry C is output from the adder to the second bit adder 132. In the bit multi-input adder 132, the number of adders for adding the carry C increases, and in the same manner, the number of additions in the high-bit multi-input adder increases. The total number of increased adders in each bit adder can be estimated to be about N when the number of inputs in the first bit adder 131 increases by N.

【0035】また、図9に示した従来の差分絶対値演算
器に比較して、図2に示す本発明に係る差分絶対値演算
器の異なる点は、+1インクリメンタ7が設けられてい
ないことである。したがって、従来の差分絶対値演算器
の+1インクリメンタ7には、図12に示すようにi個
の加算器が設けられ、図11に示す差分絶対値累積加算
回路にはN個の差分絶対値演算器11〜1Nが設けられ
ているので、従来の差分絶対値演算器は、本発明の差分
絶対値演算器に比較して、全体でNi個の加算器が多く
設けられている。さらに、図10に示した従来の差分絶
対値演算器の加算器数は、図2に示す本発明の差分絶対
値演算器の加算器数よりiビット減算器9の加算器数
分、すなわちi個多く設けられている。したがって、図
10に示した従来の差分絶対値演算器の加算器数は、本
発明の差分絶対値演算器の加算器数より差分絶対値累積
加算回路101〜10N全体でNi個多く設けられてい
る。
Further, compared with the conventional difference absolute value calculator shown in FIG. 9, the difference between the difference absolute value calculator according to the present invention shown in FIG. 2 is that the +1 incrementer 7 is not provided. Is. Therefore, the +1 incrementer 7 of the conventional difference absolute value calculator is provided with i adders as shown in FIG. 12, and the difference absolute value cumulative addition circuit shown in FIG. 11 has N difference absolute values. Since the arithmetic units 11 to 1N are provided, the conventional differential absolute value arithmetic unit is provided with a larger number of Ni adders as a whole than the differential absolute value arithmetic unit of the present invention. Further, the number of adders of the conventional difference absolute value calculator shown in FIG. 10 is equal to the number of adders of the i-bit subtractor 9, that is, i, from the number of adders of the difference absolute value calculator of the present invention shown in FIG. Many are provided. Therefore, the number of adders of the conventional difference absolute value calculator shown in FIG. 10 is larger than the number of adders of the difference absolute value calculator of the present invention by Ni in the total difference absolute value cumulative addition circuits 101 to 10N. There is.

【0036】以上のことから、本発明の差分絶対値累積
加算回路における加算器数は、差分絶対値演算器101
〜10Nにおいては、従来の差分絶対値演算器11〜1
Nに比べてNi個少なく、多入力加算器112において
は、従来の多入力加算器2に比べてN個多いため、全体
においては従来の差分絶対値累積加算回路に比較して、
Ni−N=(i−1)N個少ない。これによって、本発
明の差分絶対値累積加算回路に要する加算器数は、従来
に比較して大幅に削減され、データ数Nが多い場合には
従来に比較して約1/2に削減されることになる。
From the above, the number of adders in the difference absolute value cumulative addition circuit of the present invention is the difference absolute value calculator 101.
-10N, the conventional difference absolute value calculators 11 to 1
Compared to the conventional multi-input adder 2, the number of Ni is smaller than that of the conventional multi-input adder 2 by N, and thus the total number of inputs is larger than that of the conventional differential absolute value cumulative addition circuit.
Ni-N = (i-1) N is less. As a result, the number of adders required for the differential absolute value cumulative addition circuit of the present invention is significantly reduced as compared with the conventional one, and when the number of data N is large, it is reduced to approximately 1/2 as compared with the conventional one. It will be.

【0037】[0037]

【発明の効果】以上のように本発明によれば、2数の差
分値を求める差分絶対値演算回路において、ボロー出力
があるとき、その演算結果の「1の補数」を多入力加算
器へ出力する。また、そのボローを多入力加算器の第1
ビット加算器に出力し、その演算結果における「2の補
数」化のための+1の加算を後段の多入力の第1ビット
加算器において一括して行っている。
As described above, according to the present invention, in the difference absolute value arithmetic circuit for obtaining the difference value of two numbers, when there is borrow output, the "1's complement" of the arithmetic result is sent to the multi-input adder. Output. In addition, the borrow is the first of the multi-input adder.
The result is output to the bit adder, and +1 is added to the operation result to make it a "2's complement" collectively in the multi-input first bit adder in the subsequent stage.

【0038】したがって、差分絶対値演算に要する加算
器の数を大幅に削減し、全体の回路規模を大幅に縮小す
ることができる。また、同一回路規模であれば、入力デ
ータ数または各データのビット数を増大させることがで
きるようになる。
Therefore, the number of adders required for the difference absolute value calculation can be greatly reduced, and the overall circuit scale can be greatly reduced. Moreover, if the circuit scale is the same, the number of input data or the number of bits of each data can be increased.

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

【図1】本発明の実施例である差分絶対値累積加算回路
の構成を示す図である。
FIG. 1 is a diagram showing a configuration of a differential absolute value cumulative addition circuit that is an embodiment of the present invention.

【図2】図1における各差分絶対値演算器101〜10
Nの構成を示す図である。
FIG. 2 is a diagram showing respective difference absolute value calculators 101 to 10 in FIG.
It is a figure which shows the structure of N.

【図3】図2におけるiビット減算器115の構成例を
示す図である。
FIG. 3 is a diagram showing a configuration example of an i-bit subtractor 115 in FIG.

【図4】図2における多入力加算器112の構成を示す
図である。
FIG. 4 is a diagram showing a configuration of a multi-input adder 112 in FIG.

【図5】図4における多入力加算器112の構成例を示
す図である。
5 is a diagram showing a configuration example of a multi-input adder 112 in FIG.

【図6】図5における8入力 Wallace Tree 加算回路1
51の回路図である。
FIG. 6 is an 8-input Wallace Tree adder circuit 1 in FIG.
It is a circuit diagram of 51.

【図7】2つの画像データの相関性を求めるときの画像
データの例を示す図である。
FIG. 7 is a diagram showing an example of image data when the correlation between two image data is obtained.

【図8】従来の差分絶対値累積加算回路の構成を示す図
である。
FIG. 8 is a diagram showing a configuration of a conventional differential absolute value cumulative addition circuit.

【図9】図8における差分絶対値演算器11〜1Nの構
成例を示す図である。
9 is a diagram showing a configuration example of difference absolute value calculators 11 to 1N in FIG.

【図10】図8における差分絶対値演算器11〜1Nの
他の構成例を示す図である。
10 is a diagram showing another configuration example of the absolute difference value calculators 11 to 1N in FIG.

【図11】図9および図10におけるiビット減算器5
およびiビット減算器9の構成例を示す図である。
FIG. 11 is an i-bit subtractor 5 in FIGS. 9 and 10.
3 is a diagram showing a configuration example of an i-bit subtractor 9 and FIG.

【図12】図9におけるインクリメンタ7の構成例を示
す図である。
12 is a diagram showing a configuration example of an incrementer 7 in FIG.

【図13】図8における多入力加算器2の構成を示す図
である。
13 is a diagram showing a configuration of a multi-input adder 2 in FIG.

【図14】図13における多入力加算器2の構成例を示
す図である。
14 is a diagram showing a configuration example of a multi-input adder 2 in FIG.

【図15】図14における8入力 Wallace Tree 加算回
路55の回路図である。
15 is a circuit diagram of an 8-input Wallace Tree adder circuit 55 in FIG.

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

101〜10N 差分絶対値演算器 112 多入力加算器 113 加算器 114 アキュムレータ 115 iビット減算器 116 インバータ 118 セレクタ 121〜12i フルアダー 130 高速加算器 131〜13i ビット加算器 151 8入力 Wallace Tree 加算回路 152 高速加算器 161〜168 ビット加算器 101-10N Difference absolute value calculator 112 Multi-input adder 113 Adder 114 Accumulator 115 i-bit subtractor 116 Inverter 118 Selector 121-12i Full adder 130 High-speed adder 131-13i-bit adder 151 8-input Wallace Tree Adder circuit 152 High-speed Adder 161-168 bit adder

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 それぞれiビットから成る2数の差分値
を求めるiビット減算器と、前記iビット減算器からボ
ロー出力がないとき前記iビット減算器の減算結果をそ
のまま出力し、前記iビット減算器からボロー出力があ
るとき前記iビット減算器の減算結果をビット反転して
出力するビット反転切換回路とを含む複数の差分絶対値
減算回路と、 各差分絶対値減算回路のボローを最下位ビットとして入
力するとともに、各差分絶対値減算回路の減算結果を加
算する多入力加算回路と、 前記多入力加算回路の出力を累積加算する累積加算回路
とを含むことを特徴とする差分絶対値累積加算回路。
1. An i-bit subtractor for obtaining a difference value of two numbers each consisting of i-bits, and a subtraction result of the i-bit subtractor is output as it is when there is no borrow output from the i-bit subtractor. When there is a borrow output from the subtractor, a plurality of difference absolute value subtraction circuits including a bit inversion switching circuit that bit-inverts and outputs the subtraction result of the i-bit subtractor; Difference absolute value accumulation, characterized in that it includes a multi-input addition circuit that inputs as a bit and adds the subtraction results of each difference absolute value subtraction circuit, and a cumulative addition circuit that cumulatively adds the outputs of the multi-input addition circuit. Adder circuit.
JP5114997A 1992-06-01 1993-05-17 Difference absolute value cumulative adder circuit Pending JPH0651956A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5114997A JPH0651956A (en) 1992-06-01 1993-05-17 Difference absolute value cumulative adder circuit

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP14048692 1992-06-01
JP4-140486 1992-06-01
JP5114997A JPH0651956A (en) 1992-06-01 1993-05-17 Difference absolute value cumulative adder circuit

Publications (1)

Publication Number Publication Date
JPH0651956A true JPH0651956A (en) 1994-02-25

Family

ID=26453622

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5114997A Pending JPH0651956A (en) 1992-06-01 1993-05-17 Difference absolute value cumulative adder circuit

Country Status (1)

Country Link
JP (1) JPH0651956A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0972236A4 (en) * 1996-10-23 2000-04-12 Zapex Technologies Inc A sum of the absolute values generator
JP2011023013A (en) * 2005-05-25 2011-02-03 Qualcomm Inc System and method of performing two's complement operations in digital signal processor

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0972236A4 (en) * 1996-10-23 2000-04-12 Zapex Technologies Inc A sum of the absolute values generator
JP2011023013A (en) * 2005-05-25 2011-02-03 Qualcomm Inc System and method of performing two's complement operations in digital signal processor
US8234319B2 (en) 2005-05-25 2012-07-31 Qualcomm Incorporated System and method of performing two's complement operations in a digital signal processor

Similar Documents

Publication Publication Date Title
US5278783A (en) Fast area-efficient multi-bit binary adder with low fan-out signals
US5610850A (en) Absolute difference accumulator circuit
KR100241324B1 (en) Leading zero count circuit
USRE40803E1 (en) Complex number multiplier
JP2689414B2 (en) Floating point representation converter
JPH0628158A (en) Method and device for carry forecasting addition
JP2001005643A (en) Power arithmetic unit
JPH07121354A (en) Multiplier capable of double precision/signal precision/ inner product operation and complex multiplication
JPH0651956A (en) Difference absolute value cumulative adder circuit
WO2005086675A2 (en) Arithmetic circuit with balanced logic levels for low-power operation
Zheng et al. Low power and high speed multiplication design through mixed number representations
CN110879697A (en) Device for approximately calculating tanh function
JPH0552530B2 (en)
KR20000024841A (en) Random number generator
US6546411B1 (en) High-speed radix 100 parallel adder
KR100241069B1 (en) Calculating the average of four integer numbers rounded away from zero in a single instruction cycle
JPH08123663A (en) High-speed dynamic binary incrementer
Habibi et al. An improved RNS reverse converter in three-moduli set
KR100264957B1 (en) Calculating the average of two integer numbers rounded away from zero in a single instruction cycle
US20130238680A1 (en) Decimal absolute value adder
JP3522167B2 (en) Arithmetic processing circuit and arithmetic processing method
CN116991359B (en) Booth multiplier, hybrid Booth multiplier and operation method
JP2901463B2 (en) Addition device
Liu et al. A Fast Two’s Complement Generator
JPS6349835A (en) Arithmetic processor

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Effective date: 20050224

Free format text: JAPANESE INTERMEDIATE CODE: A131

A601 Written request for extension of time

Free format text: JAPANESE INTERMEDIATE CODE: A601

Effective date: 20050517

A602 Written permission of extension of time

Free format text: JAPANESE INTERMEDIATE CODE: A602

Effective date: 20050520

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050819

A131 Notification of reasons for refusal

Effective date: 20070904

Free format text: JAPANESE INTERMEDIATE CODE: A131

A601 Written request for extension of time

Free format text: JAPANESE INTERMEDIATE CODE: A601

Effective date: 20071129

A602 Written permission of extension of time

Free format text: JAPANESE INTERMEDIATE CODE: A602

Effective date: 20071204

A601 Written request for extension of time

Effective date: 20071226

Free format text: JAPANESE INTERMEDIATE CODE: A601

A602 Written permission of extension of time

Effective date: 20080104

Free format text: JAPANESE INTERMEDIATE CODE: A602

A521 Written amendment

Effective date: 20080204

Free format text: JAPANESE INTERMEDIATE CODE: A523

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20080401

A61 First payment of annual fees (during grant procedure)

Effective date: 20080430

Free format text: JAPANESE INTERMEDIATE CODE: A61

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110509

Year of fee payment: 3

R150 Certificate of patent (=grant) or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110509

Year of fee payment: 3

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120509

Year of fee payment: 4

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120509

Year of fee payment: 4

FPAY Renewal fee payment (prs date is renewal date of database)

Year of fee payment: 5

Free format text: PAYMENT UNTIL: 20130509

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140509

Year of fee payment: 6

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

EXPY Cancellation because of completion of term