[go: up one dir, main page]

JPS60186979A - Calculating device for extent of difference - Google Patents

Calculating device for extent of difference

Info

Publication number
JPS60186979A
JPS60186979A JP58202291A JP20229183A JPS60186979A JP S60186979 A JPS60186979 A JP S60186979A JP 58202291 A JP58202291 A JP 58202291A JP 20229183 A JP20229183 A JP 20229183A JP S60186979 A JPS60186979 A JP S60186979A
Authority
JP
Japan
Prior art keywords
data
circuit
output
binary data
difference
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.)
Granted
Application number
JP58202291A
Other languages
Japanese (ja)
Other versions
JPH0315209B2 (en
Inventor
Yukikazu Kaburayama
蕪山 幸和
Eiichiro Yamamoto
山本 栄一郎
Yoshihisa Fujii
敬久 藤井
▲はい▼ 東善
Touzen Hai
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 JP58202291A priority Critical patent/JPS60186979A/en
Publication of JPS60186979A publication Critical patent/JPS60186979A/en
Publication of JPH0315209B2 publication Critical patent/JPH0315209B2/ja
Granted legal-status Critical Current

Links

Landscapes

  • Complex Calculations (AREA)
  • Character Discrimination (AREA)

Abstract

PURPOSE:To simplify the circuit constitution of the difference extent calculating device by using an exclusive OR circuit which inputs sign bits of two tandem data and the most significant digit carry bit of the sum of one binary data and the other inverted data. CONSTITUTION:An adding circuit 10 adds data Ai expressed as a complement of ''2'' to data Bi' obtained by inverting data Bi through an inverting circuit 16. The most significant digit bits of the data Ai and Bi, i.e. code bits and the most significant carry digit bit outputted from the adding circuit 10 are inputted to the exclusive OR circuit (EOR circuit) 11, which decides which of the data Ai and Bi are larger. Every time the output data of a data converting circuit 12 and the logical output of the EOR circuit 11 are inputted to an adding circuit 13, the adding circuit 13 adds the input data to data stored in a register 14 to calculate the cumulative sum (difference extent).

Description

【発明の詳細な説明】 (1) 発明の技術分野 本発明は、特に2つのデータ群の相違度を、両データ群
における各データの差の絶対値の累積和として計算する
装置に関する。
DETAILED DESCRIPTION OF THE INVENTION (1) Technical Field of the Invention The present invention particularly relates to a device that calculates the degree of dissimilarity between two data groups as a cumulative sum of absolute values of differences between data in both data groups.

(2) 技術の背景 一般に音声認識或いは画像認識では、入力する音声パタ
ーンや画像パターンを予め定めた複数の標準パターンと
比較し、これら標準パターンのうち該入カバターンとの
相違が一番小さいものを認識パターンとするようにして
いる。イして、この入カバターンと標準パターンとの相
違の尺度として、例えば、多数次元での特徴抽出によっ
て複数のデータからなる(多次元)入カバターンと同次
元のデータからなる予め定めた標準パターンとにおける
対応する次元の各データ値の差の絶対値を順次加飾した
累積和を用いることができる。すなわら、当該累積和が
大きければ、入カバターン、標準パターンの相違は大き
く、当該累積和が小さければその相3fflが小さいも
のとなる。
(2) Background of the technology In general, in speech recognition or image recognition, an input audio pattern or image pattern is compared with a plurality of predetermined standard patterns, and among these standard patterns, the one with the smallest difference from the input cover pattern is selected. I try to use it as a recognition pattern. Then, as a measure of the difference between this input pattern and a standard pattern, for example, by extracting features in multiple dimensions, an input pattern consisting of multiple data (multidimensional) and a predetermined standard pattern consisting of data of the same dimension are used. It is possible to use a cumulative sum obtained by sequentially decorating the absolute value of the difference between each data value of the corresponding dimension in . That is, if the cumulative sum is large, the difference between the input cover pattern and the standard pattern is large, and if the cumulative sum is small, the phase 3ffl is small.

イこで、音声認識或いは画像認識では、その入カバター
ンと標準パターンの両データ群の相違を上記のような累
積和として計悴づる相違度計算装置が必要となり、更に
当該累積和をできるだけ高速にバ1算できる装置が要望
されている。
Therefore, in speech recognition or image recognition, a dissimilarity calculation device is required that calculates the differences between the data groups of the input pattern and the standard pattern as a cumulative sum as described above, and furthermore, the cumulative sum can be calculated as quickly as possible. There is a need for a device that can calculate the number of bars.

(3) 従来技術と問題点 従来、この種の相違度計算装置として例えば第1図に示
すようなものが考えられる。ここで、対象どなる2つの
データ群A=(At)、B=(B+)を構成する2進デ
ータは、正又は負の値であり、その表現は、演算処理に
便利なように、例えばn+1ビット表現のものであれば
、 At = an ・2’ +A’ A −= 、+ a 、−、−−2°−’+8,1. 
e 2”+・・・+8+ 21 +a。2゜ a、〜a、:Q又は1 で示される数値となる、いわゆる2の補数表現されたも
のとなっている(B+ についても同様)。
(3) Prior Art and Problems Conventionally, an example of this kind of dissimilarity calculation device is shown in FIG. 1, for example. Here, the binary data constituting the two target data groups A=(At) and B=(B+) is a positive or negative value, and its representation is, for example, n+1, for convenience in arithmetic processing. If it is a bit representation, At = an ・2' + A' A -= , + a , -, -2° -' +8, 1 .
e 2''+...+8+ 21 +a.2°a, ~a, :Q or 1, which is a so-called two's complement representation (the same applies to B+).

第1図において、1は上記のように2の補数表現された
データ群△、及びBの対応づる次元のデータA1 とB
+ どの大小を判定する比較回路、2は、1−記データ
Ai、B1を入力し、比較回路1での判定結果に基づい
て、データA+ 。
In Figure 1, 1 is the data group △ expressed in two's complement as described above, and the corresponding dimension data A1 and B of B.
+ A comparison circuit 2 that determines which size is inputted with the 1- data Ai and B1, and based on the determination result of the comparison circuit 1, data A+.

B1のうち人きい方を選択出力するマルチプレクサ、3
は上記データA+ 、B+ を反転回路7a、7hによ
って反転ざ甘た当該反転データ(1の補数)を入力し、
比較回路1での判定結果に基づいて、データA+ 、B
+ のうち小さい方の反転データを選択出力するマルチ
プレクサ、4はマルチプレク+J2、及び3からの各出
ノJデータとビットデータ“1″とを加算する加算回路
であり、この比較回路1、マルチプレクサ2゜3、及び
加算回路4によって、入力するデータA+ 、B+の大
きい方から小ざい方を減幹する減算回路が構成され、す
なわち、最終段の加算回路4からの出力がデータA1と
B:の差の絶対値lA+ −F3+ Iと、なる。そし
て、データ群A1及びBからのデータが入力J゛る毎に
加n回路4から出力される上記絶対値IA+ −8+ 
1を、加算回路5によって、レジスタ6に格納されてい
る前回までの加算結果と加算して、この加桿結果を再度
レジスタ6に格納するようにし、レジスタ6の最終格納
データが、上記データ群へ、Bにおける対応する次元の
各データの差の絶対値の累積和ΣlA+ −B+ l、
すなわちデータ群A、Bの相違度となるようにしている
Multiplexer 3 that selects and outputs the more popular one of B1
inputs the inverted data (1's complement) obtained by inverting the data A+ and B+ by the inverting circuits 7a and 7h,
Based on the determination result in comparison circuit 1, data A+, B
A multiplexer 4 selectively outputs the smaller inverted data of 2.3 and the adder circuit 4 constitute a subtraction circuit that subtracts the smaller one from the larger one of the input data A+ and B+. That is, the output from the adder circuit 4 at the final stage is the data A1 and B: The absolute value of the difference is lA+ -F3+ I. The absolute value IA+ -8+ is output from the addition circuit 4 every time data from the data groups A1 and B is input.
1 is added by the adding circuit 5 to the previous addition result stored in the register 6, and this addition result is stored in the register 6 again, so that the final stored data in the register 6 becomes the data group mentioned above. , the cumulative sum of the absolute values of the differences of each data of the corresponding dimension in B, ΣlA+ −B+ l,
In other words, it is the degree of difference between data groups A and B.

このように、データ群A1及び8から順次入力するデー
タA+ 、B+の大小を判定し、その人きい方から小さ
い方を減算した結果を順次累積加御するようにした上記
相違度計算fj置は、バートークエアで構成することに
より、比較的高速な処理が実現できるようになる。
In this way, the above difference calculation fj is performed by determining the magnitude of the data A+ and B+ that are sequentially input from the data groups A1 and 8, and then cumulatively adding the results of subtracting the smaller one from the preferred one. By configuring the system using Bartok Air, relatively high-speed processing can be achieved.

しかしながら、この第1図に示ずような相違度計算装置
では、データA+ 、B+ の大小を判定する比較回路
1と、この比較回路1の判定結果に基づいてデータ選択
を行なうマルチブレク412、及び3が必要なため、回
路構成が比較的複雑になるという不具合がある。
However, the dissimilarity calculation device as shown in FIG. This has the disadvantage that the circuit configuration is relatively complicated.

(4) 発明の目的 本発明は上記の点に鑑みてなされたもの(・、特に2の
補数表現された2進データからなる2つのデータ群にお
ける互いに対応した各データの差の絶対値の累積和を8
1算する相3!!度計痺独UをできるだけgO甲な回路
構成で実現することを目的としている。
(4) Purpose of the Invention The present invention has been made in view of the above points (in particular, the accumulation of the absolute values of the differences between mutually corresponding data in two data groups consisting of binary data expressed in two's complement). sum of 8
Phase 3 to count by 1! ! The purpose is to realize the power meter paralysis U with a circuit configuration as simple as possible.

(5) 発明の構成 上記目的を達成するため本発明は、負の数のみが2の補
数表現された2つの2進データ台の差の絶対値をnl算
り−る装置であっC1前記2進データのうちの一方の2
進データと、他方の2進データの反転データとを加r+
する加算回路と、前記2つの2進データの符号ヒツトと
前記加9回路から出力される最1:位桁上がりピッ1−
とが人力され、当該ビットデータにより前記2つの2進
データの人、小を判定する判定回路と、前記加算回路か
らの最上位桁上がりビット以外の出力2進データを、前
記一方の2進データが前記他方の2進データより大なる
ときは、そのまま出力し、前記一方の2進データが前記
他方の2進データ以下であるときは、反転した後、“1
′′を加算して出力する回路とを備えるようにしたもの
である。
(5) Structure of the Invention In order to achieve the above object, the present invention is a device that calculates nl the absolute value of the difference between two binary data tables in which only negative numbers are expressed as two's complement. 2 of one of the binary data
Add the binary data and the inverted data of the other binary data r+
the adder circuit that outputs the sign hit of the two binary data and the highest 1: carry pick 1- output from the adder circuit.
is manually inputted, and a determination circuit that determines whether the two binary data are human or small based on the bit data, and output binary data other than the most significant carry bit from the adder circuit are added to the one binary data. When is larger than the other binary data, it is output as is, and when the one binary data is less than the other binary data, it is inverted and then output as "1".
'' and a circuit that adds and outputs the sum.

(6) 発明の実施例 まず、本発明において行なわれる負の数のみが24!I
−の補数表現された2つの2進データの差の絶対値をめ
る計算について、基本的な論理を説明する。
(6) Embodiments of the invention First, in the present invention, only negative numbers are 24! I
The basic logic of calculating the absolute value of the difference between two binary data expressed as -'s complement will be explained.

例えば、n+1ピットで負の数のみが2の補数表現され
た2つの2進データX及びYの符号ピット(最上位ピッ
ト)をそれぞれXn、Vnとし、残りのnピットで表現
される部分をそれぞれX’ 、Y’ とすると、各デー
タX、YはX=−Xn −2n +X’ Y=−yn ・2”’+Y’ で示される数値となるが、2進演算の過程においては符
号ピットと他のピットは同様の取扱いとなるので X=x、・2” +X’ Y=yn ・2n+Y’ となる。
For example, let the sign pits (most significant pits) of two binary data X and Y, in which only negative numbers are expressed as two's complement in n+1 pits, be Xn and Vn, respectively, and the parts expressed by the remaining n pits, respectively. When X' and Y' are assumed, each data X and Y becomes a numerical value expressed as Other pits are treated in the same way, so X=x, .2''+X' Y=yn .2n+Y'.

ここで、データXどデータYの反転データ(1の補数)
Yとを加締した加粋データs4!−考えると、 S=X+Y =(xn ・2”+X’) +(yn ・2n +Y’ ) =(xn 十 y 。 ン ・ 2n −l−(X’ −1−Y’ ) ・・・(+>となる。
Here, the inverted data (1's complement) of data X and data Y
Added data s4 with Y! - Considering, S=X+Y = (xn ・2"+X') + (yn ・2n +Y') = (xn > becomes.

この演粋においてn+1(符号)ビット目からの桁上が
りをC1,7、nピッ]〜1]からの桁上がりをC7と
りると、 1) xn”’01y0=1のとぎ、 すなわち、X≧O>Yのとき、 Xn +Vn −・0であるから C、、、= 0 となる。
In this deduction, if we take the carry from the n+1 (sign) bit as C1, 7, and the carry from n p] to 1] as C7, we get: 1) The end of xn'''01y0=1, that is, X≧ When O>Y, since Xn +Vn -・0, C...=0.

2) x、=1、yn=oのとき、 l11.、;わら、X<O≦Yのとぎ、X、+yn =
io(2進値)であるから、C、、、= 1 となる。
2) When x,=1, yn=o, l11. , ;straw, X<O≦Y, X, +yn =
io (binary value), so C, , , = 1.

3) xn=Q、yn=o又はx、−1、yn=1のと
き、上記加算データSは、Xo→−yn=1であるから
、 S=2’ + (X’ +Y’ ) となり、Y′がnピット表現であるからY’ =21−
1−Y’ となって 3=2”’−1+(X’ −Y’ ) となる。
3) When xn=Q, yn=o or x, -1, yn=1, the above addition data S is Xo→-yn=1, so S=2' + (X' + Y'), Since Y' is an n-pit representation, Y' = 21-
1-Y', and 3=2''-1+(X'-Y').

3−1ン ここで、X>Yのとき X、Yは同符号でXT > Y l となるからS≧2
n+1 となって、0)式の演算におけるn+1ビット目からの
桁上がりがあり、 c n、、 = 1 3−2) 一方、X≦Yのとき X、Yは同符号でX′≦Y′となることからS≦2°+
1−1 どなって上記演算におけるn+iビット目からの桁」二
がりがなく、 C,1,、= O となる。
3-1 Here, when X>Y, X and Y have the same sign and XT>Y l, so S≧2
n+1, and there is a carry from the n+1 bit in the calculation of formula 0), c n,, = 1 3-2) On the other hand, when X≦Y, X and Y have the same sign and X'≦Y' Therefore, S≦2°+
1-1 There is no difference in the digits from the n+i-th bit in the above operation, and C, 1, = O.

以上の関係を整即すると次表のようになる。The following table shows the above relationships.

表 すなわち、XがYより大ぎい時は、X、Yの最上位ピッ
トとS=X+Yの最上位桁上がりピットとの排他的論理
和の論理出力が°゛1″、X>Yのとき、 ×o■Vn ■c 、、、 = 1 ・・・・・・・・
・・・・ (2)どなる一方、XがY以下の時は、X、
Y(7)最−L位ビットとS=X+Yの最上位桁上がり
ビットとの排他的論理和の論理出力が′0″、X≦Yの
とき、 x、■Vn ■C11,、= O・・・・・・・・・・
・・ (3)となる。
In other words, when X is larger than Y, the logical output of the exclusive OR of the most significant pits of X and Y and the most significant carry pit of S=X+Y is °゛1'', and when X>Y, ×o■Vn ■c ,,, = 1 ・・・・・・・・・
... (2) On the other hand, when X is less than Y,
Y(7) When the logical output of the exclusive OR of the -L bit and the most significant carry bit of S=X+Y is '0'' and X≦Y, x, ■Vn ■C11,, = O・・・・・・・・・・
... (3) becomes.

一/j (+)式C゛示される加算データSはS = 
X + Y = X−12”’ −1−Y となることから、データX、Yの差の絶対値1〕= l
 X−Y lは、X>YのときD=X−Y = S +1−2 ”’ となる。そして、史に S ”’ Cn、l” 2°o +S ′111111
 (4)(S’ =s、+ 2’ +S、−,・2°−
1+ 、、。
1/j (+) Formula C゛The added data S shown is S =
Since X + Y = X-12''' -1-Y, the absolute value of the difference between data X and Y is 1] = l
X-Y l becomes D=X-Y = S +1-2 "' when X>Y. Then, in history, S "' Cn, l" 2°o + S '111111
(4) (S' = s, + 2' +S, -, ・2°-
1+,,.

・・・十S1 ・21+S。・2°) となることから、 X n −yn s Cr(as = 1のとき、1)
−C1゜、・ 2”’ + 8’ +−1−2”’=3
’ +1 ・・・(5) Xo=01yn =1 、Cn、+=Oのとき1’)=
S’−11−’2°゛1 ・・・(6)(6)式をn’
+1ピッ1〜表現すると、[)=S’ト1 となる。すなわち、X h< Yより人込いどき、×。
...10S1 ・21+S.・2°) Therefore, X n −yn s Cr (1 when as = 1)
-C1゜,・2"'+8'+-1-2"'=3
'+1...(5) When Xo=01yn=1, Cn, +=O, 1')=
S'-11-'2°゛1...(6) Expression (6) as n'
+1 p1 ~ Expressed as [)=S'to1. In other words, when X h< Y, there is a crowd, ×.

Yの差の絶対値r)==lX−Ylは、(1)式で示さ
れる加算データSのうち最1−位桁1−かりビットLx
外の2進データS′に°“1″を71111したものと
イTる。
The absolute value of the difference between Y (r)==l
It is assumed that 71111 degrees of "1" are added to the external binary data S'.

X>Yのとさ l”11−8’+1 ・・・(7)また
、当該絶対値1’)= l X−Y lは、X≦Yのと
き −Y−X =−2”’−1−S =2”’−1−8’ −Co、、 ・2°″どなること
から、 Xn =Vn 、Cnu−0のとぎ D=2”−1−8’ −8” −(n)×n−1、yn
=o、Cn、、 = 1のときD = S −2”’ 
°°(9) (9)式を04−1ヒラ1〜表現すると、D=S となる。すなわち、XがY以下のどき、X、Yの差の絶
対値D= l X−Y lは、<1)式で示される加算
データSのうち最上位桁上がりビット以外の2進データ
S′を反転したものどなる。
The height of X>Y l"11-8'+1 ... (7) Also, the absolute value 1') = l X-Y l is -Y-X =-2"'- when X≦Y 1-S = 2"'-1-8' -Co,, ・2°", so Xn = Vn, Cnu-0's sword D = 2"-1-8'-8" -(n)× n-1, yn
When =o, Cn,, = 1, D = S -2'''
°°(9) When formula (9) is expressed as 04-1 Hira 1~, D=S. That is, when X is less than or equal to Y, the absolute value of the difference between X and Y D=l The inverted version screams.

X≦Yのとき D=S’ ・・・(10)−上記(2)
式、(3)式、及び(7)式、(10)式からxo■V
nΦCo、、 = 1のとぎ 1)= l X−Y 1 =8’+1 ・・・(11) xn■yrlΦC、、、= Oのとき D= l X −Y l =S’ ・・・(12)とな
る。
When X≦Y, D=S'...(10) - (2) above
From formula, formula (3), formula (7), and formula (10), xo■V
nΦCo,, = 1 toggle 1) = l ).

−4”r’にわち、2の補数表現された2つの2進デー
タの差の絶対値をめるには、まず、当該2進アータの一
方と、他方の反転データとを加算し、該加算結果の最上
位桁上がりビットと上記2の補数表現された両2進デー
タの最上位ビットとの排他的論理和出力が++ 1 +
+のときに、上記加算結果の最上位桁上がりビット以外
の2進データに1“′を加算し、また上記排他的論理和
出力が0″のどきに、上記加算結果の最上位桁上がりピ
ッ1〜以外の2進フ゛−夕を反転づるようにする。
-4"r', to calculate the absolute value of the difference between two binary data expressed in two's complement, first add one of the binary atters and the inverted data of the other, The exclusive OR output of the most significant carry bit of the addition result and the most significant bit of both binary data expressed as two's complement is ++ 1 +
+, 1"' is added to the binary data other than the most significant carry bit of the above addition result, and when the above exclusive OR output is 0", the most significant carry bit of the above addition result is added. The binary numbers other than 1 are inverted.

以下、−LFli′!塁本理論に従って作動する本発明
の実施例を図面に基づいて説明する。。
Below, -LFli'! An embodiment of the present invention that operates according to Ruimoto's theory will be described based on the drawings. .

第2図は木光明の 実施例を示1111ツク図である。FIG. 2 is a 1111 diagram showing an embodiment of Komei Ki.

同図において、101.12の補数表現されたデータ群
Aのデータへ1と、同様に2の補数表Jliiされたデ
ータ群t3のデータ11i を反転回路16によって反
転させた当該反転データB1 とを加咋する加勢回路、
11は十n1jデータA1及び13.の最上位ビットず
なわち符号ビットど加咋回路10から出ツノされる最上
1(t ltj、1.がリビットとを入力し、データ△
1.B1の大小を判定づる排他的論1!I!和回路(1
ズFEOR回路という〉、12は加粋回路10から出力
される最上位桁上がりビット以外の2進データを入力し
、FOR回路11からの論理出力に基づいて当該入力デ
ータを変換出力するデータ変換回路であり、このデータ
変換回路12は、加算回路10から出力されるビット毎
に当該ビットデータが入力される排伯的論理和グー1−
12−1〜12− n (以下EORゲートという)を
設け、該EORゲート12−1〜12−nノ他方の入力
端に、EOR回路11からの論理和出力をインバータ1
7によって反転した反転ビットデータが入力するように
し、この各FORゲー1−12−1〜12−nの出力を
データ変換回路12のwカとしている。
In the figure, 1 is added to the data of the data group A expressed in 101.12's complement, and the inverted data B1 obtained by inverting the data 11i of the data group t3, which is similarly expressed in the 2's complement table Jlii, by the inverting circuit 16. A boosting circuit that boosts
11 is tenn1j data A1 and 13. The most significant bit of , that is, the sign bit, output from the adding circuit 10, is input, and the data △
1. Exclusive theory 1 to determine the size of B1! I! Sum circuit (1
12 is a data conversion circuit that inputs binary data other than the most significant carry bit output from the addition circuit 10 and converts and outputs the input data based on the logic output from the FOR circuit 11. The data conversion circuit 12 is an exclusive OR group 1- to which bit data is input for each bit output from the adder circuit 10.
12-1 to 12-n (hereinafter referred to as EOR gates) are provided, and the OR output from the EOR circuit 11 is connected to the other input terminal of the EOR gates 12-1 to 12-n.
The inverted bit data inverted by 7 is inputted, and the outputs of the FOR gates 1-12-1 to 12-n are used as the output of the data conversion circuit 12.

また、13は加算回路、14は加算回路13からの出力
データを格納するレジスタであり、この加飾回路13、
及びレジスタ14は、データ変換回路12からの出力デ
ータとEOR回路11からの論理出力が加算回路13に
入力する毎に、加算回路13が当該入力データとレジス
タ14に格納されたデータとを加算して再度この加算デ
ータをレジスタ14に格納する、いわゆる累積和回路を
構成している。
Further, 13 is an adder circuit, 14 is a register for storing output data from the adder circuit 13, and this decoration circuit 13,
and the register 14, each time the output data from the data conversion circuit 12 and the logical output from the EOR circuit 11 are input to the adder circuit 13, the adder circuit 13 adds the input data and the data stored in the register 14. The added data is then stored in the register 14 again, forming a so-called cumulative sum circuit.

ここで、加算回路10は上記式(+1 (S = X 
+ Y )を実現する回路、排他的論理和回路11は上
記式1式%(3) の判定を行なう回路、データ変換回路12は(11)式
、(12)式におけるS′又はS′をめる回路、加算回
路13は(11)式、(12)式(D=S’−11、I
)=S’ ) を実現する回路である。
Here, the adder circuit 10 uses the above formula (+1 (S = X
+ Y), the exclusive OR circuit 11 is a circuit that makes a judgment on the above formula 1 (3), and the data conversion circuit 12 is a circuit that realizes S' or S' in formulas (11) and (12). The adder circuit and the adder circuit 13 are constructed using equations (11) and (12) (D=S'-11, I
)=S').

次に下記に示す3次元のデータf!I’、A、Bにおけ
る相違度のtj算を例にとって作動を説明する。
Next, the three-dimensional data f! The operation will be explained using the tj calculation of the degree of difference in I', A, and B as an example.

A−(2,−3,4) B= (−2,1,2) 上記データ群A、Bの各データを例えば4ピッ1−で2
の補数表現すると、 A= (0010,1101,0100)13 = (
1110,0001,0010+となる。
A-(2,-3,4) B= (-2,1,2) For example, each data of the above data groups A and B is 2 with 4 pips 1-
Expressed as the complement of, A= (0010,1101,0100)13 = (
It becomes 1110,0001,0010+.

Li ス、△+ −=0010. B+ = 11−1
0が入力されるど加障恒1路10は A 1−t B + −0010−1OOO1= 00
11を出力し、この2進データ(0011)はデータ変
換回路12に人力される。A1 とBl 、及び加算回
路10からの最上位桁、Fがリビットは(oio)とな
ることからFOR回路11の論理出力は0■1■0−1 どなり、データ変換回路12への入力データ(ooii
)はEORゲート12− i 〜12−nを介してその
まま(0011’)として出力される。そして、加算回
路13で、データ変換回路12からの出力とFOR回路
11の論理出力と既にクリアされているレジスタ14の
格納データが加算され、0011→1 +0 = 01
00 該加算データ(0100)がレジスタ14に格納される
Lisu, △+ −=0010. B+ = 11-1
If 0 is input, the 1st path 10 will be A 1-t B + -0010-1OOO1= 00
11, and this binary data (0011) is manually input to the data conversion circuit 12. A1 and Bl, and the most significant digit from the adder circuit 10, F is rebit is (oio), so the logical output of the FOR circuit 11 is 0■1■0-1, and the input data to the data conversion circuit 12 ( ooii
) is output as is (0011') via the EOR gates 12-i to 12-n. Then, in the adder circuit 13, the output from the data conversion circuit 12, the logical output of the FOR circuit 11, and the data stored in the register 14, which has already been cleared, are added, and 0011→1 +0 = 01
00 The added data (0100) is stored in the register 14.

次に、A+ =1101、B、 =oooiが入ノ〕さ
れると、加算回路10の出力は A + 十B + −1101−1−1110= Jl
:’1011E01(回路11の論理出力は 1Φ001=0 となり、データ!ll’1ijl路12への入力データ
(ioii)は、E(月(ゲーl−12−1〜12− 
nを介して反転されて(0100)どして出力される。
Next, when A+ = 1101, B, =oooi are input, the output of the adder circuit 10 is A + 1B + -1101-1-1110 = Jl
:'1011E01 (The logic output of the circuit 11 is 1Φ001=0, and the input data (ioii) to the data!ll'1ijl path 12 is
It is inverted via n and output as (0100).

そして、加算回路13で、データ変換回vIi12から
の当該出力データ(0100)とF、 OR回路11の
論理出力゛′0′″とレジスタ14の格納データ(01
00)とが加Cフされ 0100+ O+0100= 1(100該加算データ
(1000)がレジスタ14に格納される。
Then, in the adder circuit 13, the output data (0100) from the data conversion circuit vIi12 and F, the logical output ``'0'''' of the OR circuit 11 and the stored data (01
00) is added and 0100+O+0100=1(100) The added data (1000) is stored in the register 14.

更に、A+ =0100、B + = 0010が入力
すると、加算回路10の出力は A + + 8 + = 010(Ll” 1101=
 :、1.:0001EOR回路11の論理出力は 0ΦOΦ1−1 となり、データ変換回路への入力データ(0001)は
、FORゲー1−を介してそのまま(0001)として
出力され。そして、加t1回路13の出力が0001+
1 +1000= 1010どなって、該加算データ(
0110)がレジスタ14に格納される。
Furthermore, when A+ = 0100 and B + = 0010 are input, the output of the adder circuit 10 is A + + 8 + = 010 (Ll" 1101 =
:, 1. :0001 The logical output of the EOR circuit 11 becomes 0ΦOΦ1-1, and the input data (0001) to the data conversion circuit is output as is (0001) via the FOR game 1-. Then, the output of the addition t1 circuit 13 is 0001+
1 +1000=1010, so the added data (
0110) is stored in the register 14.

このようにf−夕群Δ、13のリベての構成j゛−タつ
いての演算が終了したときのレジスタ14に格納された
γ−タ(1010)が、上記データ1!YA、Bにおけ
る互いに対応した各データの差の絶対値の累積和、すな
わら相違ICEどなり、この場合、相違度はrlOJ 
(10進数)である。
In this way, the γ-ta (1010) stored in the register 14 when the computation of the f-event group Δ, 13 is completed, the γ-ta (1010) is the data 1! The cumulative sum of the absolute values of the differences between mutually corresponding data in YA and B, that is, the difference ICE, in this case, the degree of difference is rlOJ
(decimal number).

上記のように本実施例は、加算回路10の最上位桁[が
りビットと入力するデータA+、B+の最上位ピッ1−
との排他的論理和回路によっ−CデータA+ 、B+ 
の大小の判定を行い、該判定結果に基づく加算回路10
の最に位桁上がりピッ]〜以外の2進データの変換デー
タ、及び当該排他的論理和出力の加算によってデータA
+ 。
As described above, in this embodiment, the most significant digit of the adder circuit 10 [gari bit] and the most significant bit 1- of the input data A+, B+
-C data A+, B+ by exclusive OR circuit with
The addition circuit 10 determines the magnitude of the
Data A is obtained by adding the conversion data of binary data other than ~ and the exclusive OR output.
+.

B1の差の絶対値がめられるため、第1図に示′1J装
置のようにデータA+ 、81 を選択するマルチプレ
クサ2.3が不問になると共に、データAt 、Bl 
の大小を判定する回路構成が簡単となる。
Since the absolute value of the difference in B1 is determined, the multiplexer 2.3 that selects the data A+, 81 as in the '1J device shown in FIG.
The circuit configuration for determining the magnitude of is simplified.

第3図は本発明の他の実施例を示づブロック図である。FIG. 3 is a block diagram showing another embodiment of the present invention.

この実施例は、加算回路1oがらの最上位桁上がりビッ
ト以外の2進データど、EOR回路11の論理出力ビッ
1−とをレジスタ15に格納するような構成となり、こ
のレジスタ15は、レジスタ14と同一のクロックに同
期して、出力及び格納動作を行なうものである。このよ
うな構成にすれば、データ/’z 、St を入力して
から、レジスタ15にデータを格納するまでの動作と、
レジスタ15からデータを出力してから、レジスタ14
にデータを格納するまでの動作とが同一クロック同期内
に並列して行なわれるため、そのクロック周期を第2図
に示す場合より小さくすることができ、ぞの結果、装置
全体の処理を更に高速化できる。
This embodiment has a configuration in which binary data other than the most significant carry bit from the adder circuit 1o and the logic output bit 1- of the EOR circuit 11 are stored in a register 15. Output and storage operations are performed in synchronization with the same clock. With such a configuration, the operation from inputting the data /'z, St to storing the data in the register 15,
After outputting data from register 15, register 14
Since the operations up to data storage are performed in parallel within the same clock synchronization, the clock cycle can be made smaller than in the case shown in Figure 2, and as a result, the overall processing speed of the device is even faster. can be converted into

(7) 発明の効巣 以、[詳細に説明したように、本発明によれば、2の補
数表現された2進データからなる2つのデータ群におけ
る互いに対応した各データの差の絶対値の和を計算プる
相違度肝篩装置が、従来考えられていたものよりもtr
illな回路構成で実現でき、その結果、その演幹処理
も更に高速化することができる。
(7) Effects of the invention [As explained in detail, according to the present invention, the absolute value of the difference between mutually corresponding data in two data groups consisting of binary data expressed in two's complement The dissimilarity liver sieve device that calculates the sum has a higher tr than previously thought.
This can be realized with an illuminating circuit configuration, and as a result, the stem processing speed can be further increased.

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

第1図は従来考えられていた相)0度計算装置を示すブ
ロック図、第2図、及び第3図は本発明の実施例を示す
ブロック図である。 10、13・・・加算回路 11・・・排他的論理和回路(FOR回路)12・・・
データ変換回路 14・・・レジスタ特 許 出願人 
富士通株式会社
FIG. 1 is a block diagram showing a conventional phase zero degree calculating device, and FIGS. 2 and 3 are block diagrams showing embodiments of the present invention. 10, 13...Addition circuit 11...Exclusive OR circuit (FOR circuit) 12...
Data conversion circuit 14...Register patent Applicant
Fujitsu Limited

Claims (1)

【特許請求の範囲】[Claims] 負の数のみが2の補数表現された2つの2進データ各の
差の絶対値を計算する装置であって、前記2進データの
うちの一方の2進データと、他方の2進データの反転デ
ータとを加算する加算回路ど、前記2つの2進データの
符号ビットと前記加算回路から出力される最上位桁上が
りピッ1〜とが入力され、当該ビットデータにより前記
2つの2進データの大、小を判定する判定回路と、前記
加算回路からの最上位桁上がりビット以外の゛出力2進
データを、前記一方の2進データが前記他方の2進デー
タより大なるときは、そのまま出力lノ、前記一方の2
進データが前記他方の2進データ以下であるときは、反
転した後、“1″を加算して出力する回路とを備えてな
る相違度計算装置。
A device that calculates the absolute value of the difference between two pieces of binary data in which only negative numbers are expressed as two's complement, and which calculates the absolute value of the difference between one piece of the binary data and the other piece of binary data. The sign bit of the two binary data and the most significant carry bit 1~ output from the adder circuit are input to the adder circuit that adds the inverted data, and the bit data adds the two binary data. A determination circuit that determines whether it is large or small, and output binary data other than the most significant carry bit from the adder circuit, if the one binary data is greater than the other binary data, output as is. lno, one of the above two
and a circuit for inverting and then adding "1" and outputting the result when the binary data is less than or equal to the other binary data.
JP58202291A 1983-10-28 1983-10-28 Calculating device for extent of difference Granted JPS60186979A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP58202291A JPS60186979A (en) 1983-10-28 1983-10-28 Calculating device for extent of difference

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP58202291A JPS60186979A (en) 1983-10-28 1983-10-28 Calculating device for extent of difference

Publications (2)

Publication Number Publication Date
JPS60186979A true JPS60186979A (en) 1985-09-24
JPH0315209B2 JPH0315209B2 (en) 1991-02-28

Family

ID=16455105

Family Applications (1)

Application Number Title Priority Date Filing Date
JP58202291A Granted JPS60186979A (en) 1983-10-28 1983-10-28 Calculating device for extent of difference

Country Status (1)

Country Link
JP (1) JPS60186979A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0199190A (en) * 1987-10-13 1989-04-18 Fujitsu Ltd Distance calculation circuit

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS55121483A (en) * 1979-03-07 1980-09-18 Ibm Absolute difference generation mechanism
JPS58132861A (en) * 1982-02-03 1983-08-08 Toshiba Corp Arithmetic circuitry

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS55121483A (en) * 1979-03-07 1980-09-18 Ibm Absolute difference generation mechanism
JPS58132861A (en) * 1982-02-03 1983-08-08 Toshiba Corp Arithmetic circuitry

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0199190A (en) * 1987-10-13 1989-04-18 Fujitsu Ltd Distance calculation circuit

Also Published As

Publication number Publication date
JPH0315209B2 (en) 1991-02-28

Similar Documents

Publication Publication Date Title
Chang et al. A low power radix-4 booth multiplier with pre-encoded mechanism
US5390136A (en) Artificial neuron and method of using same
Vun et al. A new RNS based DA approach for inner product computation
JPS6375932A (en) Digital multiplier
Gokhale et al. Design of Vedic-multiplier using area-efficient Carry Select Adder
Cho et al. Design of very high-speed pipeline FIR filter through precise critical path analysis
Hyun et al. Constant-time synchronous binary counter with minimal clock period
Swartzlander A review of large parallel counter designs
Khan et al. Comparative analysis of different algorithm for design of high-speed multiplier accumulator unit (MAC)
JPH08221256A (en) Multiplier and product-sum arithmetic unit
Nair et al. tugemm: Area-power-efficient temporal unary gemm architecture for low-precision edge ai
US11475288B2 (en) Sorting networks using unary processing
JPS60186979A (en) Calculating device for extent of difference
Balsara et al. Understanding VLSI bit serial multipliers
Givaki et al. High-performance deterministic stochastic computing using residue number system
Kali et al. Low-complexity distributed arithmetic-based architecture for inner-product of variable vectors
Swathi et al. Implementation of An Energy-Efficient Binary Square Rooter Using Reversible Logic By Applying The Non-Restoring Algorithm
Zhang et al. Design of low power LSTM neural network accelerator based on FPGA
JPH10111791A (en) Division device
Yang et al. Lane shared bit-pragmatic deep neural network computing architecture and circuit
Struharik et al. Intellectual property core implementation of decision trees
CN114239818B (en) Memory computing architecture neural network accelerator based on TCAM and LUT
US4041296A (en) High-speed digital multiply-by-device
Reddy et al. A high speed, high Radix 32-bit Redundant parallel multiplier
Kalaimathi et al. A Survey on Area Efficient Low Power High Speed Multipliers