JP2014154196A - Associative memory - Google Patents

Associative memory Download PDF

Info

Publication number
JP2014154196A
JP2014154196A JP2013025465A JP2013025465A JP2014154196A JP 2014154196 A JP2014154196 A JP 2014154196A JP 2013025465 A JP2013025465 A JP 2013025465A JP 2013025465 A JP2013025465 A JP 2013025465A JP 2014154196 A JP2014154196 A JP 2014154196A
Authority
JP
Japan
Prior art keywords
distance
circuit
signal
counter
reference data
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
JP2013025465A
Other languages
Japanese (ja)
Other versions
JP6085187B2 (en
Inventor
Hansjuergen Matthew
ハンスユルゲン マタウシュ
Seiryu Sasaki
静龍 佐々木
Tomonobu Akazawa
智信 赤澤
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.)
Hiroshima University NUC
Original Assignee
Hiroshima University NUC
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 Hiroshima University NUC filed Critical Hiroshima University NUC
Priority to JP2013025465A priority Critical patent/JP6085187B2/en
Publication of JP2014154196A publication Critical patent/JP2014154196A/en
Application granted granted Critical
Publication of JP6085187B2 publication Critical patent/JP6085187B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Radar Systems Or Details Thereof (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an associative memory such that similarity retrieval can be accurately performed even when Euclidean distances are used.SOLUTION: An associative memory 100 includes: distance arithmetic circuits DPto DPwhich calculate Manhattan distances between R (R: an integer equal to or larger than 2) reference data having a bit length of M×W (W: an integer equal to or larger than 1, W: an integer equal to or larger than 2) bits and retrieval data having a bit length of M×W bits; and distance/clock number conversion circuits DCto DC. The distance/clock number conversion circuits DCto DCuse the Manhattan distances calculated by the corresponding distance arithmetic circuits to detect the numbers of clocks matching Euclidean distances between the reference data and retrieval data. The distance/clock number conversion circuits output timing signals indicative of timings when the numbers of clocks matching the Euclidean distances of the reference data to the retrieval data.

Description

この発明は、連想メモリに関するものである。   The present invention relates to an associative memory.

近年、文字認識・画像認識などに代表されるパターンマッチングを必要とするアプリケーションが大変注目されている。特に、パターンマッチングをLSI(Large Scale Integrated circuit)上で実現することにより、将来、人工知能およびモバイル機器等の高機能アプリケーションに適用可能になり、この技術の実現は、非常に注目を浴びている。   In recent years, applications that require pattern matching typified by character recognition and image recognition have attracted much attention. In particular, by realizing pattern matching on LSI (Large Scale Integrated Circuit), it will be applicable to high-functional applications such as artificial intelligence and mobile devices in the future, and the realization of this technology has received much attention. .

パターンマッチングでは、データベースに保存された複数の参照データの中から、完全に検索データと一致するパターンを検索する「完全一致検索処理」と、検索データと最も類似するパターンを検索する「最類似検索処理」とがある。   In pattern matching, "complete match search process" that searches for a pattern that completely matches the search data from multiple reference data stored in the database, and "most similar search" that searches for the most similar pattern to the search data. Treatment ".

前者は、CAM(Content Addressable Memory)と呼ばれ、ネットワークルータのIPアドレステーブルのルーティングおよびプロセッサのキャッシュ等の実現に用いられる。人間の脳のような柔軟な検索・比較をコンピュータに処理させるには、後者の最類似検索処理を実現することが必要不可欠である。このような柔軟な比較を実現する機能を持つメモリのことを特に連想メモリ(Associative Memory)と呼ぶ。   The former is called CAM (Content Addressable Memory), and is used to realize the routing of the IP address table of the network router and the cache of the processor. In order for a computer to perform flexible search / comparison such as the human brain, it is indispensable to realize the latter most similar search process. A memory having a function for realizing such a flexible comparison is particularly referred to as an associative memory.

連想メモリを実現する手段として(1)ディジタル方式による実現方法(非特許文献1)、(2)アナログ方式による実現方法および(3)ディジタル・アナログ融合方式(非特許文献2)等が提案されている。   As means for realizing an associative memory, (1) an implementation method using a digital method (Non-patent Document 1), (2) an implementation method using an analog method, and (3) a digital / analog fusion method (Non-Patent Document 2) have been proposed. Yes.

Y. Oike, et al., “A High-Speed and Low-Voltage Associative Co-Processor with Hamming Distance Ordering Using Word-Parallel and Hierarchical Search Architecture,” CICC, 2004.Y. Oike, et al., “A High-Speed and Low-Voltage Associative Co-Processor with Hamming Distance Ordering Using Word-Parallel and Hierarchical Search Architecture,” CICC, 2004. M. A. Abedin, et al., “Nearest-euclidean-distance search associative memory with fully parallel mixed digital-analog match circuitry,” Proc. of SSDM2006, pp. 282-283, 2006.M. A. Abedin, et al., “Nearest-euclidean-distance search associative memory with fully parallel mixed digital-analog match circuitry,” Proc. Of SSDM2006, pp. 282-283, 2006. Y. Oike et al., “A Word-Parallel Digital Associative Engine with Wide SearchRange Based on Manhattan Distance,”CICC, 2004.Y. Oike et al., “A Word-Parallel Digital Associative Engine with Wide SearchRange Based on Manhattan Distance,” CICC, 2004.

非特許文献1に記載の連想メモリは、検索データと参照データとのハミング距離を用いて類似検索を行うものである。そのため、非特許文献1に記載の連想メモリにおいて、ユークリッド距離を用いて類似検索を行うことは困難である。非特許文献2に記載の連想メモリは、検索データと参照データとの類似度を表す距離を電圧に変換するため、誤検索が生じやすい。   The associative memory described in Non-Patent Document 1 performs a similarity search using a Hamming distance between search data and reference data. For this reason, in the associative memory described in Non-Patent Document 1, it is difficult to perform a similarity search using the Euclidean distance. Since the associative memory described in Non-Patent Document 2 converts the distance representing the similarity between the search data and the reference data into a voltage, an erroneous search is likely to occur.

そこで、本発明は、かかる問題を解決するためになされたものであり、その目的は、ユークリッド距離を用いた場合でも正確に類似検索を行うことが可能な連想メモリを提供することである。   Therefore, the present invention has been made to solve such a problem, and an object of the present invention is to provide an associative memory capable of accurately performing a similarity search even when the Euclidean distance is used.

この発明の実施の形態による連想メモリは、各々がM×W(Mは1以上の整数、Wは2以上の整数)ビットのビット長を有するR(Rは2以上の整数)個の参照データを保存する参照データ保存手段と、前記R個の参照データに対応して設けられ、M×Wビットのビット長を有する検索対象の検索データと前記参照データとの差の絶対値を表すR×W個の絶対値差を、前記検索データと前記参照データの距離として算出する第1距離算出手段と、前記参照データごとに、前記第1距離算出手段で算出された前記距離を用い、前記参照データと前記検索データとのユークリッド距離に一致するクロック数を検出したタイミングを示すタイミング信号を出力するタイミング信号出力処理を、前記R個の参照データについて行うタイミング信号出力手段と、前記タイミング信号出力手段から出力されるR個のタイミング信号に基づいて、前記タイミング信号の出力が早い順に、k個(kは1≦k<Rを満たす整数)の前記タイミング信号を検出し、検出した前記k個のタイミング信号を、前記検索データと前記参照データとの類似度を示すマッチ信号として出力するマッチ信号出力手段と、を備える。   The associative memory according to the embodiment of the present invention has R (R is an integer of 2 or more) reference data each having a bit length of M × W (M is an integer of 1 or more, W is an integer of 2 or more) bits. Reference data storage means for storing R × Rx, which is provided corresponding to the R pieces of reference data, and represents an absolute value of a difference between the search data having a bit length of M × W bits and the reference data The first distance calculation means for calculating W absolute value differences as the distance between the search data and the reference data, and the reference calculated using the distance calculated by the first distance calculation means for each reference data. Timing signal output process for performing timing signal output processing for outputting the timing signal indicating the timing at which the number of clocks matching the Euclidean distance between the data and the search data is detected for the R reference data And k timing signals (k is an integer satisfying 1 ≦ k <R) are detected in order from the earliest output of the timing signal based on the R timing signals output from the timing signal output means. And a match signal output means for outputting the detected k timing signals as a match signal indicating the similarity between the search data and the reference data.

この発明の実施の形態による連想メモリにおいては、タイミング信号出力手段は、第1距離算出手段で算出された、各参照データと検索データとの絶対値差を用いて、参照データごとに、検索データとのユークリッド距離に一致するクロック数を検出したタイミングでタイミング信号を出力する。すなわち、タイミング信号出力手段は、各参照データについて算出された絶対値差を、参照データと検索データとのユークリッド距離に相当するクロック数に変換し、変換したクロック数が得られるタイミングでタイミング信号を出力する。その結果、参照データと検索データとのユークリッド距離の大きさに応じて、その参照データのタイミング信号の出力タイミングが決まり、各参照データについて、ユークリッド距離を用いた検索を適切に行うことができる。   In the associative memory according to the embodiment of the present invention, the timing signal output means uses the absolute value difference between each reference data and the search data calculated by the first distance calculation means to search data for each reference data. A timing signal is output at the timing when the number of clocks matching the Euclidean distance is detected. That is, the timing signal output means converts the absolute value difference calculated for each reference data into a clock number corresponding to the Euclidean distance between the reference data and the search data, and outputs the timing signal at a timing at which the converted clock number is obtained. Output. As a result, the output timing of the timing signal of the reference data is determined according to the magnitude of the Euclidean distance between the reference data and the search data, and the search using the Euclidean distance can be appropriately performed for each reference data.

従って、本発明の実施の形態によれば、ユークリッド距離を用いた場合でも正確に類似検索を行うことができる。   Therefore, according to the embodiment of the present invention, a similarity search can be accurately performed even when the Euclidean distance is used.

第1実施形態に係る連想メモリの構成を示す概略ブロック図である。It is a schematic block diagram which shows the structure of the content addressable memory which concerns on 1st Embodiment. 図2Aは、図1に示す距離/クロック数変換回路の構成を示す概略図である。FIG. 2A is a schematic diagram showing the configuration of the distance / clock number conversion circuit shown in FIG. 図2Bは、図2Aに示すカウンタ一致検出回路の構成例を示す概略図である。FIG. 2B is a schematic diagram illustrating a configuration example of the counter coincidence detection circuit illustrated in FIG. 2A. 図3は、図1に示すWinner検出器の動作を説明するための図である。FIG. 3 is a diagram for explaining the operation of the Winner detector shown in FIG. 図4は、第2実施形態における距離/クロック数変換回路の構成を示す概略図である。FIG. 4 is a schematic diagram showing a configuration of a distance / clock number conversion circuit in the second embodiment. 図5Aは、第1、第2実施形態の場合の検索時間を表す図である。FIG. 5A is a diagram illustrating search times in the first and second embodiments. 図5Bは、第3実施形態の場合の検索時間を表す図である。FIG. 5B is a diagram illustrating a search time in the case of the third embodiment. 図6は、第3実施形態に係る連想メモリの構成を示す概略ブロック図である。FIG. 6 is a schematic block diagram showing the configuration of the associative memory according to the third embodiment. 図7は、図6に示す距離/クロック数変換回路の構成例を示す概略図である。FIG. 7 is a schematic diagram showing a configuration example of the distance / clock number conversion circuit shown in FIG. 図8は、図7に示すカウンタ一致検出回路の構成例を示す概略図である。FIG. 8 is a schematic diagram showing a configuration example of the counter coincidence detection circuit shown in FIG. 図9Aは、図8に示すカウンタと一致検出回路の構成例を示す概略図である。FIG. 9A is a schematic diagram illustrating a configuration example of the counter and the coincidence detection circuit illustrated in FIG. 図9Bは、図9Aに示すカウンタの動作例を示す図である。FIG. 9B is a diagram illustrating an operation example of the counter illustrated in FIG. 9A. 図10Aは、第3実施形態における距離/クロック数変換回路の動作例を説明する図である。FIG. 10A is a diagram illustrating an operation example of the distance / clock number conversion circuit according to the third embodiment. 図10Bは、図10Aに示す例におけるカウンタの動作例を示す図である。FIG. 10B is a diagram illustrating an operation example of the counter in the example illustrated in FIG. 10A. 図10Cは、図10Aに示す例におけるカウンタの動作例を示す図である。FIG. 10C is a diagram illustrating an operation example of the counter in the example illustrated in FIG. 10A. 図10Dは、図10Aに示す例におけるカウンタの動作例を示す図である。FIG. 10D is a diagram illustrating an operation example of the counter in the example illustrated in FIG. 10A. 図11は、第4実施形態における距離演算回路の回路構成例を示す概略図である。FIG. 11 is a schematic diagram illustrating a circuit configuration example of a distance calculation circuit according to the fourth embodiment. 図12は、図11に示す演算回路の回路構成例を示す概略図である。FIG. 12 is a schematic diagram illustrating a circuit configuration example of the arithmetic circuit illustrated in FIG. 図13は、第4実施形態における二乗計算の処理過程を説明する図である。FIG. 13 is a diagram for explaining the square calculation process in the fourth embodiment. 図14は、第4実施形態におけるカウンタ一致検出回路の構成例を示す概略図である。FIG. 14 is a schematic diagram illustrating a configuration example of a counter coincidence detection circuit according to the fourth embodiment. 図15は、変形例(1)における距離/クロック数変換回路の構成例を示す概略図である。FIG. 15 is a schematic diagram showing a configuration example of the distance / clock number conversion circuit in the modification example (1).

本発明の実施の形態について図面を参照しながら詳細に説明する。なお、図中同一または相当部分には同一符号を付してその説明は繰返さない。   Embodiments of the present invention will be described in detail with reference to the drawings. In the drawings, the same or corresponding parts are denoted by the same reference numerals and description thereof will not be repeated.

<第1実施形態>
図1は、この発明の実施の形態による連想メモリの構成を示す概略ブロック図である。図1を参照して、この発明の第1実施形態による連想メモリ100は、メモリアレイ部10と、Winner検出器20とを備える。
<First Embodiment>
FIG. 1 is a schematic block diagram showing a configuration of an associative memory according to an embodiment of the present invention. Referring to FIG. 1, an associative memory 100 according to the first embodiment of the present invention includes a memory array unit 10 and a Winner detector 20.

メモリアレイ部10は、メモリ部1、行デコーダ2、列デコーダ3、読出/書込回路4、及び検索データ保存回路5を含む。   Memory array unit 10 includes a memory unit 1, a row decoder 2, a column decoder 3, a read / write circuit 4, and a search data storage circuit 5.

メモリ部1は、参照データ保存回路(Storage Cell:SC)SC11〜SC1W,SC21〜SC2W,・・・,SCR1〜SCRWと、距離演算回路(絶対値差演算回路)(Distance Processor:DP)DP11〜DP1W,DP21〜DP2W,・・・,DPR1〜DPRWと、距離/クロック数変換回路DC〜DCとを含む。なお、WおよびRの各々は、2以上の整数である。 Memory unit 1, the reference data storage circuit (Storage Cell: SC) SC 11 ~SC 1W, SC 21 ~SC 2W, ···, and SC R1 to SC RW, the distance calculation circuit (absolute value difference calculation circuit) (Distance Processor: including DP) DP 11 ~DP 1W, DP 21 ~DP 2W, ···, and DP R1 to DP RW, and a distance / clock number conversion circuit DC 1 to DC R. Each of W and R is an integer of 2 or more.

距離演算回路DP11〜DP1Wは、それぞれ、参照データ保存回路SC11〜SC1Wに対応して設けられる。また、距離演算回路DP21〜DP2Wは、それぞれ、参照データ保存回路SC21〜SC2Wに対応して設けられる。以下、同様にして、距離演算回路DPR1〜DPRWは、それぞれ、参照データ保存回路SCR1〜SCRWに対応して設けられる。 Distance calculating circuit DP 11 to DP 1W, respectively provided corresponding to the reference data storage circuit SC 11 to SC 1W. The distance calculating circuit DP 21 to DP 2W are respectively provided corresponding to the reference data storage circuit SC 21 to SC 2W. In the same manner, the distance calculation circuit DP R1 to DP RW are respectively provided corresponding to the reference data storage circuit SC R1 to SC RW.

距離/クロック数変換回路DCは、距離演算回路DP11〜DP1Wに対応して設けられる。距離/クロック数変換回路DCは、距離演算回路DP21〜DP2Wに対応して設けられる。以下、同様にして、距離/クロック数変換回路DCは、距離演算回路DPR1〜DPRWに対応して設けられる。 Distance / clock number converting circuit DC 1 is provided corresponding to the distance calculation circuit DP 11 to DP 1W. Distance / clock number converting circuit DC 2 is provided corresponding to the distance computing circuit DP 21 to DP 2W. In the same manner, the distance / clock number converting circuit DC R are provided corresponding to the distance calculation circuit DP R1 to DP RW.

参照データ保存回路SC11〜SC1W,SC21〜SC2W,・・・,SCR1〜SCRWは、行デコーダ2、列デコーダ3および読出/書込回路4によって書き込まれた参照データを保存する。この場合、参照データ保存回路SC11〜SC1Wは、M×W(Mは1以上の整数)ビットの参照データ1を保存し、参照データ保存回路SC21〜SC2Wは、M×Wビットの参照データ2を保存し、以下、同様にして、参照データ保存回路SCR1〜SCRWは、M×Wビットの参照データRを保存する。つまり、参照データ保存回路SC11〜SC1W,SC21〜SC2W,・・・,SCR1〜SCRWの各々は、参照データのMビットを保存する。 Reference data storage circuits SC 11 to SC 1W , SC 21 to SC 2W ,..., SC R1 to SC RW store reference data written by the row decoder 2, the column decoder 3, and the read / write circuit 4. . In this case, the reference data storage circuits SC 11 to SC 1W store M × W (M is an integer of 1 or more) bits of reference data 1, and the reference data storage circuits SC 21 to SC 2W have M × W bits. The reference data 2 is stored, and the reference data storage circuits SC R1 to SC RW store the M × W bit reference data R in the same manner. That is, the reference data storage circuit SC 11 ~SC 1W, SC 21 ~SC 2W, ···, each SC R1 to SC RW stores M-bit reference data.

距離演算回路DP11〜DP1Wは、参照データ保存回路SC11〜SC1Wに保存されたM×Wビットの参照データ1と、検索データ保存回路5に保存されたM×Wビットの検索データとの距離を後述する方法によって演算する。また、距離演算回路DP21〜DP2Wは、参照データ保存回路SC21〜SC2Wに保存されたM×Wビットの参照データ2と、検索データ保存回路5に保存されたM×Wビットの検索データとの距離を後述する方法によって演算する。以下、同様にして、距離演算回路DPR1〜DPRWは、参照データ保存回路SCR1〜SCRWに保存されたM×Wビットの参照データRと、検索データ保存回路5に保存されたM×Wビットの検索データとの距離を後述する方法によって演算する。そして、距離演算回路DP11〜DP1W、距離演算回路DP21〜DP2W、・・・、および距離演算回路DPR1〜DPRWにおける参照データと検索データとの距離の演算は、並列に行なわれる。 The distance calculation circuits DP 11 to DP 1W include M × W bit reference data 1 stored in the reference data storage circuits SC 11 to SC 1W , M × W bit search data stored in the search data storage circuit 5, and Is calculated by a method described later. The distance calculation circuits DP 21 to DP 2W search for the M × W bit reference data 2 stored in the reference data storage circuits SC 21 to SC 2W and the M × W bit search stored in the search data storage circuit 5. The distance from the data is calculated by the method described later. In the same manner, the distance calculation circuits DP R1 to DP RW perform the M × W bit reference data R stored in the reference data storage circuits SC R1 to SC RW and the M × W stored in the search data storage circuit 5. The distance from the W-bit search data is calculated by a method described later. The distance calculation circuits DP 11 to DP 1W , the distance calculation circuits DP 21 to DP 2W ,..., And the distance calculation circuits DP R1 to DP RW calculate the distance between the reference data and the search data in parallel. .

そして、距離演算回路DP11〜DP1Wは、参照データ1と検索データとの距離をM×Wビットの距離信号として距離/クロック数変換回路DCへ出力する。距離演算回路DP21〜DP2Wは、参照データ2と検索データとの距離をM×Wビットの距離信号として距離/クロック数変換回路DCへ出力する。以下、同様にして、距離演算回路DPR1〜DPRWは、参照データRと検索データとの距離をM×Wビットの距離信号として距離/クロック数変換回路DCへ出力する。 The distance calculation circuits DP 11 to DP 1W output the distance between the reference data 1 and the search data to the distance / clock number conversion circuit DC 1 as an M × W bit distance signal. The distance calculation circuits DP 21 to DP 2W output the distance between the reference data 2 and the search data to the distance / clock number conversion circuit DC 2 as an M × W bit distance signal. Similarly, the distance calculation circuits DP R1 to DP RW output the distance between the reference data R and the search data to the distance / clock number conversion circuit DC R as an M × W bit distance signal.

距離演算回路DP11〜DP1Wの各々は、参照データ1と検索データとの距離を次式を用いて演算する。 Each of the distance calculation circuits DP 11 to DP 1W calculates the distance between the reference data 1 and the search data using the following equation.

Figure 2014154196
Figure 2014154196

式(1)において、Drj(r=1〜R,j=1〜W)は、参照データと検索データとの距離(絶対値差)を表す。nMrは参照データと検索データとのマンハッタン距離を示している。また、式(1)において、Inは、検索データであり、Rerjは、参照データである。各データIn,Rerjの各々は、Mビットからなる。 In Expression (1), D rj (r = 1 to R, j = 1 to W) represents a distance (absolute value difference) between the reference data and the search data. n Mr indicates the Manhattan distance between the reference data and the search data. In Expression (1), In j is search data, and Re rj is reference data. Each of the data In j and Re rj consists of M bits.

このように、距離演算回路DP11〜DP1Wは、M×Wビットの参照データ1と、M×Wビットの検索データとの距離をMビットずつ演算し、各々がMビットのビット長を有するW個の距離信号D1jを距離/クロック数変換回路DCへ出力する。 In this way, the distance calculation circuits DP 11 to DP 1W calculate the distance between the M × W bit reference data 1 and the M × W bit search data by M bits, and each has a bit length of M bits. The W distance signals D 1j are output to the distance / clock number conversion circuit DC 1 .

距離演算回路DP21〜DP2W、・・・および距離演算回路DPR1〜DPRWも、同様にして、それぞれ、式(1)を用いて参照データ2〜Rと検索データとの距離を演算する。そして、距離演算回路DP21〜DP2W、・・・および距離演算回路DPR1〜DPRWも、各々がMビットのビット長を有するW個の距離信号D2j〜DRjをそれぞれ距離/クロック数変換回路DC〜DCへ出力する。 Similarly, the distance calculation circuits DP 21 to DP 2W ,... And the distance calculation circuits DP R1 to DP RW respectively calculate the distance between the reference data 2 to R and the search data using the equation (1). . The distance calculation circuits DP 21 to DP 2W ,... And the distance calculation circuits DP R1 to DP RW also receive W distance signals D 2j to DR Rj each having a bit length of M bits. and outputs it to the converter DC 2 ~DC R.

距離/クロック数変換回路DCは、距離演算回路DP11〜DP1WからW個の距離信号D1jを受け、各距離信号D1jの二乗値の和に相当するクロック信号CLKのクロック数CN_total1を後述する方法によってカウントする。そして、そのクロック数CN_total1をカウントしたタイミングを示すタイミング信号CをWinner検出器20へ出力する。 Distance / clock number converting circuit DC 1 receives a W number of distance signal D 1j from the distance calculation circuit DP 11 to DP 1W, the clock number CN_total1 of the clock signal CLK corresponding to the sum of the square of the distance signal D 1j It counts by the method mentioned later. Then, a timing signal C 1 indicating the timing at which the clock number CN_total 1 is counted is output to the Winner detector 20.

距離/クロック数変換回路DCは、距離演算回路DP21〜DP2WからW個の距離信号D2jを受け、各距離信号D2jの二乗値の和に相当するクロック信号CLKのクロック数CN_total2を後述する方法によってカウントする。そして、そのクロック数CN_total2をカウントしたタイミングを示すタイミング信号CをWinner検出器20へ出力する。 Distance / clock number converting circuit DC 2, the distance calculation circuit DP 21 receives the W-number of distance signal D 2j from to DP 2W, the clock number CN_total2 of the clock signal CLK corresponding to the sum of the square of the distance signal D 2j It counts by the method mentioned later. Then, the timing signal C 2 indicating the timing when the clock number CN_total 2 is counted is output to the Winner detector 20.

以下、同様にして、距離/クロック数変換回路DCは、距離演算回路DPR1〜DPRWからW個の距離信号DRjを受け、各距離信号DRjの二乗値の和に一致するクロック信号CLKのクロック数CN_totalRを後述する方法によってカウントする。そして、そのクロック数CN_totalRをカウントしたタイミングを示すタイミング信号CをWinner検出器20へ出力する。 In the same manner, the distance / clock number converting circuit DC R, the distance calculation circuit DP R1 to DP RW received a W number of distance signal D Rj from the matching clock signals to the sum of the square of the distance signal D Rj The clock number CN_totalR of CLK is counted by a method described later. Then, a timing signal C R indicating the timing of counting the number of clocks CN_totalR to Winner detector 20.

行デコーダ2は、メモリ部1の行方向のアドレスを指定する。列デコーダ3は、メモリ部1の列方向のアドレスを指定する。読出/書込回路4は、参照データを行デコーダ2および列デコーダ3によって指定された参照データ保存回路SC11〜SC1W,SC21〜SC2W,・・・,SCR1〜SCRWに書き込むとともに、検索データを検索データ保存回路5に書き込む。 The row decoder 2 designates an address in the row direction of the memory unit 1. The column decoder 3 designates an address in the column direction of the memory unit 1. Read / write circuit 4 writes reference data to reference data storage circuits SC 11 to SC 1W , SC 21 to SC 2W ,..., SC R1 to SC RW designated by row decoder 2 and column decoder 3. The search data is written into the search data storage circuit 5.

検索データ保存回路5は、読出/書込回路4によって書き込まれた検索データ(M×Wビットのデータ)を保存する。   The search data storage circuit 5 stores the search data (M × W bit data) written by the read / write circuit 4.

Winner検出器20は、タイミング信号C〜Cをそれぞれ距離/クロック数変換回路DC〜DCから受ける。そして、その受けたタイミング信号C〜Cのうち、一致タイミングが早い順にk(kは1≦k<Rを満たす整数)個のタイミング信号を検出し、その検出したk個のタイミング信号を検索データと参照データとの類似度を示すマッチ信号M〜Mとして出力する。 Winner detector 20 receives a timing signal C 1 -C R from the distance / clock number converting each circuit DC 1 to DC R. Then, among the received timing signal C 1 -C R, k matches timing in chronological order (k is an integer satisfying a 1 ≦ k <R) detects the number of timing signals, a k-number of timing signal detection Output as match signals M 1 to M k indicating the similarity between the search data and the reference data.

図2Aは、図1に示す距離/クロック数変換回路DCの構成を表す概略構成図である。なお、図1に示す距離/クロック数変換回路DC〜距離/クロック数変換回路DCの各々も、図2Aに示す距離/クロック数変換回路DCと同様の構成を有する。図2Aに示すように、距離/クロック数変換回路DCは、バッファ21〜2Wと、カウンタ一致検出回路31〜3Wとを含む。 Figure 2A is a schematic block diagram showing the configuration of a distance / clock number converting circuit DC 1 shown in FIG. Also each of the distance / clock number conversion circuits DC 2 ~ Distance / clock number conversion circuit DC R shown in FIG. 1, has the same configuration as the distance / clock number conversion circuit DC 1 shown in Figure 2A. As shown in FIG. 2A, the distance / clock number converting circuit DC 1 includes a buffer 21~2W, a counter coincidence detection circuit 31~3W.

バッファ21は、連想メモリ100の制御回路(図示せず)から検索開始信号SBを受け、連想メモリ100に内蔵されたクロック発生回路(図示せず)からクロック信号CLKを受ける。そして、バッファ21は、検索開始信号SBがL(Low)レベルからH(High)レベルに切り替わると、その受けたクロック信号CLKをバッファ22およびカウンタ一致検出回路31へ出力する。バッファ22は、クロック信号CLKをバッファ21から受け、カウンタ一致検出回路31から、後述するHレベルの一致信号(DETECT1)を受けると、クロック信号CLKをバッファ23(図示せず)及びカウンタ一致検出回路32へ出力する。以下、同様にして、バッファ2Wは、クロック信号CLKをバッファ2W−1(図示せず)から受け、カウンタ一致検出回路3W−1(図示せず)から、後述するHレベルの一致信号(DETECTW−1)を受けると、クロック信号CLKをカウンタ一致検出回路3Wへ出力する。   The buffer 21 receives a search start signal SB from a control circuit (not shown) of the associative memory 100 and receives a clock signal CLK from a clock generation circuit (not shown) built in the associative memory 100. Then, when the search start signal SB is switched from the L (Low) level to the H (High) level, the buffer 21 outputs the received clock signal CLK to the buffer 22 and the counter match detection circuit 31. When the buffer 22 receives the clock signal CLK from the buffer 21 and receives an H level coincidence signal (DETECT1) to be described later from the counter coincidence detection circuit 31, the buffer 22 receives the clock signal CLK from the buffer 23 (not shown) and the counter coincidence detection circuit. To 32. Similarly, the buffer 2W receives the clock signal CLK from the buffer 2W-1 (not shown), and receives an H level coincidence signal (DETECTW-) described later from the counter coincidence detection circuit 3W-1 (not shown). 1), the clock signal CLK is output to the counter coincidence detection circuit 3W.

カウンタ一致検出回路31〜3Wは、それぞれ、距離演算回路DP11〜DP1Wに対応して設けられる。そして、カウンタ一致検出回路31〜3Wは、直列に接続される。ここで、カウンタ一致検出回路31〜3Wの概略構成について説明する。 Counter coincidence detection circuits 31 to 3W are provided corresponding to distance calculation circuits DP 11 to DP 1W , respectively. The counter match detection circuits 31 to 3W are connected in series. Here, a schematic configuration of the counter coincidence detection circuits 31 to 3W will be described.

図2Bは、距離/クロック数変換回路DCにおけるカウンタ一致検出回路31〜3Wの構成例を示す図である。図2Bの例では、W=2の場合を示している。カウンタ一致検出回路31は、クロック数変換回路31aと、カウンタ31bと、一致検出回路31cとを含む。カウンタ一致検出回路32は、クロック数変換回路32aと、カウンタ32bと、一致検出回路32cとを含む。以下、各構成の機能について説明する。 Figure 2B is a diagram showing a configuration example of the counter match detection circuit 31~3W at a distance / clock number conversion circuit DC 1. In the example of FIG. 2B, the case of W = 2 is shown. The counter coincidence detection circuit 31 includes a clock number conversion circuit 31a, a counter 31b, and a coincidence detection circuit 31c. The counter coincidence detection circuit 32 includes a clock number conversion circuit 32a, a counter 32b, and a coincidence detection circuit 32c. Hereinafter, the function of each component will be described.

クロック数変換回路31aは、距離演算回路DP11からMビットのビット長を有する距離信号D11と、バッファ21からのクロック信号CLKとを受ける。クロック数変換回路31aは、クロック信号CLKのクロック数をカウントし、距離信号D11が示す距離と一致するクロック数を検出したタイミングで、カウンタ31bにHレベルの一致検出信号をカウンタ31bへ出力する処理を行う。クロック数変換回路31aは、後述の一致検出回路31cからHレベルの一致信号(DETECT1)が出力されるまで、この処理を繰り返し行い、Hレベルの一致信号(DETECT1)が出力されると動作を停止する。 The clock number conversion circuit 31 a receives the distance signal D 11 having a bit length of M bits from the distance calculation circuit DP 11 and the clock signal CLK from the buffer 21. Clock number conversion circuit 31a counts the number of clocks of the clock signal CLK, the distance signal timing of detecting the number of clocks to match the D 11 is the distance indicated, outputs an H-level coincidence detection signal to the counter 31b in the counter 31b Process. The clock number conversion circuit 31a repeats this process until an H level coincidence signal (DETECT1) is output from the coincidence detection circuit 31c described later, and stops operating when the H level coincidence signal (DETECT1) is output. To do.

カウンタ31bは、クロック数変換回路31aからの一致検出信号が立ち上がるごとにカウンタ値をカウントアップさせ、そのカウンタ値を一致検出回路31cへ出力する。   The counter 31b counts up the counter value every time the coincidence detection signal from the clock number conversion circuit 31a rises, and outputs the counter value to the coincidence detection circuit 31c.

一致検出回路31cは、カウンタ31bからカウンタ値を受け、距離演算回路DP11からMビットのビット長を有する距離信号D11を受ける。一致検出回路31cは、距離信号D11が示す距離とカウンタ値とを比較し、距離信号D11が示す距離とカウンタ値とが一致するときに、Hレベルの一致信号(DETECT1)をクロック数変換回路31aとバッファ22へ出力する。一致検出回路31cは、距離信号D11が示す距離とカウンタ値とが一致しないときは、Lレベルの一致信号(DETECT1)をクロック数変換回路31aとバッファ22へ出力する。 Coincidence detection circuit 31c receives the counter value from the counter 31b, receives the distance signal D 11 having a bit length of M bits from the distance computing circuit DP 11. Coincidence detection circuit 31c compares the distance and counter value distance signal D 11 indicates, when the distance signal D 11 is the distance the counter value indicating the match, the number of clocks converts H level coincidence signal (DETECT1) Output to the circuit 31 a and the buffer 22. Coincidence detection circuit 31c includes distance and counter value distance signal D 11 indicates and is when they do not match, outputs L-level coincidence signal (DETECT1) to the clock number conversion circuit 31a and the buffer 22.

クロック数変換回路32aは、バッファ22からクロック信号CLKを受けると駆動する。クロック数変換回路32aは、距離演算回路DP12からMビットのビット長を有する距離信号D12を受ける。クロック数変換回路31aと同様、クロック数変換回路32aは、クロック信号CLKのクロック数をカウントし、距離信号D12が示す距離と一致するクロック数を検出したタイミングで、カウンタ32bにHレベルの一致検出信号を出力する処理を行う。クロック数変換回路32aは、後述の一致検出回路32cからHレベルの一致信号(DETECT2)が出力されるまで、この処理を繰り返し行う。クロック数変換回路32aは、Hレベルの一致信号(DETECT2)が出力されると動作を停止する。 The clock number conversion circuit 32 a is driven when it receives the clock signal CLK from the buffer 22. Clock number conversion circuit 32a receives the distance signal D 12 having a bit length of M bits from the distance calculation circuit DP 12. As with the clock number conversion circuit 31a, the clock number conversion circuit 32a counts the number of clocks of the clock signal CLK, the clock number that matches the distance the distance signal D 12 indicates the timing of detecting the coincidence of the H-level counter 32b Processing to output a detection signal is performed. The clock number conversion circuit 32a repeats this process until an H level coincidence signal (DETECT2) is output from the coincidence detection circuit 32c described later. The clock number conversion circuit 32a stops its operation when the H level coincidence signal (DETECT2) is output.

カウンタ32bは、クロック数変換回路32aからの一致検出信号が立ち上がるごとにカウンタ値をカウントアップさせ、そのカウンタ値を一致検出回路32cへ出力する。   The counter 32b counts up the counter value every time the coincidence detection signal from the clock number conversion circuit 32a rises, and outputs the counter value to the coincidence detection circuit 32c.

一致検出回路32cは、カウンタ32bからカウンタ値を受け、距離演算回路DP12からMビットのビット長を有する距離信号D12を受ける。一致検出回路32cは、距離信号D12が示す距離とカウンタ値とを比較し、距離信号D12が示す距離とカウンタ値とが一致するときに、Hレベルの一致信号(DETECT2)をクロック数変換回路32aに出力するとともに、Hレベルの一致信号(DETECT2)をタイミング信号CとしてWinner検出器20へ出力する。また、一致検出回路32cは、距離信号D12が示す距離とカウンタ値とが一致するときに、Lレベルの一致信号(DETECT2)をクロック数変換回路32aに出力する。 Coincidence detection circuit 32c receives the counter value from the counter 32b, receives the distance signal D 12 having a bit length of M bits from the distance calculation circuit DP 12. Coincidence detection circuit 32c compares the distance and counter value distance signal D 12 indicates, when the distance signal the distance and counter value D 12 indicates a match, the number of clocks converts H level coincidence signal (DETECT2) and outputs to the circuit 32a, and outputs it to the Winner detector 20 H level coincidence signal (DETECT2) as a timing signal C 1. Moreover, the coincidence detection circuit 32c, when the distance and counter value distance signal D 12 indicates a match, and outputs L-level coincidence signal (DETECT2) to the clock number conversion circuit 32a.

ここで、例えば、距離演算回路DP11から距離「2」を示すMビットの距離信号D11が出力され、距離演算回路DP12から距離「3」を示すMビットの距離信号D12が出力された場合の動作例について説明する。 Here, for example, the distance calculation circuit DP 11 distance signal D 11 of M bits indicating the distance "2" from is output, the distance calculation circuit DP 12 distance signal D 12 of M bits indicating the distance "3" from is output An example of the operation in the case of failure will be described.

クロック数変換回路31aは、距離「2」を示すMビットの距離信号D11を受け、バッファ21からのクロック信号CLKのクロックに同期して、距離「2」に一致するクロック数をカウントする。クロック数変換回路31aは、カウントしたクロック数と距離とが一致すると、Hレベルの一致検出信号を出力する。カウンタ31bは、一致検出信号が立ち上がると、カウンタ値をカウントアップし、「1」を示すカウンタ値を一致検出回路31cに出力する。このとき、距離信号D11が示す距離「2」とカウンタ値「1」とが一致しないため、一致検出回路31cからLレベルの一致信号(DETECT1)が出力される。 The clock number conversion circuit 31 a receives the M-bit distance signal D 11 indicating the distance “2”, and counts the number of clocks matching the distance “2” in synchronization with the clock of the clock signal CLK from the buffer 21. When the counted number of clocks matches the distance, the clock number conversion circuit 31a outputs an H level coincidence detection signal. When the coincidence detection signal rises, the counter 31b counts up the counter value and outputs a counter value indicating “1” to the coincidence detection circuit 31c. At this time, since the distance signal D 11 indicates the distance "2" and the counter value "1" does not coincide, the coincidence detection circuit 31c from the L-level coincidence signal (DETECT1) is output.

クロック数変換回路31aは、出力した一致検出信号がLレベルになると、カウントしたクロック数をリセットする。そして、クロック数変換回路31aは、再びクロック信号CLKのクロック数をカウントし、カウントしたクロック数が距離「2」と一致すると、カウンタ31bにHレベルの一致検出信号を出力する。カウンタ31bは、一致検出信号が立ち上がると、カウンタ値をカウントアップさせ、一致検出回路31cに「2」を示すカウンタ値を出力する。一致検出回路31cは、距離信号D11が示す距離「2」とカウンタ値「2」とが一致するため、一致信号(DETECT1)をバッファ22とクロック数変換回路31aに出力する。つまり、検索開始からのクロック数が「4」となるタイミングで、Hレベルの一致信号(DETECT1)が出力される。そして、クロック数変換回路31aは、Hレベルの一致信号(DETECT1)に応じて動作を停止する。 When the output coincidence detection signal becomes L level, the clock number conversion circuit 31a resets the counted clock number. Then, the clock number conversion circuit 31a again counts the clock number of the clock signal CLK, and when the counted clock number coincides with the distance “2”, it outputs an H level coincidence detection signal to the counter 31b. When the coincidence detection signal rises, the counter 31b counts up the counter value and outputs a counter value indicating “2” to the coincidence detection circuit 31c. Coincidence detecting circuit 31c, since the distance signal D 11 indicates the distance "2" and the counter value and "2" coincide, outputs a coincidence signal (DETECT1) to the buffer 22 and the clock number conversion circuit 31a. That is, an H level coincidence signal (DETECT1) is output at the timing when the number of clocks from the start of search becomes “4”. Then, the clock number conversion circuit 31a stops its operation in response to the H level coincidence signal (DETECT1).

バッファ22は、一致検出回路31cからHレベルの一致信号(DETECT1)を受けて、クロック数変換回路32aにクロック信号CLKを出力する。クロック数変換回路32aは、バッファ22からのクロック信号CLKのクロックに同期して、クロック信号CLKのクロック数をカウントする。クロック数変換回路32aは、距離「3」を示すMビットの距離信号D12を受け、カウントしたクロック数が距離「3」と一致するタイミングで、Hレベルの一致検出信号をカウンタ32bに出力する。カウンタ32bは、クロック数変換回路32aからの一致検出信号が立ち上がると、カウンタ値をカウントアップさせ、一致検出回路32cに「1」を示すカウンタ値を出力する。このとき、距離「3」とカウンタ値「1」とが一致しないため、一致検出回路32cからLレベルの一致信号(DETECT2)が出力される。 The buffer 22 receives the H level coincidence signal (DETECT1) from the coincidence detection circuit 31c, and outputs the clock signal CLK to the clock number conversion circuit 32a. The clock number conversion circuit 32 a counts the clock number of the clock signal CLK in synchronization with the clock signal CLK from the buffer 22. Clock number conversion circuit 32a, the distance receives the distance signal D 12 of M bits indicating "3", at the timing when the number of clock count matches the distance "3", and outputs the H-level coincidence detection signal to a counter 32b . When the coincidence detection signal from the clock number conversion circuit 32a rises, the counter 32b counts up the counter value and outputs a counter value indicating “1” to the coincidence detection circuit 32c. At this time, since the distance “3” and the counter value “1” do not match, the match detection circuit 32c outputs an L level match signal (DETECT2).

クロック数変換回路32aは、出力した一致検出信号がLレベルになると、カウントしたクロック数をリセットする。そして、クロック数変換回路32aは、再びクロック信号CLKのクロック数をカウントし、カウントしたクロック数が距離「3」と一致すると、カウンタ32bにHレベルの一致検出信号を出力する。カウンタ32bは、クロック数変換回路32aからの一致検出信号が立ち上がると、カウンタ値をカウントアップさせ、一致検出回路32cに「2」を示すカウンタ値を出力する。このとき、距離「3」とカウンタ値「2」とが一致しないため、一致検出回路32cからLレベルの一致信号(DETECT2)が出力される。   When the output coincidence detection signal becomes L level, the clock number conversion circuit 32a resets the counted clock number. Then, the clock number conversion circuit 32a again counts the clock number of the clock signal CLK. When the counted clock number coincides with the distance “3”, it outputs an H level coincidence detection signal to the counter 32b. When the coincidence detection signal from the clock number conversion circuit 32a rises, the counter 32b counts up the counter value and outputs a counter value indicating “2” to the coincidence detection circuit 32c. At this time, since the distance “3” and the counter value “2” do not match, the match detection circuit 32c outputs an L level match signal (DETECT2).

クロック数変換回路32aは、一致検出信号がLレベルになると、再びカウントしたクロック数をリセットしてクロック信号CLKをカウントし、カウントしたクロック数が距離「3」と一致すると、カウンタ32bにHレベルの一致検出信号を出力する。そして、クロック数変換回路32aは、Hレベルの一致信号(DETECT2)に応じて動作を停止する。カウンタ32bは、クロック数変換回路32aからの一致検出信号が立ち上がると、カウンタ値をカウントアップさせ、一致検出回路32cに「3」を示すカウンタ値を出力する。一致検出回路32cは、距離「3」とカウンタ値「3」とが一致するため、Hレベルの一致信号(DETECT2)をクロック数変換回路32aに出力するとともに、タイミング信号CとしてWinner検出器20に出力する。つまり、クロック数変換回路32aにおいてカウントされたクロック数は「9(=3+3+3)」であり、検索開始からクロック数「13(=4+9)」のタイミングでタイミング信号Cが出力される。 When the coincidence detection signal becomes L level, the clock number conversion circuit 32a resets the counted clock number again and counts the clock signal CLK. When the counted clock number coincides with the distance “3”, the clock number conversion circuit 32a sets the counter 32b to H level. The coincidence detection signal is output. Then, the clock number conversion circuit 32a stops its operation in response to the H level coincidence signal (DETECT2). When the coincidence detection signal from the clock number conversion circuit 32a rises, the counter 32b counts up the counter value and outputs a counter value indicating “3” to the coincidence detection circuit 32c. Since the distance “3” and the counter value “3” match, the coincidence detection circuit 32 c outputs an H-level coincidence signal (DETECT2) to the clock number conversion circuit 32 a and also uses the Winner detector 20 as the timing signal C 1. Output to. In other words, the number of clocks counted in the clock number conversion circuit 32a is "9 (= 3 + 3 + 3)", the timing signal C 1 at the timing of the clock number from the search start "13 (= 4 + 9)" is output.

カウンタ一致検出回路31,32全体でカウントされるクロック数CN_total1「13」は、カウンタ一致検出回路31においてカウントするクロック数「4(=2+2)」と、カウンタ一致検出回路32においてカウントするクロック数「9(=3+3+3)」とを加算したものである。つまり、カウンタ一致検出回路31,32によって、距離「2」の二乗値と距離「3」の二乗値との和に一致するクロック数をカウントすることに相当する。   The number of clocks CN_total1 “13” counted by the counter match detection circuits 31 and 32 as a whole is the number of clocks “4 (= 2 + 2)” counted by the counter match detection circuit 31 and the number of clocks counted by the counter match detection circuit 32 “ 9 (= 3 + 3 + 3) ”. That is, it corresponds to counting the number of clocks that match the sum of the square value of the distance “2” and the square value of the distance “3” by the counter coincidence detection circuits 31 and 32.

距離/クロック数変換回路DCは、一般的に、W個の距離信号D11〜D1Wを受ける。そして、W個の距離信号D11〜D1Wの各々は、Mビットのビット長を有する。従って、距離/クロック数変換回路DCは、M×Wビットのビット長を有する距離信号D1112・・・D1Wを受ける。カウンタ一致検出回路31において、距離信号D11が示す距離に一致する回数分だけ、その距離に一致するクロック数を繰り返しカウントする。また、カウンタ一致検出回路32〜3Wは、それぞれ、カウンタ一致検出回路31〜3W−1から一致信号を受けた後に、距離信号D12〜D1Wにそれぞれ一致するクロック数を、その距離に一致する回数だけ繰り返しカウントする。その結果、距離/クロック数変換回路DCにおいてカウントされる全体のクロック数CN_total1は、カウンタ一致検出回路31〜3Wの各々においてカウントされたクロック数の和に等しい。カウンタ一致検出回路31〜3Wの各々においてカウントされたクロック数は、それぞれ、距離信号D11〜D1Wが示す各距離の二乗値に相当するため、距離/クロック数変換回路DCにおいてカウントされる全体のクロック数CN_totalRは、各距離信号D11〜D1Wの二乗値の和を表している。 Distance / clock number converting circuit DC 1 is generally subjected to W-number of distance signals D 11 to D 1W. Each of the W distance signals D 11 to D 1W has a bit length of M bits. Therefore, the distance / clock number converting circuit DC 1 receives the distance signal D 11 D 12 ··· D 1W having a bit length of M × W bits. In the counter coincidence detection circuit 31, only the number of times the distance signal D 11 is equal to the distance indicated, repeatedly counting the number of clocks that matches the distance. The counter coincidence detection circuit 32~3W respectively, after receiving the coincidence signal from the counter coincidence detecting circuit 31~3W-1, the number of clocks respectively coincide with the distance signal D 12 to D 1W, matches the distance Count repeatedly. As a result, the distance / clock number conversion circuit overall number of clocks CN_total1 counted in DC 1 is equal to the number of clocks sum of which is counted in each of the counter match detection circuit 31~3W. Clock number counted in each of the counter match detection circuit 31~3W respectively, to correspond to the square of the distance indicated by the distance signal D 11 to D 1W, counted in the distance / clock number conversion circuit DC 1 The total clock number CN_totalR represents the sum of the square values of the distance signals D 11 to D 1W .

ここで、ユークリッド距離nは、次式によって表わされる。 Here, the Euclidean distance n E is expressed by the following equation.

Figure 2014154196
Figure 2014154196

式(2)の右辺の|In−Rerjは、式(1)の右辺の|In−Rerj|において、検索データと参照データとの距離の二乗値に一致する。従って、ユークリッド距離nErの演算は、上述したように、式(1)によって演算したW個の各距離について、距離に一致するクロック数をカウントする処理を距離に一致する回数だけ繰り返し行うことで実現される。そうすると、図2Bの例において、カウンタ一致検出回路32が、カウンタ一致検出回路31,32全体でカウントしたクロック数のタイミングを示すタイミング信号Cを出力することは、ユークリッド距離nErによって検索データに類似する参照データを検索し、検索データに類似する参照データを検出したことを示すWinner信号を出力することに相当する。なお、距離/クロック数変換回路DC〜DCの各々も、距離/クロック数変換回路DCの動作と同じ動作によって、それぞれ、タイミング信号C〜Cを出力する。 | In j −R erj | 2 on the right side of Expression (2) matches the square value of the distance between the search data and the reference data in | In j −R erj | on the right side of Expression (1). Accordingly, as described above, the calculation of the Euclidean distance n Er is performed by repeatedly performing the process of counting the number of clocks matching the distance for each of the W distances calculated by the equation (1) as many times as the distance matches. Realized. Then, in the example of FIG. 2B, the counter coincidence detection circuit 32 outputs the timing signal C 1 indicating the timing of the number of clocks counted by the counter coincidence detection circuits 31 and 32 as a whole to the search data by the Euclidean distance n Er . This corresponds to searching for similar reference data and outputting a Winner signal indicating that reference data similar to the search data has been detected. Incidentally, each of the distance / clock number conversion circuit DC 2 to DC R also, by operating the same operation of the distance / clock number converting circuit DC 1, respectively, and outputs a timing signal C 2 -C R.

次に、Winner検出器20の動作について説明する。図3は、図1に示すWinner検出器20の動作を説明するための図である。距離/クロック数変換回路DC〜DCは、図3に示すように、例えばタイミング信号C〜Cをそれぞれクロック信号CLKに同期してWinner検出器20へ出力する。 Next, the operation of the Winner detector 20 will be described. FIG. 3 is a diagram for explaining the operation of the Winner detector 20 shown in FIG. Distance / clock number converting circuit DC 1 to DC R, as shown in FIG. 3, and outputs for example a timing signal C 1 -C R respectively in synchronization with the clock signal CLK to the Winner detector 20.

Winner検出器20は、タイミング信号C〜Cを受け、その受けたタイミング信号C〜Cの立ち上がりタイミングt〜tを検出する。そして、Winner検出器20は、立ち上がりタイミングt〜tが早い順にk個のタイミング信号C’〜C’を検出する。Winner検出器20は、タイミング信号C’〜C’をマッチ信号M〜Mとして出力する。 Winner detector 20 receives a timing signal C 1 -C R, detects the rising timing t 1 ~t R of the received timing signal C 1 -C R. Then, the Winner detector 20 detects the k timing signals C ′ 1 to C ′ k in order from the earliest rise timing t 1 to t R. The Winner detector 20 outputs timing signals C ′ 1 to C ′ k as match signals M 1 to M k .

例えば、2個(k=2)のマッチ信号M,Mを検出する場合、Winner検出器20は、タイミング信号C〜Cのうち、立ち上がりタイミングが早い順に2個のタイミング信号C,Cを検出し、その検出したタイミング信号C,Cをマッチ信号M,Mとして出力する。k=2以外のk個のタイミング信号C’〜C’を検出する場合も、Winner検出器20は、同様にして、k個のタイミング信号C’〜C’を検出し、その検出したk個のタイミング信号C’〜C’をマッチ信号M〜Mとして出力する。 For example, when detecting a match signal M 1, M 2 of two (k = 2), Winner detector 20, of the timing signal C 1 -C R, two timing signals C 1 to rising timing ascending order , C 3 are detected, and the detected timing signals C 1 , C 3 are output as match signals M 1 , M 2 . Similarly, when detecting k timing signals C ′ 1 to C ′ k other than k = 2, the Winner detector 20 similarly detects k timing signals C ′ 1 to C ′ k, and The detected k timing signals C ′ 1 to C ′ k are output as match signals M 1 to M k .

k=1である場合、Winner検出器20は、検索データに最も類似する参照データに対応するタイミング信号(タイミング信号C〜Cのいずれか)をマッチ信号Mとして出力する。また、k≠1である場合、Winner検出器20は、検索データに類似するk個の参照データに対応するk個のタイミング信号C’〜C’をマッチ信号M〜Mとして出力する。この場合、k個のタイミング信号C’〜C’において、k個の立ち上がりタイミングは、相互に、少なくともクロック信号CLKの1周期分だけ異なるので、立ち上がりタイミングの早い順にk個のタイミング信号C’〜C’が正確に検出される。つまり、連想メモリ100は、検索データに類似するk個の参照データを正確に検出することができる。 If a k = 1, Winner detector 20 outputs a timing signal corresponding to the reference data most similar to the search data (either of the timing signal C 1 -C R) as a match signal M 1. When k ≠ 1, the Winner detector 20 outputs k timing signals C ′ 1 to C ′ k corresponding to k reference data similar to the search data as match signals M 1 to M k. To do. In this case, in the k timing signals C ′ 1 to C ′ k , the k rising timings differ from each other by at least one cycle of the clock signal CLK. '1 -C' k is detected accurately. That is, the associative memory 100 can accurately detect k reference data similar to the search data.

距離/クロック数変換回路DC〜DCの動作は、クロック信号CLKに同期して実行される。そのため、クロック信号CLKの周波数を高くすることで、連想メモリ100の動作を高速化してもよい。本実施形態では、クロック数変換回路31a,32aは、一致信号(DETECT1,DETECT2)がそれぞれ出力されると動作を停止する。そのため、距離/クロック数変換回路DCにおいて、全ての距離が一致するまでクロック数変換回路DCi1〜DCiRを動作させる場合と比べて消費電力を小さくすることができる。 Operation of the distance / clock number converting circuit DC 1 to DC R is executed in synchronization with the clock signal CLK. Therefore, the operation of the associative memory 100 may be speeded up by increasing the frequency of the clock signal CLK. In the present embodiment, the clock number conversion circuits 31a and 32a stop operating when the coincidence signals (DETECT1 and DETECT2) are output. Therefore, in the distance / clock number conversion circuit DC i , power consumption can be reduced as compared with the case where the clock number conversion circuits DC i1 to DC iR are operated until all the distances match.

<第2実施形態>
本実施形態では、第1実施形態で説明した距離/クロック数変換回路とは異なる構成によって、ユークリッド距離を用いた検索を行う例について説明する。
Second Embodiment
In the present embodiment, an example in which a search using the Euclidean distance is performed using a configuration different from the distance / clock number conversion circuit described in the first embodiment will be described.

図4は、本実施形態における距離/クロック数変換回路DCの構成例を示す概略構成図である。図4において、第1実施形態と同様の構成については、第1実施形態と同様の符号を付している。図4の例では、W=2の場合の距離/クロック数変換回路DCの構成例を示している。なお、距離/クロック数変換回路DC〜DCについても同様の構成を有する。 Figure 4 is a schematic configuration diagram showing a configuration example of a distance / clock number converting circuit DC 1 in this embodiment. In FIG. 4, the same components as those in the first embodiment are denoted by the same reference numerals as those in the first embodiment. In the example of FIG. 4 shows a configuration example of a distance / clock number converting circuit DC 1 in the case of W = 2. The distance / clock number conversion circuits DC 2 to DC R have the same configuration.

図4に示すように、距離/クロック数変換回路DCは、バッファ23、距離/クロック数変換ユニット310,320、及び、カウンタ一致検出ユニット300を含む。 As shown in FIG. 4, the distance / clock number conversion circuit DC 1 includes a buffer 23, distance / clock number conversion units 310 and 320, and a counter match detection unit 300.

バッファ23は、連想メモリ100の制御回路(図示せず)から検索開始信号SBを受け、連想メモリ100に内蔵されたクロック発生回路(図示せず)からクロック信号CLKを受ける。そして、バッファ23は、検索開始信号SBがLレベルからHレベルに切り替わると、その受けたクロック信号CLKを距離/クロック数変換ユニット310,320へ出力する。   The buffer 23 receives a search start signal SB from a control circuit (not shown) of the associative memory 100 and receives a clock signal CLK from a clock generation circuit (not shown) built in the associative memory 100. Then, when the search start signal SB is switched from the L level to the H level, the buffer 23 outputs the received clock signal CLK to the distance / clock number conversion units 310 and 320.

距離/クロック数変換ユニット310,320は、距離演算回路DP11,DP12にそれぞれ対応して設けられる。距離/クロック数変換ユニット310は、クロック数変換回路31a、デマルチプレクサ31d、OR回路31e、及び一致検出回路31c’を含む。距離/クロック数変換ユニット320は、クロック数変換回路32a、デマルチプレクサ32d、OR回路32e、及び一致検出回路32c’を含む。カウンタ一致検出ユニット300は、デマルチプレクサ300a、カウンタ300b、及び、AND回路300cを含む。 The distance / clock number conversion units 310 and 320 are provided corresponding to the distance calculation circuits DP 11 and DP 12 , respectively. The distance / clock number conversion unit 310 includes a clock number conversion circuit 31a, a demultiplexer 31d, an OR circuit 31e, and a coincidence detection circuit 31c ′. The distance / clock number conversion unit 320 includes a clock number conversion circuit 32a, a demultiplexer 32d, an OR circuit 32e, and a coincidence detection circuit 32c ′. The counter coincidence detection unit 300 includes a demultiplexer 300a, a counter 300b, and an AND circuit 300c.

デマルチプレクサ31dは、連想メモリ100の制御回路(図示せず)からイネーブル信号(EN)を受け、後述の一致検出回路31c’から一致信号(DETECT1)を受ける。デマルチプレクサ31dは、Lレベルの一致信号(DETECT1)を受けると、クロック数変換回路31aにHレベル(=1)のEN信号を出力し、OR回路31eにLレベル(=0)のEN信号を出力する。また、デマルチプレクサ31dは、Hレベルの一致信号(DETECT1)を受けると、クロック数変換回路31aにLレベルのEN信号を出力し、OR回路31eにHレベルのEN信号を出力する。   The demultiplexer 31d receives an enable signal (EN) from a control circuit (not shown) of the associative memory 100, and receives a coincidence signal (DETECT1) from a coincidence detection circuit 31c 'described later. Upon receiving the L level coincidence signal (DETECT1), the demultiplexer 31d outputs an H level (= 1) EN signal to the clock number conversion circuit 31a, and an L level (= 0) EN signal to the OR circuit 31e. Output. When the demultiplexer 31d receives the H level coincidence signal (DETECT1), it outputs an L level EN signal to the clock number conversion circuit 31a, and outputs an H level EN signal to the OR circuit 31e.

クロック数変換回路31aは、距離演算回路DP11からMビットの距離信号D11を受け、バッファ23からクロック信号CLKを受ける。クロック数変換回路31aは、デマルチプレクサ31dからHレベルのEN信号を受けると、クロック信号CLKのクロック数をカウントし、カウントしたクロック数と距離信号D11が示す距離との一致を検出する。クロック数変換回路31aは、カウントしたクロック数と距離信号D11が示す距離とが一致するタイミングで、OR回路31eに「1」を示すHレベルの一致検出信号を出力する。また、クロック数変換回路31aは、後述のデマルチプレクサ300aから出力される信号を受け、その信号を受けたタイミングでカウントしたクロック数をリセットする。クロック数変換回路31aは、デマルチプレクサ31dからLレベルのEN信号を受けると、「0」を示すLレベルの一致検出信号をOR回路31eに出力する。 The clock number conversion circuit 31 a receives the M-bit distance signal D 11 from the distance calculation circuit DP 11 and receives the clock signal CLK from the buffer 23. Clock number conversion circuit 31a receives the H-level EN signal from the demultiplexer 31d, it counts the number of clocks of the clock signal CLK, and detects a match between the counted number of clocks and the distance signal D 11 is the distance indicated. Clock number conversion circuit 31a at a timing and distance indicated number of clocks and the distance signal D 11 obtained by counting matches, outputs the H level coincidence detection signal indicating "1" to the OR circuit 31e. The clock number conversion circuit 31a receives a signal output from a demultiplexer 300a described later, and resets the clock number counted at the timing of receiving the signal. When receiving the L level EN signal from the demultiplexer 31d, the clock number conversion circuit 31a outputs an L level coincidence detection signal indicating "0" to the OR circuit 31e.

OR回路31eは、クロック数変換回路31aからの一致検出信号(1又は0)と、デマルチプレクサ31dからのEN信号(1又は0)とを受け、一致検出信号とEN信号の論理和を演算し、演算結果からなる駆動信号を距離/クロック数変換回路320におけるデマルチプレクサ32dに出力する。   The OR circuit 31e receives the coincidence detection signal (1 or 0) from the clock number conversion circuit 31a and the EN signal (1 or 0) from the demultiplexer 31d, and calculates the logical sum of the coincidence detection signal and the EN signal. Then, the drive signal composed of the calculation result is output to the demultiplexer 32d in the distance / clock number conversion circuit 320.

デマルチプレクサ32dは、OR回路31eからの駆動信号と、後述する一致検出回路32c’からの一致信号(DETECT2)とを受ける。デマルチプレクサ32dは、一致検出信号(DETECT2)がLレベルの場合、OR回路31eからの駆動信号をクロック数変換回路32aに出力し、OR回路31eからの駆動信号を反転させた反転信号をOR回路32eに出力する。また、一致信号(DETECT2)がHレベルの場合には、OR回路31eからの駆動信号を反転させた反転信号をクロック数変換回路32aに出力し、OR回路31eからの駆動信号をOR回路32eに出力する。   The demultiplexer 32d receives a drive signal from the OR circuit 31e and a coincidence signal (DETECT2) from a coincidence detection circuit 32c 'described later. When the coincidence detection signal (DETECT2) is at the L level, the demultiplexer 32d outputs the drive signal from the OR circuit 31e to the clock number conversion circuit 32a, and an inverted signal obtained by inverting the drive signal from the OR circuit 31e. To 32e. When the coincidence signal (DETECT2) is at the H level, an inverted signal obtained by inverting the drive signal from the OR circuit 31e is output to the clock number conversion circuit 32a, and the drive signal from the OR circuit 31e is output to the OR circuit 32e. Output.

クロック数変換回路32aは、距離演算回路DP12からMビットの距離信号D12を受け、バッファ23からクロック信号CLKを受ける。クロック数変換回路32aは、デマルチプレクサ32dから「1」を示す駆動信号を受けると、クロック信号CLKのクロック数をカウントし、カウントしたクロック数と距離信号D12が示す距離との一致を検出する。クロック数変換回路32aは、カウントしたクロック数と距離信号D12が示す距離とが一致するタイミングで、OR回路32eに「1」を示す一致検出信号を出力する。また、クロック数変換回路32aは、後述のデマルチプレクサ300dから出力される信号を受け、その信号を受けたタイミングでカウントしたクロック数をリセットする。クロック数変換回路32aは、デマルチプレクサ32dから「0」を示す駆動信号を受けると、「0」を示す駆動信号をOR回路32eに出力する。 The clock number conversion circuit 32 a receives the M-bit distance signal D 12 from the distance calculation circuit DP 12 and receives the clock signal CLK from the buffer 23. Clock number conversion circuit 32a receives a drive signal indicating "1" from the demultiplexer 32d, it counts the number of clocks of the clock signal CLK, and detects a match between the counted number of clocks and the distance signal D 12 is the distance indicated . Clock number conversion circuit 32a at a timing and distance clock speed and distance signals D 12 counted indicates matches, it outputs the coincidence detection signal indicating "1" to the OR circuit 32e. The clock number conversion circuit 32a receives a signal output from a demultiplexer 300d described later, and resets the clock number counted at the timing of receiving the signal. When receiving the drive signal indicating “0” from the demultiplexer 32d, the clock number conversion circuit 32a outputs the drive signal indicating “0” to the OR circuit 32e.

OR回路32eは、クロック数変換回路32aからの一致検出信号(1又は0)と、デマルチプレクサ32dからの駆動信号(1又は0)とを受け、受けた2つの信号の論理和を演算し、演算結果を示す信号をカウンタ一致検出ユニット300におけるデマルチプレクサ300aに出力する。   The OR circuit 32e receives the coincidence detection signal (1 or 0) from the clock number conversion circuit 32a and the drive signal (1 or 0) from the demultiplexer 32d, calculates the logical sum of the two received signals, A signal indicating the calculation result is output to the demultiplexer 300a in the counter coincidence detection unit 300.

デマルチプレクサ300aは、OR回路32eからの信号を受け、後述するAND回路300cから検索終了か否かを示すSearch−End信号を受ける。デマルチプレクサ300aは、Search−End信号がLレベルの場合には、OR回路32eからの信号をカウンタ300bとクロック数変換回路31a,32aに出力し、Search−End信号がLレベルからHレベルに切り替わると、OR回路32eからの信号をタイミング信号CとしてWinner検出器20へ出力する。 The demultiplexer 300a receives a signal from the OR circuit 32e, and receives a Search-End signal indicating whether or not the search is completed from an AND circuit 300c described later. When the Search-End signal is at the L level, the demultiplexer 300a outputs the signal from the OR circuit 32e to the counter 300b and the clock number conversion circuits 31a and 32a, and the Search-End signal is switched from the L level to the H level. When, and outputs it to the Winner detector 20 a signal from the OR circuit 32e as a timing signal C 1.

カウンタ300bは、デマルチプレクサ300aから信号を受けるごとにカウンタ値を1つだけカウントアップさせ、カウントアップしたMビットのカウンタ値を一致検出回路31c’,32c’へ出力する。なお、カウンタ300bの初期値として、カウンタ値「0」が設定されている。   Each time the counter 300b receives a signal from the demultiplexer 300a, the counter 300b increments the counter value by one, and outputs the counted up M-bit counter value to the coincidence detection circuits 31c 'and 32c'. The counter value “0” is set as the initial value of the counter 300b.

一致検出回路31c’は、カウンタ300bからMビットのカウンタ値を受け、距離演算回路DP11から距離信号D11を受ける。一致検出回路31c’は、カウンタ値と距離信号D11が示す距離との一致を検出する。一致検出回路31c’は、カウンタ値≧距離を満たす場合には、Hレベルの一致信号(DETECT1)をデマルチプレクサ31dとAND回路300cに出力する。また、カウンタ値と距離とが一致しない場合、つまり、カウンタ値<距離を満たす場合には、Lレベルの一致信号(DETECT1)をデマルチプレクサ31dとAND回路300cに出力する。 Coincidence detection circuit 31c 'receives a counter value of M bits from the counter 300b, receives the distance signals D 11 from the distance computing circuit DP 11. Coincidence detection circuit 31c 'detects a match between the distance indicated counter value and the distance signal D 11 is. When the counter value ≧ distance is satisfied, the coincidence detection circuit 31c ′ outputs an H level coincidence signal (DETECT1) to the demultiplexer 31d and the AND circuit 300c. If the counter value does not match the distance, that is, if the counter value <distance is satisfied, an L level match signal (DETECT1) is output to the demultiplexer 31d and the AND circuit 300c.

一致検出回路32c’は、カウンタ300bからMビットのカウンタ値を受け、距離演算回路DP12から距離信号D12を受ける。一致検出回路32c’は、カウンタ値と距離信号D12が示す距離との一致を検出する。一致検出回路32c’は、カウンタ値と距離とが、カウンタ値≧距離を満たす場合には、Hレベルの一致信号(DETECT2)をデマルチプレクサ32dとAND回路300cに出力する。また、カウンタ値と距離とが一致しない場合、つまり、カウンタ値<距離を満たす場合には、Lレベルの一致信号(DETECT2)をデマルチプレクサ32dとAND回路300cに出力する。 Coincidence detection circuit 32c 'receives a counter value of M bits from the counter 300b, receives the distance signals D 12 from the distance computing circuit DP 12. Coincidence detection circuit 32c 'detects a match between the distance indicated by the counter value and the distance signal D 12. When the counter value and the distance satisfy the counter value ≧ distance, the coincidence detection circuit 32c ′ outputs an H level coincidence signal (DETECT2) to the demultiplexer 32d and the AND circuit 300c. If the counter value does not match the distance, that is, if the counter value <distance is satisfied, an L level match signal (DETECT2) is output to the demultiplexer 32d and the AND circuit 300c.

AND回路300cは、一致検出回路31c’からの一致信号(DETECT1)と、一致検出回路32c’からの一致信号(DETECT2)との論理積を演算し、その演算結果を示すSearch−End信号をデマルチプレクサ300aに出力する。つまり、Hレベルの一致信号(DETECT1,DETECT2)の場合には、「1」を示すSearch−End信号がデマルチプレクサ300aに出力され、検索を終了する。また、少なくともいずれか一方の一致信号がLレベルである場合には、「0」を示すSearch−End信号がデマルチプレクサ300aに出力され、検索を継続する。   The AND circuit 300c calculates a logical product of the match signal (DETECT1) from the match detection circuit 31c ′ and the match signal (DETECT2) from the match detection circuit 32c ′, and outputs a Search-End signal indicating the calculation result. Output to the multiplexer 300a. That is, in the case of the H level coincidence signal (DETECT1, DETECT2), the Search-End signal indicating “1” is output to the demultiplexer 300a, and the search is terminated. If at least one of the coincidence signals is at the L level, a Search-End signal indicating “0” is output to the demultiplexer 300a, and the search is continued.

ここで、例えば、距離演算回路DP11から距離「2」を示すMビットの距離信号D11が出力され、距離演算回路DP12から距離「3」を示すMビットの距離信号D12が出力された場合の動作例について説明する。 Here, for example, the distance calculation circuit DP 11 distance signal D 11 of M bits indicating the distance "2" from is output, the distance calculation circuit DP 12 distance signal D 12 of M bits indicating the distance "3" from is output An example of the operation in the case of failure will be described.

EN信号が入力されると、デマルチプレクサ31dは、一致信号(DETECT1)が立ち上がっていないため、クロック数変換回路31aにHレベルのEN信号を出力し、OR回路31eにLレベルのEN信号を出力する。クロック数変換回路31aは、デマルチプレクサ31dからHレベルのEN信号を受けると、バッファ23からのクロック信号CLKのクロック数をカウントし、カウントしたクロック数と距離演算回路DP11からの距離信号D11が示す距離「2」と一致するタイミングで一致検出信号(=1)を出力する。 When the EN signal is input, since the coincidence signal (DETECT1) has not risen, the demultiplexer 31d outputs an H level EN signal to the clock number conversion circuit 31a, and outputs an L level EN signal to the OR circuit 31e. To do. Clock number conversion circuit 31a is de receives the H-level EN signal from the multiplexer 31d, counts the number of clocks of the clock signal CLK from the buffer 23, the distance signal from the clock speed and distance calculating circuit DP 11 counted D 11 A coincidence detection signal (= 1) is output at a timing coincident with the distance “2” indicated by.

OR回路31eは、クロック数変換回路31aからの一致検出信号(=1)とデマルチプレクサ31dからのEN信号(=0)との論理和の演算結果からなる駆動信号(=1)をデマルチプレクサ32dに出力する。デマルチプレクサ32dは、OR回路31eから駆動信号(=1)を受けると、一致信号(DETECT2)が立ち上がっていないため、その駆動信号(=1)をクロック数変換回路32aに出力し、その駆動信号の反転信号(=0)をOR回路32eに出力する。クロック数変換回路32aは、デマルチプレクサ32dから駆動信号(=1)を受けると、バッファ23からのクロック信号CLKのクロック数をカウントし、カウントしたクロック数と、距離演算回路DP12からの距離信号D12が示す距離「3」とが一致するタイミングで、一致検出信号(=1)を出力する。 The OR circuit 31e demultiplexes the drive signal (= 1) that is the logical OR operation result of the coincidence detection signal (= 1) from the clock number conversion circuit 31a and the EN signal (= 0) from the demultiplexer 31d. Output to. When receiving the drive signal (= 1) from the OR circuit 31e, the demultiplexer 32d outputs the drive signal (= 1) to the clock number conversion circuit 32a because the coincidence signal (DETECT2) has not risen, and the drive signal The inverted signal (= 0) is output to the OR circuit 32e. Clock number conversion circuit 32a, when the demultiplexer 32d receives a drive signal (= 1), counts the number of clocks of the clock signal CLK from the buffer 23, and the number of clocks counted, distance signal from the distance computing circuit DP 12 A coincidence detection signal (= 1) is output at the timing when the distance “3” indicated by D 12 coincides.

OR回路32eは、クロック数変換回路32aからの一致検出信号(=1)と、デマルチプレクサ32dからの反転信号(=0)との論理和の演算結果を表す信号(=1)をデマルチプレクサ300aに出力する。デマルチプレクサ300aは、カウンタ300bとクロック数変換回路31a,32aとにOR回路32eからの信号(=1)を出力する。クロック数変換回路31aとクロック数変換回路32aは、デマルチプレクサ300aからの信号(=1)を受けると、カウントしたクロック数をそれぞれリセットする。カウンタ300bは、デマルチプレクサ300aからの信号(=1)を受けると、カウンタ値をカウントアップし、カウンタ値「1」を一致検出回路31c’,32c’へ出力する。なお、検索開始からこのカウンタ値「1」が得られるときのクロック信号CLKの総クロック数は5(=2+3)である。   The OR circuit 32e receives a signal (= 1) representing a logical OR operation result of the coincidence detection signal (= 1) from the clock number conversion circuit 32a and the inverted signal (= 0) from the demultiplexer 32d. Output to. The demultiplexer 300a outputs the signal (= 1) from the OR circuit 32e to the counter 300b and the clock number conversion circuits 31a and 32a. When receiving the signal (= 1) from the demultiplexer 300a, the clock number conversion circuit 31a and the clock number conversion circuit 32a respectively reset the counted clock numbers. Upon receiving the signal (= 1) from the demultiplexer 300a, the counter 300b counts up the counter value and outputs the counter value “1” to the coincidence detection circuits 31c ′ and 32c ′. Note that the total number of clocks of the clock signal CLK when the counter value “1” is obtained from the start of the search is 5 (= 2 + 3).

一致検出回路31c’は、距離演算回路DP11からの距離信号D11が示す距離「2」と、カウンタ300bからのカウンタ値「1」とが一致しないため(距離>カウンタ値)、Lレベルの一致信号(DETECT1)を出力する。また、一致検出回路32c’は、距離演算回路DP12からの距離信号D12が示す距離「3」と、カウンタ300bからのカウンタ値「1」とが一致しないため(距離>カウンタ値)、Lレベルの一致信号(DETECT2)を出力する。 Coincidence detection circuit 31c 'has a distance "2" distance signal D 11 indicates from the distance calculation circuit DP 11, since the counter value from the counter 300b and "1" does not match (distance> counter value), the L level A coincidence signal (DETECT1) is output. Moreover, the coincidence detection circuit 32c ', the distance between the distance "3" indicated by the distance signal D 12 from the arithmetic circuit DP 12, the counter value "1" and because do not match (distance> counter value) from the counter 300b, L A level coincidence signal (DETECT2) is output.

デマルチプレクサ31dは、一致信号(DETECT1)が立ち上がっていないため、クロック数変換回路31aにHレベルのEN信号を入力し、OR回路31eにLレベルのEN信号を出力する。クロック数変換回路31aは、クロック信号CLKのクロック数を再びカウントし、カウントしたクロック信号CLKのクロック数と距離「2」とが一致するタイミングで、OR回路31eに「1」を示す一致検出信号を出力する。   Since the coincidence signal (DETECT1) has not risen, the demultiplexer 31d inputs the H level EN signal to the clock number conversion circuit 31a and outputs the L level EN signal to the OR circuit 31e. The clock number conversion circuit 31a again counts the number of clocks of the clock signal CLK, and the coincidence detection signal indicating “1” to the OR circuit 31e at the timing when the counted number of clocks of the clock signal CLK coincides with the distance “2”. Is output.

クロック数変換回路31aからの一致検出信号(=1)と、OR回路31eからのEN信号(=0)との論理和の演算結果を示す駆動信号(=1)がOR回路31eから出力される。デマルチプレクサ32dは、OR回路31eから駆動信号(=1)を受けると、一致信号(DETECT2)が立ち上がっていないため、クロック数変換回路32aに駆動信号(=1)を出力し、その駆動信号の反転信号(=0)をOR回路32eに出力する。クロック数変換回路32aは、クロック信号CLKのクロック数を再びカウントし、カウントしたクロック信号CLKのクロック数と距離「3」とが一致するタイミングで、OR回路31eに「1」を示す一致検出信号を出力する。   The OR circuit 31e outputs a drive signal (= 1) indicating the logical OR operation result of the coincidence detection signal (= 1) from the clock number conversion circuit 31a and the EN signal (= 0) from the OR circuit 31e. . When receiving the drive signal (= 1) from the OR circuit 31e, the demultiplexer 32d outputs the drive signal (= 1) to the clock number conversion circuit 32a because the coincidence signal (DETECT2) has not risen. An inverted signal (= 0) is output to the OR circuit 32e. The clock number conversion circuit 32a again counts the clock number of the clock signal CLK, and the coincidence detection signal indicating “1” to the OR circuit 31e at the timing when the counted clock number of the clock signal CLK coincides with the distance “3”. Is output.

クロック数変換回路32aからの一致検出信号(=1)と、デマルチプレクサ32dからの反転信号(=0)との論理和の演算結果を示す信号(=1)がOR回路32eから出力されると、デマルチプレクサ300aは、OR回路32eからの信号(=1)をカウンタ300bとクロック数変換回路31a,32aに出力する。これにより、クロック数変換回路31aとクロック数変換回路32aは、カウントしたクロック数をそれぞれリセットする。カウンタ300bは、デマルチプレクサ300aからの信号(=1)を受けてカウンタ値をカウントアップさせ、カウンタ値「2」を一致検出回路31c’,32c’へ出力する。なお、検索開始からこのカウンタ値「2」が得られるときの総クロック数は10(=2+3+2+3)である。   When the OR circuit 32e outputs a signal (= 1) indicating a logical OR operation result between the coincidence detection signal (= 1) from the clock number conversion circuit 32a and the inverted signal (= 0) from the demultiplexer 32d. The demultiplexer 300a outputs the signal (= 1) from the OR circuit 32e to the counter 300b and the clock number conversion circuits 31a and 32a. As a result, the clock number conversion circuit 31a and the clock number conversion circuit 32a reset the counted clock numbers, respectively. The counter 300b receives the signal (= 1) from the demultiplexer 300a, counts up the counter value, and outputs the counter value “2” to the coincidence detection circuits 31c ′ and 32c ′. Note that the total number of clocks when the counter value “2” is obtained from the start of the search is 10 (= 2 + 3 + 2 + 3).

一致検出回路31c’において、距離信号D11が示す距離「2」と、カウンタ300bからのカウンタ値「2」とが一致するため(距離≦カウンタ値)、Hレベルの一致信号(DETECT1)が出力される。一方、一致検出回路32c’において、距離信号D12が示す距離「3」と、カウンタ300bからのカウンタ値「2」とが一致しないため(距離>カウンタ値)、Lレベルの一致信号(DETECT2)が出力される。 In coincidence detection circuit 31c ', and the distance "2" distance signal D 11 indicates the counter value from the counter 300b "2" and for matches (Distance ≦ counter value), H-level coincidence signal (DETECT1) output Is done. On the other hand, the coincidence detection circuit 32c ', and the distance "3" distance signal D 12 indicates, since the counter value from the counter 300b and "2" does not match (distance> counter value), L-level coincidence signal (DETECT2) Is output.

デマルチプレクサ31dは、一致信号(DETECT1)がLレベルからHレベルに切り替わると、OR回路31eにHレベルのEN信号を出力し、クロック数変換回路31aにLレベルのEN信号を出力する。クロック数変換回路31aは、LレベルのEN信号を受けると、「0」を示す一致検出信号をOR回路31eに出力する。   When the coincidence signal (DETECT1) is switched from the L level to the H level, the demultiplexer 31d outputs an H level EN signal to the OR circuit 31e, and outputs an L level EN signal to the clock number conversion circuit 31a. Upon receiving the L level EN signal, the clock number conversion circuit 31a outputs a coincidence detection signal indicating “0” to the OR circuit 31e.

クロック数変換回路31aからの一致検出信号(=0)と、デマルチプレクサ31dからのEN信号(=1)との論理和の演算結果を示す駆動信号(=1)がOR回路31eから出力されると、デマルチプレクサ32dは、OR回路31eからの駆動信号(=1)をクロック数変換回路32aに出力し、その駆動信号の反転信号(=0)をOR回路32eに出力する。   The OR circuit 31e outputs a drive signal (= 1) indicating the logical OR operation result of the coincidence detection signal (= 0) from the clock number conversion circuit 31a and the EN signal (= 1) from the demultiplexer 31d. The demultiplexer 32d outputs the drive signal (= 1) from the OR circuit 31e to the clock number conversion circuit 32a, and outputs the inverted signal (= 0) of the drive signal to the OR circuit 32e.

クロック数変換回路32aは、OR回路32eから駆動信号(=1)を受けると、クロック信号CLKをカウントし、カウントしたクロック数と距離「3」とが一致するタイミングで、「1」を示す一致検出信号をOR回路32eに出力する。OR回路32eは、クロック数変換回路32aからの一致検出信号(=1)とデマルチプレクサ32dからの駆動信号(=0)との論理和の演算結果を示す信号(=1)をデマルチプレクサ300aに出力する。   When receiving the drive signal (= 1) from the OR circuit 32e, the clock number conversion circuit 32a counts the clock signal CLK, and coincides with “1” at the timing when the counted clock number and the distance “3” coincide. The detection signal is output to the OR circuit 32e. The OR circuit 32e provides the demultiplexer 300a with a signal (= 1) indicating the result of the logical sum of the coincidence detection signal (= 1) from the clock number conversion circuit 32a and the drive signal (= 0) from the demultiplexer 32d. Output.

デマルチプレクサ300aは、OR回路32eから出力される信号(=1)をカウンタ300bとクロック数変換回路31a,32aに出力する。これにより、クロック数変換回路31aとクロック数変換回路32aは、カウントしたクロック数をそれぞれリセットする。また、カウンタ300bは、デマルチプレクサ300aからの信号(=1)を受けてカウンタ値をカウントアップし、カウンタ値「3」を一致検出回路31c’,32c’へ出力する。なお、検索開始からこのカウンタ値「3」が得られるときの総クロック数は13(=2+3+2+3+3)である。   The demultiplexer 300a outputs the signal (= 1) output from the OR circuit 32e to the counter 300b and the clock number conversion circuits 31a and 32a. As a result, the clock number conversion circuit 31a and the clock number conversion circuit 32a reset the counted clock numbers, respectively. Further, the counter 300b receives the signal (= 1) from the demultiplexer 300a, counts up the counter value, and outputs the counter value “3” to the coincidence detection circuits 31c ′ and 32c ′. Note that the total number of clocks when the counter value “3” is obtained from the start of the search is 13 (= 2 + 3 + 2 + 3 + 3).

一致検出回路31c’において、距離演算回路DP11からの距離信号D11が示す距離「2」と、カウンタ300bからのカウンタ値「3」は、距離≦カウンタ値を満たすため、Hレベルの一致信号(DETECT1)が出力される。また、一致検出回路32c’において、距離演算回路DP11からの距離信号D11が示す距離「3」と、カウンタ300bからのカウンタ値「3」とが一致するため(距離≦カウンタ値)、Hレベルの一致信号(DETECT2)が出力される。 In coincidence detection circuit 31c ', and the distance "2" indicated by the distance signal D 11 from the distance computing circuit DP 11, the counter value from the counter 300b "3", to meet the distance ≦ counter value, H-level coincidence signal (DETECT1) is output. Further, the coincidence detection circuit 32c ', the distance between the distance "3" distance signal D 11 indicates from the arithmetic circuit DP 11, the counter value from the counter 300b "3" and for matches (Distance ≦ counter value), H A level coincidence signal (DETECT2) is output.

デマルチプレクサ31dは、一致信号(DETECT1)がHレベルであるので、OR回路31eにHレベルのEN信号を出力し、クロック数変換回路31aにLレベルのEN信号を出力する。クロック数変換回路31aは、LレベルのEN信号を受けると、「0」を示す一致検出信号をOR回路31eに出力する。クロック数変換回路31aからの一致検出信号(=0)と、OR回路31eからのEN信号(=1)との論理和の演算結果を示す駆動信号(=1)信号がOR回路31eから出力される。   Since the coincidence signal (DETECT1) is at the H level, the demultiplexer 31d outputs an EN signal at the H level to the OR circuit 31e and outputs an EN signal at the L level to the clock number conversion circuit 31a. Upon receiving the L level EN signal, the clock number conversion circuit 31a outputs a coincidence detection signal indicating “0” to the OR circuit 31e. The OR circuit 31e outputs a drive signal (= 1) signal indicating a logical OR operation result between the coincidence detection signal (= 0) from the clock number conversion circuit 31a and the EN signal (= 1) from the OR circuit 31e. The

デマルチプレクサ32dは、一致信号(DETECT2)がLレベルからHレベルに切り替わると、OR回路31eからの駆動信号(=1)の反転信号(=0)をクロック数変換回路32aに出力し、その駆動信号(=1)をOR回路32eに出力する。クロック数変換回路32aは、デマルチプレクサ32dから駆動信号(=0)を受けると、「0」を示す一致検出信号をOR回路32eに出力する。OR回路32eは、クロック数変換回路32aからの一致検出信号(=0)と、デマルチプレクサ32dからの駆動信号(=1)との論理和の演算結果を示す信号(=1)をデマルチプレクサ300aに出力する。   When the coincidence signal (DETECT2) is switched from the L level to the H level, the demultiplexer 32d outputs an inverted signal (= 0) of the drive signal (= 1) from the OR circuit 31e to the clock number conversion circuit 32a, and drives it. The signal (= 1) is output to the OR circuit 32e. When receiving the drive signal (= 0) from the demultiplexer 32d, the clock number conversion circuit 32a outputs a coincidence detection signal indicating “0” to the OR circuit 32e. The OR circuit 32e receives a signal (= 1) indicating a logical OR operation result of the coincidence detection signal (= 0) from the clock number conversion circuit 32a and the drive signal (= 1) from the demultiplexer 32d. Output to.

AND回路300cは、一致検出回路31c’,32c’からのHレベルの一致信号(DETECT1)と一致信号(DETECT2)との論理積を演算し、Search−End信号(=1)をデマルチプレクサ300aに出力する。デマルチプレクサ300aは、Search−End信号(=1)を受けると検索を終了し、OR回路32eからの信号を、タイミング信号CとしてWinner検出器20へを出力する。つまり、検索開始からクロック数が「13」となるタイミングでタイミング信号Cが出力される。 The AND circuit 300c calculates a logical product of the H level coincidence signal (DETECT1) and the coincidence signal (DETECT2) from the coincidence detection circuits 31c ′ and 32c ′, and sends the Search-End signal (= 1) to the demultiplexer 300a. Output. Demultiplexer 300a ends the receive and searching Search-End signal (= 1), the signal from the OR circuit 32e, and outputs the to Winner detector 20 as a timing signal C 1. In other words, the number of clocks from the search start timing signal C 1 at the timing when the "13" is output.

クロック数「13」は、距離信号D11と距離信号D12の各距離(D11=2,D12=3)の二乗値の和(=4+9)と等しい。参照データと検索データとのユークリッド距離nErの演算は、上述したように、式(1)によって演算したW個の各距離について、距離に一致するクロック数をカウントする処理を、距離に一致する回数だけ繰り返し行うことで実現される。そうすると、図4の例において、カウンタ一致検出ユニット300が、距離/クロック数変換ユニット310,320全体でクロック数「13」をカウントしたタイミングを示すタイミング信号Cを出力することは、ユークリッド距離nErによって検索データに類似する参照データを検索し、検索データに類似する参照データを検出したことを示すWinner信号を出力することに相当する。なお、距離/クロック数変換回路DC〜DCの各々も、距離/クロック数変換回路DCの動作と同じ動作によって、それぞれ、タイミング信号C〜Cを出力する。 The number of clocks “13” is equal to the sum (= 4 + 9) of the square values of the distances (D 11 = 2 and D 12 = 3) of the distance signal D 11 and the distance signal D 12 . As described above, the calculation of the Euclidean distance n Er between the reference data and the search data is the same as the processing for counting the number of clocks matching the distance for each of the W distances calculated by the expression (1). This is realized by repeatedly performing the number of times. Then, in the example of FIG. 4, the counter coincidence detection unit 300 outputs the timing signal C 1 indicating the timing at which the clock number “13” is counted by the distance / clock number conversion units 310 and 320 as a whole. This corresponds to searching reference data similar to the search data by Er and outputting a Winner signal indicating that reference data similar to the search data has been detected. Incidentally, each of the distance / clock number conversion circuit DC 2 to DC R also, by operating the same operation of the distance / clock number converting circuit DC 1, respectively, and outputs a timing signal C 2 -C R.

第1実施形態では、距離演算回路DP11〜DPRWの各々に対してカウンタを設ける例であったが、本実施形態では、距離/クロック数変換回路DCごとに1つのカウンタを設ける構成であるため、第1実施形態と比べて回路面積を小さくすることができる。 In the first embodiment, a counter is provided for each of the distance calculation circuits DP 11 to DP RW . However, in the present embodiment, one counter is provided for each distance / clock number conversion circuit DC i. Therefore, the circuit area can be reduced as compared with the first embodiment.

なお、上述した第2実施形態において、連想メモリ100の制御回路(図示せず)から、各距離/クロック数変換回路DCのデマルチプレクサ300aに、マンハッタン距離又はユークリッド距離を示す制御信号を入力し、マンハッタン距離を示す制御信号が入力された場合には、各距離/クロック数変換回路DCにおいて1回目の処理が終了するタイミングでタイミング信号Cを出力するようにしてもよい。つまり、図4の例において、クロック数変換回路31aがクロック数「2」をカウントした後、クロック数変換回路32aにおいてクロック数「3」をカウントしたタイミングで、デマルチプレクサ300aからタイミング信号Cを出力する。その結果、タイミング信号Cは、検索開始からクロック数「5」(=2+3)のタイミングで出力される。これは、1つの行における参照データと検索データとの各マンハッタン距離の和と一致する。従って、このような構成にすることで、マンハッタン距離とユークリッド距離とを選択的に用いて検索を行うことが可能となる。 In the second embodiment described above, from the control circuit for the associative memory 100 (not shown), to the demultiplexer 300a of the distance / clock number conversion circuit DC i, receives a control signal indicating the Manhattan distance or the Euclidean distance , when the control signal indicating the Manhattan distance is inputted, the first process may be adapted to output a timing signal C 1 at the timing when ends at each distance / clock number conversion circuit DC i. That is, in the example of FIG. 4, after the clock number conversion circuit 31a counts the clock number “2”, the timing signal C 1 is output from the demultiplexer 300a at the timing when the clock number conversion circuit 32a counts the clock number “3”. Output. As a result, the timing signal C 1 is output at the timing of the clock number from the search start "5" (= 2 + 3). This coincides with the sum of the Manhattan distances of the reference data and search data in one row. Therefore, with such a configuration, it is possible to perform a search by selectively using the Manhattan distance and the Euclidean distance.

<第3実施形態>
上述した第1実施形態及び第2実施形態では、各距離/クロック数変換回路において、距離ごとに、距離をクロック数に変換する処理を距離と一致する回数だけ繰り返し行うことによって、ユークリッド距離を用いた検索を行う例について説明した。
<Third Embodiment>
In the first embodiment and the second embodiment described above, each distance / clock number conversion circuit uses the Euclidean distance by repeatedly performing the process of converting the distance into the clock number for each distance as many times as the distance matches. An example of performing a search was described.

例えば、第1実施形態における各距離/クロック数変換回路において、距離をクロック数に変換する処理を各カウンタ一致検出回路において1回だけ行ったタイミングでタイミング信号を出力すると、マンハッタン距離(式(1))の和に一致するクロック数のタイミングでタイミング信号が出力される。また、上述したように、第2実施形態における距離/クロック数変換回路DC〜DCの距離/クロック数変換ユニット310,320において、距離をクロック数に変換する処理を1回だけ行ってタイミング信号を出力する場合もマンハッタン距離の和に一致するクロック数のタイミングでタイミング信号を出力することができる。 For example, in the distance / clock number conversion circuit according to the first embodiment, when the timing signal is output at the timing when the process of converting the distance into the clock number is performed only once in each counter coincidence detection circuit, the Manhattan distance (formula (1 The timing signal is output at the timing of the number of clocks matching the sum of)). As described above, in the distance / clock number conversion circuit DC 1 to DC R distance / clock number conversion unit 310 and 320 in the second embodiment, the process of converting the distance into the number of clocks by performing only once the timing In the case of outputting a signal, the timing signal can be output at the timing of the number of clocks that matches the sum of Manhattan distances.

第1実施形態や第2実施形態において、ユークリッド距離とマンハッタン距離のいずれを用いて検索する場合であっても、各距離/クロック数変換回路において、全ての距離についてクロック数が一致しなければタイミング信号は出力されない。つまり、第1実施形態や第2実施形態の場合、最も早くタイミング信号が出力されるタイミングt1(以下、類似パターンp1)と、2番目にタイミング信号が出力されるタイミングt2(以下、類似パターンp2)は、図5Aに示す関係となる。類似パターンp1は、距離がnM1の場合であり、類似パターンp2は、距離がnM2(>nM1)の場合を示している。また、τCLKは、クロックサイクルを表している。従って、類似パターンp1のタイミング信号は、t1=nM1・τCLKのタイミングで出力され、類似パターンp2のタイミング信号は、t2=nM2・τCLKのタイミングで出力される。 In the first embodiment and the second embodiment, even if the search is performed using either the Euclidean distance or the Manhattan distance, the timing is required if the number of clocks does not match for all distances in each distance / clock number conversion circuit. No signal is output. That is, in the case of the first embodiment or the second embodiment, the timing t1 at which the timing signal is output earliest (hereinafter, similar pattern p1) and the timing t2 at which the timing signal is output second (hereinafter, similar pattern p2) ) Is the relationship shown in FIG. 5A. The similar pattern p1 is a case where the distance is n M1 , and the similar pattern p2 is a case where the distance is n M2 (> n M1 ). Also, τ CLK represents a clock cycle. Therefore, the timing signal of the similar pattern p1 is output at the timing of t1 = n M1 · τ CLK , and the timing signal of the similar pattern p2 is output at the timing of t2 = n M2 · τ CLK .

第1実施形態や第2実施形態のように、距離ごとに、カウントしたクロック数との一致を厳密に検出すると、検索データやビット長が増加するほど多大な検索時間を要することになる。本実施形態では、図5Bに示すように、類似パターンp1,p2から同じ値(n・τCLK)だけ検索時間を削減することにより、第1実施形態や第2実施形態と比べて検索時間を短縮する検索アルゴリズムについて説明する。なお、以下の説明においては、マンハッタン距離を用いる場合を例に説明する。 If a match with the counted number of clocks is strictly detected for each distance as in the first embodiment and the second embodiment, a longer search time is required as search data and bit length increase. In this embodiment, as shown in FIG. 5B, the search time is reduced from the similar patterns p1 and p2 by the same value ( nx · τ CLK ), so that the search time is compared with the first embodiment and the second embodiment. A search algorithm for shortening will be described. In the following description, a case where the Manhattan distance is used will be described as an example.

図6は、本実施形態に係る連想メモリの構成例を示す概略ブロック図である。図6において、第1実施形態と同様の構成には、第1実施形態と同じ符号を付している。以下、第1実施形態と異なる構成について説明する。図6に示すように、連想メモリ110は、距離/クロック数変換回路DC〜DCに替えて距離/クロック数変換回路DE〜DEを備え、AND回路6と有効ビット設定部40とを更に備える。 FIG. 6 is a schematic block diagram illustrating a configuration example of the associative memory according to the present embodiment. In FIG. 6, the same reference numerals as those in the first embodiment are assigned to the same configurations as those in the first embodiment. Hereinafter, a configuration different from the first embodiment will be described. As shown in FIG. 6, the associative memory 110 includes distance / clock number conversion circuits DE 1 to DE R instead of the distance / clock number conversion circuits DC 1 to DC R, and includes an AND circuit 6, an effective bit setting unit 40, and the like. Is further provided.

距離演算回路DP11〜DP1Wの各々は、参照データ1と検索データとの距離を上述した式(1)を用いて演算する。また、距離演算回路DP21〜DP2Wの各々は、参照データ2と検索データとの距離を上述した式(1)を用いて演算する。以下同様にして、距離演算回路DPR1〜DPRWの各々は、参照データRと検索データとの距離を上述した式(1)を用いて演算する。 Each of the distance calculation circuits DP 11 to DP 1W calculates the distance between the reference data 1 and the search data using the above-described equation (1). In addition, each of the distance calculation circuits DP 21 to DP 2W calculates the distance between the reference data 2 and the search data using the above-described equation (1). Similarly, each of the distance calculation circuits DP R1 to DP RW calculates the distance between the reference data R and the search data using the above-described equation (1).

距離/クロック数変換回路DEは、距離演算回路DP11〜DP1WからW個のNビット長を有する距離信号D1jを受け、後述する方法で距離信号D1jが示す距離に一致するクロック数を検出したタイミングで、一致検出信号m1W_nを有効ビット設定部40へ出力する。距離/クロック数変換回路DEは、距離演算回路DP21〜DP2WからW個のNビット長を有する距離信号D2jを受け、後述する方法で距離信号D2jが示す距離に一致するクロック数を検出したタイミングで、一致検出信号m2W_nを有効ビット設定部40へ出力する。以下、同様にして、距離/クロック数変換回路DEは、距離演算回路DPR1〜DPRWからW個のNビット長を有する距離信号DRjを受け、後述する方法で距離信号DRjが示す距離に一致するクロック数を検出したタイミングで、一致検出信号mRW_nを有効ビット設定部40へ出力する。 The distance / clock number conversion circuit DE 1 receives a distance signal D 1j having a length of N bits from the distance calculation circuits DP 11 to DP 1W, and matches the distance indicated by the distance signal D 1j by a method described later. The coincidence detection signal m 1W — n is output to the valid bit setting unit 40 at the timing of detecting Distance / clock number conversion circuit DE 2 receives the distance signal D 2j which from the distance calculating circuit DP 21 to DP 2W having a W number of N-bit length, the number of clocks to match the distance indicated by the distance signal D 2j in the manner described below The coincidence detection signal m 2W — n is output to the valid bit setting unit 40 at the timing at which is detected. Thereafter, in the same manner, the distance / clock number conversion circuit DE R, the distance calculation circuit DP R1 to DP RW receives the distance signal D Rj having a W number of N-bit length from, indicated by the distance signal D Rj by a method described later The coincidence detection signal m RW — n is output to the valid bit setting unit 40 at the timing when the number of clocks that coincides with the distance is detected.

図7は、距離/クロック数変換回路DEの構成例を示す概略構成図である。図7に示すように、距離/クロック数変換回路DEは、距離演算回路DP11〜DP1Wにそれぞれ対応するように設けられたカウンタ一致検出回路DE11〜DE1Wと、バッファ21〜2Wとを有する。なお、距離/クロック数変換回路DE…DEについても距離/クロック数変換回路DEと同様の構成を有する。 Figure 7 is a schematic configuration diagram showing a configuration example of a distance / clock number conversion circuit DE 1. As shown in FIG. 7, the distance / clock number conversion circuit DE 1 includes counter coincidence detection circuits DE 11 to DE 1W and buffers 21 to 2W provided to correspond to the distance calculation circuits DP 11 to DP 1W , respectively. Have Has the same configuration is also the distance / clock number conversion circuit DE 1 for the distance / clock number conversion circuit DE 2 ... DE R.

カウンタ一致検出回路DE11〜DE1Wは、それぞれ距離演算回路DP11〜DP1WからNビット長を有する距離信号D11〜D1Wを受ける。カウンタ一致検出回路DE11は、バッファ21からクロック信号CLKが入力される。カウンタ一致検出回路DE12〜DE1Wは、それぞれカウンタ一致検出回路DE11〜DE1W−1から後述するカウンタ一致信号m11_n〜m1W−1_nがバッファ22〜2Wに入力されると、バッファ22〜2Wからクロック信号CLKが入力される。 Counter match detection circuit DE 11 ~DE 1W receives the distance signal D 11 to D 1W with N-bit length from each distance calculating circuit DP 11 to DP 1W. The counter coincidence detection circuit DE 11 receives the clock signal CLK from the buffer 21. Counter match detection circuit DE 12 ~DE 1W, when later from each counter match detection circuit DE 11 ~DE 1W-1 counter match signal m 11 _n~m 1W-1 _n is input to the buffer 22~2W, buffer The clock signal CLK is input from 22 to 2W.

カウンタ一致検出回路DE11〜DE1Wは、後述する有効ビット設定部40から、検索対象のビットを示す信号(以下、BAS信号)を受ける。カウンタ一致検出回路DE11は、BAS信号が示すビット(n)に対応するカウンタ値と距離信号D11が示す距離との一致を検出し、一致を検出したタイミングでバッファ22とカウンタ一致検出回路DE12にHレベルの一致検出信号m11_nを出力する。カウンタ一致検出回路DE12は、Hレベルの一致検出信号m11_nを受けると、BAS信号が示すビットに対応するカウンタ値と距離信号Dが示す距離との一致を検出し、一致を検出したタイミングで、バッファ23とカウンタ一致検出回路DE13(図示せず)にHレベルの一致検出信号m12_nを出力する。以下同様にして、カウンタ一致検出回路DE1Wは、Hレベルの一致検出信号m1w−1_nを受けると、BAS信号が示すビットに対応するカウンタ値と距離信号D1Wが示す距離との一致を検出し、一致を検出したタイミングで、Hレベルの一致検出信号m1w_nを出力する。 The counter coincidence detection circuits DE 11 to DE 1W receive a signal indicating a search target bit (hereinafter referred to as a BAS signal) from a valid bit setting unit 40 described later. The counter coincidence detection circuit DE 11 detects the coincidence between the counter value corresponding to the bit (n) indicated by the BAS signal and the distance indicated by the distance signal D 11 , and the buffer 22 and the counter coincidence detection circuit DE 11 are detected at the timing when the coincidence is detected. 12 outputs an H level coincidence detection signal m 11 _n. Upon receiving the H level match detection signal m 11 _n, the counter match detection circuit DE 12 detects the match between the counter value corresponding to the bit indicated by the BAS signal and the distance indicated by the distance signal D 2 and detects the match. At timing, an H level coincidence detection signal m 12 — n is output to the buffer 23 and the counter coincidence detection circuit DE 13 (not shown). Similarly, when the counter coincidence detection circuit DE 1W receives the H level coincidence detection signal m 1w-1 _n, it matches the counter value corresponding to the bit indicated by the BAS signal with the distance indicated by the distance signal D 1W. At the timing of detection and detection of coincidence, an H level coincidence detection signal m 1w — n is output.

ここで、カウンタ一致検出回路DE11の構成例を示す概略構成図を図8に示す。図8に示すように、カウンタ一致検出回路DE11は、Nビットのカウンタ312、一致検出回路313、及びマルチプレクサ314を有する。なお、カウンタ一致検出回路DE12…DE1wについてもカウンタ一致検出回路DE11と同様の構成を有する。 Here, a schematic configuration diagram showing a configuration example of the counter coincidence detection circuit DE 11 is shown in FIG. As shown in FIG. 8, the counter coincidence detection circuit DE 11 includes an N-bit counter 312, a coincidence detection circuit 313, and a multiplexer 314. The counter coincidence detection circuits DE 12 ... DE 1w also have the same configuration as the counter coincidence detection circuit DE 11 .

カウンタ312は、バッファ21からクロック信号CLKを受け、有効ビット設定部40からBAS信号を受け、連想メモリ110の制御回路(図示せず)からリセット信号(RST)を受ける。カウンタ312は、クロック信号CLKのクロックに同期して、BAS信号が示すビットについてカウントアップを行い、カウンタ値を一致検出回路313に出力する。   The counter 312 receives the clock signal CLK from the buffer 21, receives the BAS signal from the valid bit setting unit 40, and receives a reset signal (RST) from a control circuit (not shown) of the associative memory 110. The counter 312 counts up the bit indicated by the BAS signal in synchronization with the clock of the clock signal CLK, and outputs the counter value to the coincidence detection circuit 313.

一致検出回路313は、BAS信号が示すビットに対応するカウンタ値と距離信号D11の値との一致を検出する。一致検出回路313は、BAS信号が示すビットに対応するカウンタ値と距離信号D11の値との一致を検出すると、「1」を示す一検出信号m11_nをマルチプレクサ314に出力する。 Coincidence detection circuit 313 detects a match between the value of the counter value and the distance signal D 11 corresponding to the bit indicated by the BAS signal. When the coincidence detection circuit 313 detects coincidence between the counter value corresponding to the bit indicated by the BAS signal and the value of the distance signal D 11 , the coincidence detection circuit 313 outputs one detection signal m 11 — n indicating “1” to the multiplexer 314.

図9Aは、本実施形態におけるカウンタ312と一致検出回路313の回路構成例を示している。図9Aの例では、カウンタ312は3ビットカウンタで構成される。カウンタ312は、3つのセレクタ312a,312b,312cと、各セレクタと接続された分周器312d,312e,312fとを有する。セレクタ312a,312b,312cは、有効ビット設定部40からBAS信号を受け、バッファ21からクロック信号CLKを受ける。セレクタ312aは、最上位ビットに対応し、最上位ビットを示すBAS信号(BAS<1>)を受ける。セレクタ312bは、最上位から2番目のビットに対応し、2番目のビットを示すBAS信号(BAS<2>)を受ける。セレクタ312cは、最下位ビットに対応し、最下位ビットを示すBAS信号(BAS<3>)を受ける。BAS信号は、1又は0を示す信号である。   FIG. 9A shows a circuit configuration example of the counter 312 and the coincidence detection circuit 313 in the present embodiment. In the example of FIG. 9A, the counter 312 is a 3-bit counter. The counter 312 includes three selectors 312a, 312b, and 312c, and frequency dividers 312d, 312e, and 312f connected to the selectors. The selectors 312 a, 312 b, and 312 c receive the BAS signal from the valid bit setting unit 40 and the clock signal CLK from the buffer 21. The selector 312a receives the BAS signal (BAS <1>) corresponding to the most significant bit and indicating the most significant bit. The selector 312b corresponds to the second most significant bit and receives a BAS signal (BAS <2>) indicating the second bit. The selector 312c corresponds to the least significant bit and receives a BAS signal (BAS <3>) indicating the least significant bit. The BAS signal is a signal indicating 1 or 0.

一致検出回路313は、EXNOR回路313a,313b,313cと、AND回路313d,313eとを有する。EXNOR回路313a,313b,313cは、分周器312d,312e,312fとそれぞれ接続されている。   The coincidence detection circuit 313 includes EXNOR circuits 313a, 313b, and 313c, and AND circuits 313d and 313e. The EXNOR circuits 313a, 313b, and 313c are connected to the frequency dividers 312d, 312e, and 312f, respectively.

セレクタ312a,312b,312cのいずれかにBAS信号(=1)が入力されると、BAS信号(=1)が入力されたセレクタは、クロック信号CLKを対応する分周器に入力する。クロック信号CLKが入力された分周器は、クロック信号CLKを分周して一致検出回路313へ出力する。なお、分周器312d,312eは、下位のビットを示すBAS信号が入力されている場合であっても、下位のビットに対応する分周器のカウントアップによる桁上げ値が入力されるとカウントアップを行う。   When the BAS signal (= 1) is input to any of the selectors 312a, 312b, 312c, the selector to which the BAS signal (= 1) is input inputs the clock signal CLK to the corresponding frequency divider. The frequency divider to which the clock signal CLK is input divides the clock signal CLK and outputs it to the coincidence detection circuit 313. It should be noted that the frequency dividers 312d and 312e are counted when a carry value by counting up the frequency divider corresponding to the lower bits is input even when the BAS signal indicating the lower bits is input. Do up.

図9Bは、BAS信号によって最上位から最下位ビットが指定された場合のカウンタ312の動作を示すである。BAS信号により最上位ビットが指定されている場合(BAS<1>=1,BAS<2>=0,BAS<3>=0)、セレクタ312cはグランドに接地されているため、分周器312f、312eからEXNOR回路313b,313cに信号値「0」が出力される。分周器312aには、クロック信号CLKが入力され、図9Bのi)に示すように、クロック信号CLKを2回分周した信号で示されるカウンタ値をEXNOR回路313aに出力する。つまり、この場合には、カウンタ312は、1ビットカウンタとして機能する。 FIG. 9B shows the operation of the counter 312 when the least significant bit is designated from the most significant by the BAS signal. When the most significant bit is designated by the BAS signal (BAS <1> = 1, BAS <2> = 0, BAS <3> = 0), the selector 312c is grounded, so the frequency divider 312f 312e outputs a signal value “0” to the EXNOR circuits 313b and 313c. The divider 312a, the clock signal CLK is input, as shown in i) of FIG. 9B, it outputs the counter value indicated a clock signal CLK 2 0 times peripheral signal to the EXNOR circuit 313a. That is, in this case, the counter 312 functions as a 1-bit counter.

また、BAS信号により最上位から2ビット目が指定されている場合(BAS<1>=0,BAS<2>=1,BAS<3>=0)、分周器312fからEXNOR回路313cに信号値「0」が出力される。分周器312eには、クロック信号CLKが入力され、図9Bのii)に示すように、クロック信号CLKを2回分周した信号で示されるカウンタ値をEXNOR回路313bに出力する。分周器312dには、分周器312eからの桁上げ信号が入力され、図9Bのii)に示すように、クロック信号CLKを2分周した信号で示されるカウンタ値をEXNOR回路313aに出力する。つまり、この場合には、カウンタ312は、2ビットカウンタとして機能する。 If the second bit from the most significant bit is designated by the BAS signal (BAS <1> = 0, BAS <2> = 1, BAS <3> = 0), a signal is sent from the frequency divider 312f to the EXNOR circuit 313c. The value “0” is output. The divider 312e, the clock signal CLK is input, as shown in ii) of FIG. 9B, it outputs the counter value indicated a clock signal CLK 2 0 times peripheral signal to the EXNOR circuit 313b. The frequency divider 312d, the carry signal from the frequency divider 312e is input, as shown in ii) of FIG. 9B, a clock signal CLK to the counter value indicated by 2 divided by 1 signal to the EXNOR circuit 313a Output. That is, in this case, the counter 312 functions as a 2-bit counter.

また、BAS信号により最下位ビットが指定されている場合(BAS<1>=0,BAS<2>=0,BAS<3>=1)、分周器312fには、クロック信号CLKが入力され、図9Bのiii)に示すように、クロック信号CLKを2回分周した信号で示されるカウンタ値をEXNOR回路313cに出力する。分周器312eには、分周器312fからの桁上げ信号が入力され、図9Bのiii)に示すように、クロック信号CLKを2回分周した信号で示されるカウンタ値をEXNOR回路313bに出力する。また、分周器312dには、分周器312eからの桁上げ信号が入力され、図9Bのiii)に示すように、クロック信号CLKを2回分周した信号で示されるカウンタ値をEXNOR回路313aに出力する。つまり、この場合には、カウンタ312は、3ビットカウンタとして機能する。 When the least significant bit is specified by the BAS signal (BAS <1> = 0, BAS <2> = 0, BAS <3> = 1), the clock signal CLK is input to the frequency divider 312f. , as shown in iii) of FIG. 9B, outputs the counter value indicated a clock signal CLK 2 0 times peripheral signal to the EXNOR circuit 313c. The divider 312e, the carry signal from the frequency divider 312f is input, as shown in iii) of FIG. 9B, a clock signal CLK to the counter value indicated by 2 1 times the circumferential signal to EXNOR circuit 313b Output. Further, minute the divider 312d, divider carry signal from 312e is input, as shown in iii) of FIG. 9B, EXNOR circuit a counter value indicated a clock signal CLK at 2 twice peripheral signals To 313a. That is, in this case, the counter 312 functions as a 3-bit counter.

図9Aに戻り、説明を続ける。EXNOR回路313a,313b,313cは、距離信号Dijの各ビットの値D<1>,D<2>,D<3>を受け、分周器312d,312e,312fからそれぞれカウンタ値を受ける。 Returning to FIG. 9A, the description will be continued. EXNOR circuit 313a, 313b, 313c is the distance signal D value D of each bit of the ij <1>, D <2 >, subjected to D <3>, a frequency divider 312d, 312e, receives a respective counter value from 312f.

EXNOR回路313aは、距離信号Dijの最上位ビットの値D<1>と、分周器312dから出力されるカウンタ値とが一致する場合に、AND回路313dに「1」を示す検出信号を出力し、その検出信号(=1)を最上位ビットに対応する一致検出信号mij_1としてマルチプレクサ314に出力する。また、距離信号Dijの最上位ビットの値D<1>とカウンタ値とが一致しない場合、AND回路313dに「0」を示す検出信号を出力し、その検出信号(=0)を一致検出信号mij_1としてマルチプレクサ314に出力する。 EXNOR circuit 313a includes a distance signal D of the most significant bit of the ij values D <1>, when the counter value output from the frequency divider 312d are identical, the detection signal indicating "1" to the AND circuit 313d The detection signal (= 1) is output to the multiplexer 314 as the coincidence detection signal m ij _1 corresponding to the most significant bit. If the value D <1> of the most significant bit of the distance signal D ij does not match the counter value, a detection signal indicating “0” is output to the AND circuit 313d, and the detection signal (= 0) is detected as coincidence. The signal m ij _ 1 is output to the multiplexer 314.

EXNOR回路313bは、距離信号Dijの最上位から2番目のビットの値D<2>と、分周器312eから出力されるカウンタ値とが一致する場合に、AND回路313dに「1」を示す検出信号を出力し、一致しない場合には「0」を示す検出信号を出力する。 The EXNOR circuit 313b sets “1” to the AND circuit 313d when the value D <2> of the second most significant bit of the distance signal D ij matches the counter value output from the frequency divider 312e. A detection signal indicating “0” is output when the detection signals do not coincide with each other.

EXNOR回路313cは、距離信号Dijの最下位ビットの値D<3>と、分周器312fから出力されるカウンタ値とが一致する場合に、AND回路313eに「1」を示す検出信号を出力し、一致しない場合には「0」を示す検出信号を出力する。 EXNOR circuit 313c includes a distance signal D least significant bits of the value D <3> of ij, when the counter value output from the frequency divider 312f match, a detection signal indicating "1" to the AND circuit 313e If it does not match, a detection signal indicating “0” is output.

AND回路313dは、EXNOR回路313aとEXNOR回路313bとから入力される検出信号の論理積の値を示す検出信号をAND回路313eに出力し、その検出信号を最上位から2番目のビットに対応する一致検出信号mij_2としてマルチプレクサ314に出力する。例えば、EXNOR回路313aとEXNOR回路313bとから検出信号(=1)が出力された場合、つまり、上位2ビットの距離とカウンタ値とが一致している場合には、「1」を示す検出信号がAND回路313eに出力され、「1」を示す一致検出信号mij_2がマルチプレクサ314に出力される。また、EXNOR回路313aとEXNOR回路313bの少なくとも一方から検出信号(=0)が出力された場合、つまり、上位2ビットの距離とカウンタ値とが一致していない場合には、「0」を示す検出信号がAND回路313eに出力され、「0」を示す一致検出信号mij_2がマルチプレクサ314に出力される。 The AND circuit 313d outputs a detection signal indicating the logical product of the detection signals input from the EXNOR circuit 313a and the EXNOR circuit 313b to the AND circuit 313e, and the detection signal corresponds to the second most significant bit. and outputs as the match detection signal m ij _2 to the multiplexer 314. For example, when the detection signal (= 1) is output from the EXNOR circuit 313a and the EXNOR circuit 313b, that is, when the distance of the upper 2 bits matches the counter value, the detection signal indicating “1” There is output to the aND circuit 313e, the coincidence detection signal m ij _2 indicating "1" is output to the multiplexer 314. In addition, when a detection signal (= 0) is output from at least one of the EXNOR circuit 313a and the EXNOR circuit 313b, that is, when the distance of the upper 2 bits does not match the counter value, “0” is indicated. detection signal is output to the aND circuit 313e, the coincidence detection signal m ij _2 indicating "0" is output to the multiplexer 314.

AND回路313eは、EXNOR回路313cとAND回路313dとから入力される検出信号の論理積の値を示す検出信号を最下位ビットに対応する一致検出信号mij_3としてマルチプレクサ314に出力する。例えば、EXNOR回路313cとAND回路313dとから検出信号(=1)が出力された場合、つまり、全ビットで表される距離とカウンタ値とが一致している場合には、一致検出信号mij_3(=1)が出力される。また、EXNOR回路313cとAND回路313dの少なくとも一方から検出信号(=0)が出力された場合、つまり、全ビットで表される距離とカウンタ値とが一致していない場合には、一致検出信号mij_3(=0)がマルチプレクサ314に出力される。そして、一致検出回路313においては、EXNOR回路313aが「1」を示す検出信号を出力しない限り、AND回路313d,313eとはそれぞれ「1」を示す一致検出信号mij_2,mij_3を出力することはない。 The AND circuit 313e outputs a detection signal indicating a logical product value of the detection signals input from the EXNOR circuit 313c and the AND circuit 313d to the multiplexer 314 as a coincidence detection signal m ij —3 corresponding to the least significant bit. For example, when the detection signal (= 1) is output from the EXNOR circuit 313c and the AND circuit 313d, that is, when the distance represented by all the bits matches the counter value, the coincidence detection signal m ij _3 (= 1) is output. Further, when a detection signal (= 0) is output from at least one of the EXNOR circuit 313c and the AND circuit 313d, that is, when the distance represented by all bits does not match the counter value, the coincidence detection signal m ij — 3 (= 0) is output to the multiplexer 314. In the coincidence detection circuit 313, unless the EXNOR circuit 313a outputs a detection signal indicating “1”, the AND circuits 313d and 313e output coincidence detection signals m ij _2 and m ij _3 indicating “1”, respectively. Never do.

図8に戻り、カウンタ一致検出回路DE11におけるマルチプレクサ314は、BAS信号で示されるビットに対応する、一致検出回路313から出力される一致検出信号m11_nを、バッファ22及びカウンタ一致検出回路DE12に出力する。なお、カウンタ一致検出回路DE1Wにおけるマルチプレクサ314から出力される一致検出信号m1W_nは、有効ビット設定部40に出力される。 Returning to FIG. 8, the multiplexer 314 in the counter coincidence detection circuit DE 11 uses the buffer 22 and the counter coincidence detection circuit DE to output the coincidence detection signal m 11 — n output from the coincidence detection circuit 313 corresponding to the bit indicated by the BAS signal. 12 is output. The coincidence detection signal m 1W — n output from the multiplexer 314 in the counter coincidence detection circuit DE 1W is output to the valid bit setting unit 40.

次に、図6、7を参照して、有効ビット設定部40について説明する。有効ビット設定部40は、クロック信号CLKと、距離/クロック数変換回路DE〜DEから出力される一致検出信号miW_n(1又は0)を受ける。有効ビット設定部40は、いずれかの距離クロック数変換回路DE〜DEから一致検出信号miW_n(=1)を受けると、クロック信号CLKに同期して、カウンタ一致検出回路DEi1〜DEiWにおける各カウンタ312及びマルチプレクサ314に対してBAS信号を出力する。 Next, the valid bit setting unit 40 will be described with reference to FIGS. Valid bit setting unit 40 receives the clock signal CLK, the distance / clock number conversion circuit DE 1 ~DE coincidence detection signal outputted from the R m iW _n (1 or 0). Valid bit setting unit 40 receives either the distance clock number conversion circuit DE 1 ~DE R from the coincidence detection signal m iW _n (= 1), in synchronization with the clock signal CLK, the counter match detecting circuits DE i1 ~ A BAS signal is output to each counter 312 and multiplexer 314 in DE iW .

有効ビット設定部40からカウンタ一致検出回路DEi1〜DEiWにBAS信号を入力するために、1クロックサイクルが必要となる。有効ビット設定部40は、BAS信号を入力する間、CLK_ACT信号をAND回路6に入力し、クロック信号CLKが距離/クロック数変換回路DE〜DEに入力されないようにする。CLK_ACT信号は、一致検出信号miW_nを反転させた信号である。 In order to input the BAS signal from the valid bit setting unit 40 to the counter coincidence detection circuits DE i1 to DE iW , one clock cycle is required. Valid bit setting unit 40, while inputting the BAS signal, and inputs the CLK_ACT signal to the AND circuit 6, so that the clock signal CLK is not input to the distance / clock number conversion circuit DE 1 ~DE R. CLK_ACT signal is a signal obtained by inverting the coincidence detection signal m iW _n.

つまり、一致検出信号miW_nが立ち上がると(一致検出信号miW_n=1)、「0」を示すCLK_ACT信号がAND回路6に入力され、一致検出信号miW_nが立ち上がっていなければ(一致検出信号m1W_n=0)、「1」を示すCLK_ACT信号がAND回路6に入力される。有効ビット設定部40は、距離/クロック数変換回路DE〜DEから最下位ビットに対応する一致検出信号が立ち上がったタイミングでタイミング信号C〜CをWinner検出器20へ出力する。 That is, when the match detection signal m iW _n rises (coincidence detection signal m iW _n = 1), CLK_ACT signal indicating "0" is input to the AND circuit 6, if not rise the match detection signal m iW _n (match Detection signal m 1W — n = 0), and CLK_ACT signal indicating “1” is input to the AND circuit 6. Valid bit setting unit 40 outputs from the distance / clock number conversion circuit DE 1 ~DE R at the timing when the coincidence detection signal rises corresponding to the least significant bit timing signal C 1 -C R to Winner detector 20.

AND回路6は、クロック信号CLKと有効ビット設定部40からのCLK_ACT信号(1又は0)とを受ける。AND回路6は、有効ビット設定部40からのCLK_ACT信号とクロック信号CLKとの論理積を演算した結果を距離/クロック数変換回路DE〜DEに入力する。つまり、有効ビット設定部40からCLK_ACT信号(=0)が入力された場合には、クロック信号CLKが距離/クロック数変換回路DE〜DEに入力されず、CLK_ACT信号(=1)が入力された場合には、クロック信号CLKが距離/クロック数変換回路DE〜DEに入力される。 The AND circuit 6 receives the clock signal CLK and the CLK_ACT signal (1 or 0) from the valid bit setting unit 40. AND circuit 6 inputs the calculation result of the logical product of the CLK_ACT signal and the clock signal CLK from the effective bit setting unit 40 on the distance / clock number conversion circuit DE 1 ~DE R. That is, when the CLK_ACT signal (= 0) is input from the valid bit setting unit 40, the clock signal CLK is not input to the distance / clock number conversion circuits DE 1 to DE R and the CLK_ACT signal (= 1) is input. If it is, the clock signal CLK is inputted to the distance / clock number conversion circuit DE 1 ~DE R.

ここで、図6に示す構成において、参照データが参照データ1、2であり、R=2、W=3である場合の動作例について説明する。図10Aは、参照データ1に対する距離/クロック数変換回路DEと、参照データ2に対する距離/クロック数変換回路DEとにおいて、参照データ1と検索データとの距離と、参照データ2と検索データとの距離とをそれぞれクロック数に変換する処理過程を示す図である。 Here, in the configuration shown in FIG. 6, an example of operation when the reference data is the reference data 1 and 2 and R = 2 and W = 3 will be described. FIG. 10A shows the distance between the reference data 1 and the search data, the reference data 2 and the search data in the distance / clock number conversion circuit DE 1 for the reference data 1 and the distance / clock number conversion circuit DE 2 for the reference data 2. It is a figure which shows the process in which each distance is converted into the number of clocks.

図10Aの例において、距離/クロック数変換回路DEは、カウンタ一致検出回路DE11〜DE13を有し、距離/クロック数変換回路DEは、カウンタ一致検出回路DE21〜DE23を有する。なお、図10Aにおけるカウンタ値と距離の各値の下線は、有効ビット設定部40によって設定されたビット、つまり、距離とカウンタ値の一致検出対象となるビットであることを示している。 In the example of FIG. 10A, the distance / clock number conversion circuit DE 1 includes counter coincidence detection circuits DE 11 to DE 13 , and the distance / clock number conversion circuit DE 2 includes counter coincidence detection circuits DE 21 to DE 23 . . In FIG. 10A, the underline of each counter value and distance value indicates a bit set by the effective bit setting unit 40, that is, a bit for which a match between the distance and the counter value is to be detected.

カウンタ一致検出回路DE11,DE12,DE13には、距離演算回路DP11,DP12,DP13から距離信号D11,12,D13がそれぞれ入力される。この例において、距離信号D11が示す距離は「510(=101)」であり、距離信号D12が示す距離は「410(=100)」であり、距離信号D13が示す距離は「310(=010)」である。また、カウンタ一致検出回路DE21,DE22,DE23には、距離演算回路DP21,DP22,DP23から距離信号D21,22,D23がそれぞれ入力される。この例において、距離信号D21が示す距離は「710(=111)」であり、距離信号D22が示す距離は「010(=000)」であり、距離信号D23が示す距離は「210(=010)」である。なお、距離/クロック数変換回路DEとDEにおける各カウンタ一致検出回路には、初期値として、最上位ビットを示すBAS信号(BAS<1>=1,BAS<2>=0,BAS<3>=0)が予め設定されている。 The counter coincidence detection circuits DE 11 , DE 12 , DE 13 receive distance signals D 11, D 12 , D 13 from the distance calculation circuits DP 11 , DP 12 , DP 13 , respectively. In this example, the distance indicated by the distance signal D 11 is "5 10 (= 101 2)", the distance indicated by the distance signal D 12 is "4 10 (= 100 2)" indicates the distance signal D 13 The distance is “3 10 (= 010 2 )”. Further, distance signals D 21, D 22 , and D 23 are input to the counter match detection circuits DE 21 , DE 22 , and DE 23 from the distance calculation circuits DP 21 , DP 22 , and DP 23 , respectively. In this example, the distance indicated by the distance signal D 21 is “7 10 (= 111 2 )”, the distance indicated by the distance signal D 22 is “0 10 (= 000 2 )”, and the distance signal D 23 indicates The distance is “2 10 (= 010 2 )”. Each counter coincidence detection circuit in the distance / clock number conversion circuits DE 1 and DE 2 has a BAS signal (BAS <1> = 1, BAS <2> = 0, BAS <) indicating the most significant bit as an initial value. 3> = 0) is preset.

連想メモリ110の制御回路(図示せず)から検索開始を示す信号SBが入力されると、0クロック目において、カウンタ一致検出回路DE11,DE12は、それぞれ、最上位ビットに対応する分周器312dのカウンタ値「0」を一致検出回路313のEXNOR回路313aに出力する。図10Aの例において、BAS「1」,クロック「0」のとき、カウンタ一致検出回路DE11における、下線で示す最上位ビットのカウンタ値「00」と距離「01」とは一致しない。同様に、カウンタ一致検出回路DE21における、下線で示す最上位ビットのカウンタ値「00」と距離「11」とは一致しない。そのため、カウンタ一致検出回路DE11とカウンタ一致検出回路DE21において、それぞれ、EXNOR回路313aから「0」を示す検出信号がAND回路313dに出力される。そして、カウンタ一致検出回路DE11からカウンタ一致検出回路DE12に一致検出信号m11_1(=0)が出力され、カウンタ一致検出回路DE21からカウンタ一致検出回路DE22に一致検出信号m21_1(=0)が出力される。 When a signal SB indicating a search start is input from a control circuit (not shown) of the associative memory 110, the counter match detection circuits DE 11 and DE 12 respectively divide the frequency corresponding to the most significant bit at the 0th clock. The counter value “0” of the device 312 d is output to the EXNOR circuit 313 a of the coincidence detection circuit 313. In the example of FIG. 10A, when BAS “1” and clock “0”, the counter value “ 0 00” of the most significant bit indicated by the underline in the counter match detection circuit DE 11 does not match the distance “ 1 01”. Similarly, the counter match detection circuit DE 21, do not match the counter value of the most significant bit is underlined and "0 00" and the distance "1 11". Therefore, in the counter coincidence detection circuit DE 11 and the counter coincidence detection circuit DE 21 , detection signals indicating “0” are output from the EXNOR circuit 313 a to the AND circuit 313 d. Then, the coincidence detection signal m 11 _ 1 (= 0) is output from the counter coincidence detection circuit DE 11 to the counter coincidence detection circuit DE 12 , and the coincidence detection signal m 21 _1 is output from the counter coincidence detection circuit DE 21 to the counter coincidence detection circuit DE 22. (= 0) is output.

有効ビット設定部40は、0クロック目において、距離/クロック数変換回路DE、DEの最上位ビットに対応する一致検出信号がいずれも立ち上がっていないため、CLK_ACT信号(=1)をAND回路6に出力する。これにより、カウンタ一致検出回路DE11、DE21にクロック信号CLKが入力される。 Since the coincidence detection signal corresponding to the most significant bit of the distance / clock number conversion circuits DE 1 and DE 2 has not risen at the 0th clock, the valid bit setting unit 40 uses the CLK_ACT signal (= 1) as an AND circuit. 6 is output. As a result, the clock signal CLK is input to the counter coincidence detection circuits DE 11 and DE 21 .

カウンタ一致検出回路DE11、DE21は、それぞれのセレクタ312aにクロック信号CLKを入力する。カウンタ一致検出回路DE11における分周器312dはクロック信号CLKを2回分周し、図10Bに示すt1におけるカウンタ値「1」をEXNOR回路313aに出力し、EXNOR回路313aから「1」を示す検出信号がAND回路313dに出力される。そして、カウンタ一致検出回路DE12とバッファ22とに、一致検出信号m11_1(=1)が出力される。 The counter coincidence detection circuits DE 11 and DE 21 input the clock signal CLK to the respective selectors 312a. Divider 312d in the counter coincidence detection circuit DE 11 was 2 0 times the frequency of the clock signal CLK, and outputs the counter value at t1 shown in FIG. 10B "1" to EXNOR circuit 313a, indicating "1" from the EXNOR circuit 313a The detection signal is output to the AND circuit 313d. Then, the coincidence detection signal m 11 _1 (= 1) is output to the counter coincidence detection circuit DE 12 and the buffer 22.

カウンタ一致検出回路DE12は、一致検出信号m11_1(=1)が入力されると、一致検出回路313において、最上位ビットに対応する分周器312dのカウンタ値と距離D12との一致の検出を開始する。カウンタ一致検出回路DE12における分周器312dはクロック信号CLKを2回分周し、図10Bに示すt1におけるカウンタ値「0」をEXNOR回路313aに出力する。最上位ビットに対応するカウンタ値「0」と距離D1200」とは一致しないため、EXNOR回路313aから「0」を示す検出信号がAND回路313dに出力され、一致検出信号m12_1(=0)が出力される。従って、検索開始から1クロック目に、参照データ1について一致検出信号m13_1(=1)は出力されない。 When the match detection signal m 11 _ 1 (= 1) is input to the counter match detection circuit DE 12 , the match detection circuit 313 matches the counter value of the frequency divider 312 d corresponding to the most significant bit with the distance D 12. Start detecting. Counter match detection circuit DE divider in 12 312d is a clock signal CLK to 2 0 times division and outputs the counter value at t1 shown in FIG. 10B to "0" to the EXNOR circuit 313a. Since the counter value “0” corresponding to the most significant bit does not match the distance D 121 00”, the detection signal indicating “0” is output from the EXNOR circuit 313a to the AND circuit 313d, and the match detection signal m 12 _1. (= 0) is output. Therefore, the coincidence detection signal m 13 _1 (= 1) is not output for the reference data 1 at the first clock from the search start.

一方、図10Bに示すように、カウンタ一致検出回路DE21における分周器312dはクロック信号CLKを2回分周し、図10Bに示すt1におけるカウンタ値「1」をEXNOR回路313aに出力し、EXNOR回路313aから「1」を示す検出信号がAND回路313dに出力される。そして、カウンタ一致検出回路DE12とバッファ22とに、一致検出信号m21_1(=1)が出力される。 On the other hand, as shown in FIG. 10B, the frequency divider 312d in the counter coincidence detection circuit DE 21 is a clock signal CLK to 2 0 times circumferential outputs the counter values at t1 shown in FIG. 10B "1" to EXNOR circuit 313a, A detection signal indicating “1” is output from the EXNOR circuit 313a to the AND circuit 313d. Then, the coincidence detection signal m 21 _ 1 (= 1) is output to the counter coincidence detection circuit DE 12 and the buffer 22.

カウンタ一致検出回路DE22は、一致検出信号m21_1(=1)が入力されると、一致検出回路313において、最上位ビットに対応する分周器312dのカウンタ値と距離D22との一致の検出を開始する。図10Bに示すように、カウンタ一致検出回路DE22における分周器312dはクロック信号CLKを2回分周し、図10Bに示すt1におけるカウンタ値「0」をEXNOR回路313aに出力する。最上位ビットに対応するカウンタ値「0」と距離「00」とは一致するため、EXNOR回路313aから「1」を示す検出信号がAND回路313dに出力され、カウンタ一致検出回路DE23とバッファ23とに、一致検出信号m22_1(=1)が出力される。 When the coincidence detection signal m 21 _ 1 (= 1) is input to the counter coincidence detection circuit DE 22 , the coincidence detection circuit 313 matches the counter value of the frequency divider 312 d corresponding to the most significant bit with the distance D 22. Start detecting. As shown in FIG. 10B, the frequency divider 312d in the counter coincidence detection circuit DE 22 is a clock signal CLK to 2 0 times division and outputs the counter value at t1 shown in FIG. 10B to "0" to the EXNOR circuit 313a. To match the counter value "0" and the distance "0 00" corresponding to the most significant bit, a detection signal indicating "1" from the EXNOR circuit 313a is output to the AND circuit 313d, a counter coincidence detecting circuit DE 23 Buffer 23, the coincidence detection signal m 22 _1 (= 1) is output.

カウンタ一致検出回路DE23は、一致検出信号m22_1(=1)が入力されると、一致検出回路313において、最上位ビットに対応する分周器312dのカウンタ値と距離D23との一致の検出を開始する。図10Bに示すように、カウンタ一致検出回路DE23における分周器312dはクロック信号CLKを2回分周し、一致検出信号m22_1(=1)が入力されたタイミングでカウンタ値「0」をEXNOR回路313aに出力する。最上位ビットに対応するカウンタ値「0」と距離D2310」とは一致するため、EXNOR回路313aから「1」を示す検出信号がAND回路313dに出力され、マルチプレクサ314から有効ビット設定部40に一致検出信号m23_1(=1)が出力される。従って、検索開始から1クロック目で、参照データ2について一致検出信号m23_1(=1)が出力される。 When the coincidence detection signal m 22 _ 1 (= 1) is input to the counter coincidence detection circuit DE 23 , the coincidence detection circuit 313 matches the counter value of the frequency divider 312 d corresponding to the most significant bit with the distance D 23. Start detecting. As shown in FIG. 10B, the frequency divider 312d in the counter coincidence detecting circuit DE 23 was 2 0 times the frequency of the clock signal CLK, the counter value in the coincidence detection signal m 22 _1 (= 1) is input timing "0" Is output to the EXNOR circuit 313a. Since the counter value “0” corresponding to the most significant bit matches the distance D 230 10”, the detection signal indicating “1” is output from the EXNOR circuit 313a to the AND circuit 313d, and the effective bit is set from the multiplexer 314. The coincidence detection signal m 23 _ 1 (= 1) is output to the unit 40. Accordingly, the coincidence detection signal m 23 _1 (= 1) is output for the reference data 2 at the first clock from the start of the search.

有効ビット設定部40は、距離/クロック数変換回路DEから最上位ビットに対する一致検出信号m23_1(=1)が入力されると、検索開始から2クロック目に、最上位から2番目のビットを示すBAS信号(BAS<1>=0,BAS<2>=1,BAS<3>=0)を、距離/クロック数変換回路DEとDEにおける各カウンタ一致検出回路に入力する。これにより、検出対象のビットが上位2ビットまで拡張される。また、有効ビット設定部40は、CLK_ACT信号(=0)をAND回路6に出力し、距離/クロック数変換回路DEとDEにクロック信号CLKが入力されないようにする。 When the coincidence detection signal m 23 _ 1 (= 1) for the most significant bit is input from the distance / clock number conversion circuit DE 2 , the valid bit setting unit 40 receives the second bit from the most significant bit at the second clock from the search start. the BAS signal indicating a bit (BAS <1> = 0, BAS <2> = 1, BAS <3> = 0), is input to the counter match detecting circuit in the distance / clock number conversion circuit DE 1 and DE 2. As a result, the detection target bits are expanded to the upper 2 bits. The valid bit setting unit 40 outputs the CLK_ACT signal (= 0) to the AND circuit 6 so that the clock signal CLK is not input to the distance / clock number conversion circuits DE 1 and DE 2 .

カウンタ一致検出回路DE11とDE21は、それぞれのカウンタ312において、最上位から2番目のビットに対応するセレクタ312bにBAS信号(BAS<2>=1)が入力されると、一致検出回路313において、上位2ビットのカウンタ値と距離との一致を検出する。 When the counter match detection circuits DE 11 and DE 21 receive the BAS signal (BAS <2> = 1) in the respective counters 312, the BAS signal (BAS <2> = 1) is input to the selector 312 b corresponding to the second most significant bit. , A match between the counter value of the upper 2 bits and the distance is detected.

BAS信号(BAS<2>=1)が入力されると、図10Cに示すように、カウンタ一致検出回路DE11における分周器312e,312dは、クロック信号CLKを2,2回それぞれ分周して2ビットのカウンタ値を出力する。検索開始から1クロック目に、カウンタ一致検出回路DE11における分周器312dのカウンタ値「1」と距離D1101」とが一致している。そのため、カウンタ一致検出回路DE11の分周器312d,312eは、図10Cに示すt1におけるカウンタ値「10」のビット値「1」,「0」をEXNOR回路313a,313bにそれぞれ出力する。つまり、距離「4」の検索が打ち消されたことになる。上位2ビットに対応するカウンタ値「10」と距離D11101」とは一致するため、EXNOR回路313a,313bからAND回路313d,313eに「1」を示す検出信号がそれぞれ出力され、EXNOR回路313aとAND回路313dからマルチプレクサ314に、一致検出信号m11_1(=1),m11_2(=1)がそれぞれ出力される。そして、マルチプレクサ314からカウンタ一致検出回路DE12とバッファ22に、一致検出信号m11_2(=1)が出力される。 When BAS signal (BAS <2> = 1) is input, as shown in FIG. 10C, the frequency divider 312e in the counter coincidence detecting circuit DE 11, 312d are 2 0, 2 1 times each minute the clock signal CLK Rotate and output a 2-bit counter value. At the first clock from the start of the search, the counter value “1” of the frequency divider 312d in the counter coincidence detection circuit DE 11 and the distance D 111 01” coincide. Therefore, the frequency divider 312d, 312e of the counter match detection circuit DE 11, the counter value in t1 shown in FIG. 10C-bit value "10", "1", and outputs the "0" EXNOR circuit 313a, in 313b. That is, the search for the distance “4” is cancelled. Since the counter value “10” corresponding to the upper 2 bits matches the distance D 1110 1”, the EXNOR circuits 313a and 313b output detection signals indicating “1” to the AND circuits 313d and 313e, respectively, and EXNOR The coincidence detection signals m 11 _1 (= 1) and m 11 _2 (= 1) are output from the circuit 313a and the AND circuit 313d to the multiplexer 314, respectively. Then, the coincidence detection signal m 11 _2 (= 1) is output from the multiplexer 314 to the counter coincidence detection circuit DE 12 and the buffer 22.

カウンタ一致検出回路DE12は、一致検出信号m11_2(=1)が入力されると、一致検出回路313において、上位2ビットのカウンタ値と距離D12との一致の検出を開始する。BAS信号(BAS<2>=1)が入力されると、図10Cに示すように、カウンタ一致検出回路DE12における分周器312e,312dは、クロック信号CLKを2,2回それぞれ分周して2ビットのカウンタ値を出力する。図10Cに示すように、t1におけるカウンタ一致検出回路DE12の分周器312d,312eのカウンタ値「00」のビット値「0」,「0」がEXNOR回路313a,313bにそれぞれ出力される。上位2ビットに対応するカウンタ値「00」と距離D12100」とは一致しないため、EXNOR回路313a,313bからAND回路313dにそれぞれ「0」,「1」を示す検出信号が出力され、一致検出信号m12_2(=0)がマルチプレクサ314からカウンタ一致検出回路DE13とバッファ23に出力される。 When the coincidence detection signal m 11 _2 (= 1) is input, the counter coincidence detection circuit DE 12 starts the coincidence detection between the upper 2-bit counter value and the distance D 12 in the coincidence detection circuit 313. When BAS signal (BAS <2> = 1) is input, as shown in FIG. 10C, the frequency divider 312e in the counter coincidence detector DE 12, 312d are 2 0, 2 1 times each minute the clock signal CLK Rotate and output a 2-bit counter value. As shown in FIG. 10C, the bit values “0” and “0” of the counter values “00” of the frequency dividers 312d and 312e of the counter match detection circuit DE 12 at t1 are output to the EXNOR circuits 313a and 313b, respectively. Since the counter value “00” corresponding to the upper 2 bits does not match the distance D 1210 0”, detection signals indicating “0” and “1” are output from the EXNOR circuits 313a and 313b to the AND circuit 313d, respectively. The coincidence detection signal m 12 _ 2 (= 0) is output from the multiplexer 314 to the counter coincidence detection circuit DE 13 and the buffer 23.

カウンタ一致検出回路DE21における分周器312e,312dは、BAS信号(BAS<2>=1)が入力されると、図10Cに示すように、クロック信号CLKをそれぞれ2,2回分周して2ビットのカウンタ値を出力する。検索開始から1クロック目に、カウンタ一致検出回路DE21における分周器312dのカウンタ値「1」と距離「11」とが一致している。そのため、カウンタ一致検出回路DE21の分周器312d,312eは、図10Cに示すt1におけるカウンタ値「10」のビット値「1」,「0」をEXNOR回路313a,313bにそれぞれ出力する。つまり、距離「2」の検索が打ち消されたことになる。上位2ビットに対応するカウンタ値「10」と距離D21111」とは一致しないため、EXNOR回路313a,313bからAND回路313dに「1」,「0」を示す検出信号がそれぞれ出力され、マルチプレクサ314からカウンタ一致検出回路DE22とバッファ22に、一致検出信号m21_2(=0)が出力される。 Divider 312e in the counter coincidence detection circuit DE 21, 312d, when BAS signal (BAS <2> = 1) is input, as shown in FIG. 10C, 2 a clock signal CLK respectively 0, 2 1 times the circumferential The 2-bit counter value is output. At the first clock from the search start, the counter value “1” of the frequency divider 312d in the counter coincidence detection circuit DE 21 matches the distance “ 1 11”. Therefore, the frequency dividers 312d and 312e of the counter coincidence detection circuit DE 21 output the bit values “1” and “0” of the counter value “10” at t1 illustrated in FIG. 10C to the EXNOR circuits 313a and 313b, respectively. That is, the search for the distance “2” is cancelled. Since the counter value “10” corresponding to the upper 2 bits and the distance D 2111 1” do not match, detection signals indicating “1” and “0” are output from the EXNOR circuits 313a and 313b to the AND circuit 313d, respectively. The multiplexer 314 outputs the coincidence detection signal m 21 _ 2 (= 0) to the counter coincidence detection circuit DE 22 and the buffer 22.

有効ビット設定部40は、2クロック目において、カウンタ一致検出回路DE、DEの最上位から2番目のビットに対応する一致検出信号(m13_2,m23_2)はいずれも立ち上がっていないため、AND回路6にCLK_ACT信号(=1)を入力して、距離/クロック数変換回路DEとDEにクロック信号CLKが入力されるようにする。 In the valid bit setting unit 40, none of the coincidence detection signals (m 13 _2 and m 23 _2) corresponding to the second most significant bit of the counter coincidence detection circuits DE 1 and DE 2 rises at the second clock. Therefore, by entering the CLK_ACT signal (= 1) to the aND circuit 6, the distance / clock number conversion circuit DE 1 and DE 2 so that the clock signal CLK is input.

カウンタ一致検出回路DE11において、上位2ビットについて一致検出信号m11_2(=1)が検索開始から2クロック目に出力されている。そのため、検索開始から3クロック目では、カウンタ一致検出回路DE11において一致検出の動作を停止する。 In the counter coincidence detection circuit DE 11 , the coincidence detection signal m 11 _2 (= 1) is output at the second clock from the start of the search for the upper 2 bits. Therefore, in the third clock from the search start, to stop the operation of the coincidence detection in the counter coincidence detection circuit DE 11.

カウンタ一致検出回路DE12は、検索開始から3クロック目に、セレクタ312bを介してクロック信号CLKが入力されると、分周器312d,312eは、図10Cに示すt2におけるカウンタ値「01」のビット値「0」,「1」をEXNOR回路313a,313bにそれぞれ出力する。上位2ビットのカウンタ値「01」と距離D12100」とは一致しない。そのため、カウンタ一致検出回路DE12において、カウンタ一致検出回路DE13とバッファ23に一致検出信号m12_2(=0)が出力される。 Counter match detection circuit DE 12 is the third clock from the search start, when the clock signal CLK via a selector 312b is input, the frequency divider 312d, 312e is, the counter value in t2 shown in FIG. 10C "01" Bit values “0” and “1” are output to the EXNOR circuits 313a and 313b, respectively. The counter value “01” of the upper 2 bits does not match the distance D 1210 0”. Therefore, in the counter coincidence detection circuit DE 12 , the coincidence detection signal m 12 _ 2 (= 0) is output to the counter coincidence detection circuit DE 13 and the buffer 23.

カウンタ一致検出回路DE21も同様に、検索開始から3クロック目に、セレクタ312bを介してクロック信号CLKが入力されると、分周器312d,312eは、図10Cに示すt2におけるカウンタ値「11」のビット値「1」,「1」をEXNOR回路313a,313bにそれぞれ出力する。上位2ビットのカウンタ値「11」と距離D21111」とは一致する。そのため、カウンタ一致検出回路DE21において、マルチプレクサ314からカウンタ一致検出回路DE22とバッファ22に一致検出信号m21_2(=1)が出力される。 Likewise counter match detection circuit DE 21, the third clock from the search start, when the clock signal CLK via a selector 312b is input, the frequency divider 312d, 312e is, the counter value in t2 shown in FIG. 10C "11 "1" and "1" are output to the EXNOR circuits 313a and 313b, respectively. The counter value “11” of the upper 2 bits matches the distance D 2111 1”. Therefore, in the counter coincidence detection circuit DE 21 , the coincidence detection signal m 21 _2 (= 1) is output from the multiplexer 314 to the counter coincidence detection circuit DE 22 and the buffer 22.

カウンタ一致検出回路DE22は、一致検出信号m21_2(=1)が入力されると、一致検出回路313において、上位2ビットのカウンタ値と距離D22との一致の検出を開始する。図10Cに示すように、カウンタ一致検出回路DE22における分周器312e,312dは、t2におけるカウンタ値「00」のビット値「0」,「0」をEXNOR回路313a,313bにそれぞれ出力する。上位2ビットに対応するカウンタ値「00」と距離D22000」とは一致する。そのため、カウンタ一致検出回路DE22において、マルチプレクサ314からカウンタ一致検出回路DE23とバッファ23に一致検出信号m22_2(=1)が出力される。 When the coincidence detection signal m 21 _2 (= 1) is input to the counter coincidence detection circuit DE 22 , the coincidence detection circuit 313 starts detecting coincidence between the counter value of the upper 2 bits and the distance D 22 . As shown in FIG. 10C, the frequency divider in the counter coincidence detector DE 22 312e, 312d, the counter value at t2 bit value of "00", "0", and outputs the "0" EXNOR circuit 313a, in 313b. The counter value “00” corresponding to the upper 2 bits matches the distance D 2200 0”. For this reason, in the counter coincidence detection circuit DE 22 , the coincidence detection signal m 22 _2 (= 1) is output from the multiplexer 314 to the counter coincidence detection circuit DE 23 and the buffer 23.

カウンタ一致検出回路DE23は、一致検出信号m22_2(=1)が入力されると、上位2ビットのカウンタ値と距離D23との一致の検出を開始する。図10Cに示すように、カウンタ一致検出回路DE23における分周器312e,312dは、t2におけるカウンタ値「00」のビット値「0」,「0」をEXNOR回路313a,313bにそれぞれ出力する。上位2ビットに対応するカウンタ値「00」と距離D23010」とは一致しない。そのため、カウンタ一致検出回路DE23において、マルチプレクサ314から有効ビット設定部40に一致検出信号m23_2(=0)が出力される。 When the coincidence detection signal m 22 _2 (= 1) is input, the counter coincidence detection circuit DE 23 starts to detect coincidence between the counter value of the upper 2 bits and the distance D 23 . As shown in FIG. 10C, the frequency divider in the counter coincidence detecting circuit DE 23 312e, 312d, the counter value at t2 bit value of "00", "0", and outputs the "0" EXNOR circuit 313a, in 313b. The counter value “00” corresponding to the upper 2 bits does not match the distance D 2301 0”. For this reason, in the counter match detection circuit DE 23 , the match detection signal m 23 _ 2 (= 0) is output from the multiplexer 314 to the valid bit setting unit 40.

3クロック目おいて、距離/クロック数変換回路DEとDEのいずれも最上位から2番目のビットに対応する一致検出信号(m13_2,m23_2)が立ち上がっていない。そのため、4クロック目においても有効ビット設定部40からAND回路6にCLK_ACT信号(=1)が入力される。 In the third clock, neither of the distance / clock number conversion circuits DE 1 and DE 2 has a coincidence detection signal (m 13 _2, m 23 _2) corresponding to the second most significant bit. Therefore, the CLK_ACT signal (= 1) is input from the valid bit setting unit 40 to the AND circuit 6 even at the fourth clock.

カウンタ一致検出回路DE11において、上位2ビットについて一致検出信号m11_2(=1)が検索開始から2クロック目に出力されているため、4クロック目においても一致検出の動作を停止する。 In the counter coincidence detection circuit DE 11, since the upper 2 coincidence detection signal for bit m 11 _2 (= 1) is output to the second clock from the search start, also stops the operation of the coincidence detection in the fourth clock.

カウンタ一致検出回路DE12は、検索開始から4クロック目に、セレクタ312bを介してクロック信号CLKが入力されると、分周器312d,312eは、図10Cに示すt3におけるカウンタ値「10」のビット値「1」,「0」をEXNOR回路313a,313bにそれぞれ出力する。上位2ビットのカウンタ値「10」と距離D12100」とは一致する。そのため、カウンタ一致検出回路DE12において、カウンタ一致検出回路DE13とバッファ23に一致検出信号m12_2(=1)が出力される。 Counter match detection circuit DE 12 is the fourth clock from the search start, when the clock signal CLK via a selector 312b is input, the frequency divider 312d, 312e is, the counter value in t3 shown in FIG. 10C "10" Bit values “1” and “0” are output to the EXNOR circuits 313a and 313b, respectively. The counter value “10” of the upper 2 bits matches the distance D 1210 0”. Therefore, in the counter coincidence detection circuit DE 12 , the coincidence detection signal m 12 _2 (= 1) is output to the counter coincidence detection circuit DE 13 and the buffer 23.

カウンタ一致検出回路DE13は、一致検出信号m12_2(=1)が入力されると、一致検出回路313において、上位2ビットのカウンタ値と距離D13との一致の検出を開始する。図10Cに示すように、カウンタ一致検出回路DE13における分周器312e,312dは、t3におけるカウンタ値「00」のビット値「0」,「0」をEXNOR回路313a,313bにそれぞれ出力する。上位2ビットに対応するカウンタ値「00」と距離D13011」とは一致しない。そのため、カウンタ一致検出回路DE13において、マルチプレクサ314から有効ビット設定部40に一致検出信号m13_2(=0)が出力される。 When the coincidence detection signal m 12 _2 (= 1) is input, the counter coincidence detection circuit DE 13 starts the coincidence detection between the upper 2-bit counter value and the distance D 13 in the coincidence detection circuit 313. As shown in FIG. 10C, the frequency divider 312e, 312d in the counter coincidence detecting circuit DE 13, the counter value at t3 bit value of "00", "0", and outputs the "0" EXNOR circuit 313a, in 313b. The counter value “00” corresponding to the upper 2 bits does not match the distance D 1301 1”. Therefore, in the counter coincidence detection circuit DE 13 , the coincidence detection signal m 13 _ 2 (= 0) is output from the multiplexer 314 to the valid bit setting unit 40.

一方、カウンタ一致検出回路DE21,DE22において、上位2ビットについての一致検出信号m21_2,m22_2(=1)が検索開始から2クロック,3クロック目にそれぞれ出力されているため、4クロック目ではカウンタ一致検出回路DE21,DE22は一致検出の動作を停止する。 On the other hand, in the counter coincidence detection circuits DE 21 and DE 22 , the coincidence detection signals m 21 _2 and m 22 _2 (= 1) for the upper 2 bits are output at the second clock and the third clock from the search start, respectively. At the fourth clock, the counter coincidence detection circuits DE 21 and DE 22 stop the coincidence detection operation.

カウンタ一致検出回路DE23は、検索開始から4クロック目に、セレクタ312bを介してクロック信号CLKが入力されると、分周器312d,312eは、図10Cに示すt3におけるカウンタ値「01」のビット値「0」,「1」をEXNOR回路313a,313bにそれぞれ出力する。上位2ビットのカウンタ値「01」と距離D23010」とが一致するため、マルチプレクサ314から有効ビット設定部40に一致検出信号m23_2(=1)が出力される。 Counter match detection circuit DE 23 is the fourth clock from the search start, when the clock signal CLK via a selector 312b is input, the frequency divider 312d, 312e is, the counter value in t3 shown in FIG. 10C "01" Bit values “0” and “1” are output to the EXNOR circuits 313a and 313b, respectively. Since the counter value “01” of the upper 2 bits matches the distance D 2301 0”, the match detection signal m 23 _2 (= 1) is output from the multiplexer 314 to the valid bit setting unit 40.

有効ビット設定部40は、4クロック目において、最上位から2番目のビットに対する一致検出信号m23_2(=1)が距離/クロック数変換回路DEから入力されると、検索開始から5クロック目に、最下位ビットを示すBAS信号(BAS<1>=0,BAS<2>=0,BAS<3>=1)を、距離/クロック数変換回路DEとDEにおける各カウンタ一致検出回路に入力する。これにより、一致検出の対象ビットは、最上位ビットから最下位ビットまで拡張される。また、有効ビット設定部40は、CLK_ACT信号(=0)をAND回路6に入力し、距離/クロック数変換回路DEとDEにクロック信号CLKが入力されないようにする。 When the coincidence detection signal m 23 _2 (= 1) for the second bit from the most significant bit is input from the distance / clock number conversion circuit DE 2 at the fourth clock, the valid bit setting unit 40 receives five clocks from the start of the search. eyes, BAS signal indicating the least significant bit (BAS <1> = 0, BAS <2> = 0, BAS <3> = 1) , and the counters match detection at a distance / clock number conversion circuit DE 1 and DE 2 Input to the circuit. As a result, the bit subject to coincidence detection is expanded from the most significant bit to the least significant bit. The valid bit setting unit 40 inputs the CLK_ACT signal (= 0) to the AND circuit 6 so that the clock signal CLK is not input to the distance / clock number conversion circuits DE 1 and DE 2 .

カウンタ一致検出回路DE11とDE21は、検索開始から5クロック目に、それぞれのカウンタ312において、最下位のビットに対応するセレクタ312cにBAS信号(BAS<3>=1)が入力されると、一致検出回路313において、全てのビットのカウンタ値と距離との一致を検出する。 When the counter coincidence detection circuits DE 11 and DE 21 receive the BAS signal (BAS <3> = 1) in the respective counters 312, the selector 312c corresponding to the least significant bit is input at the fifth clock from the start of the search. The coincidence detection circuit 313 detects coincidence between the counter values of all bits and the distance.

カウンタ一致検出回路DE11における分周器312f,312e,313dは、BAS信号(BAS<3>=1)が入力されると、図10Dに示すように、クロック信号CLKを2,2,2回それぞれ分周して3ビットのカウンタ値を出力する。検索開始から2クロック目に、カウンタ一致検出回路DE11における分周器312d,312eのカウンタ値「10」と距離D11101」とが一致している。そのため、カウンタ一致検出回路DE11の分周器312d,312e,312fは、図10Dに示すt3におけるカウンタ値「100」のビット値「1」,「0」,「0」をEXNOR回路313a,313b,313cにそれぞれ出力する。つまり、距離「4」の検索が打ち消されたことになる。全ビットに対応するカウンタ値「100」と距離D11101」とは一致しないため、EXNOR回路313a,313bからAND回路313dに「1」,「1」を示す検出信号がそれぞれ出力され、EXNOR回路313cからAND回路313eに「0」を示す検出信号が出力される。そして、マルチプレクサ314からカウンタ一致検出回路DE12とバッファ22に、一致検出信号m11_3(=0)が出力される。 Counter match detection circuit DE divider in 11 312f, 312e, 313d, when BAS signal (BAS <3> = 1) is input, as shown in FIG. 10D, the clock signal CLK 2 0, 2 1, 2 twice in each division and outputs a 3-bit counter value. At the second clock from the start of search, the counter value “10” of the frequency dividers 312d and 312e in the counter coincidence detection circuit DE 11 and the distance D 1110 1” coincide. Therefore, the frequency divider 312d of counter match detection circuit DE 11, 312e, 312f, the counter value in t3 shown in FIG. 10D bit value of "100", "1", "0", "0" EXNOR circuit 313a, 313b , 313c. That is, the search for the distance “4” is cancelled. Since the counter value “100” corresponding to all bits and the distance D 11101 ” do not match, detection signals indicating “1” and “1” are output from the EXNOR circuits 313a and 313b to the AND circuit 313d, respectively, and EXNOR A detection signal indicating “0” is output from the circuit 313c to the AND circuit 313e. Then, the coincidence detection signal m 11 — 3 (= 0) is output from the multiplexer 314 to the counter coincidence detection circuit DE 12 and the buffer 22.

カウンタ一致検出回路DE21における分周器312f,312e,313dは、BAS信号(BAS<3>=1)が入力されると、図10Dに示すように、クロック信号CLKを2,2,2回それぞれ分周して3ビットのカウンタ値を出力する。検索開始から3クロック目に、カウンタ一致検出回路DE21における分周器312d,312eのカウンタ値「11」と距離D21111」とが一致している。そのため、カウンタ一致検出回路DE11の分周器312d,312e,312fは、図10Dに示すt5におけるのカウンタ値「110」のビット値「1」,「1」,「0」をEXNOR回路313a,313b,313cにそれぞれ出力する。つまり、距離「6」の検索が打ち消されたことになる。全ビットに対応するカウンタ値「110」と距離D21111」とは一致しないため、EXNOR回路313a,313bからAND回路313dに「1」,「1」を示す検出信号がそれぞれ出力され、EXNOR回路313cからAND回路313eに「0」を示す検出信号が出力される。そして、マルチプレクサ314からカウンタ一致検出回路DE22とバッファ22に、一致検出信号m21_3(=0)が出力される。 When the BAS signal (BAS <3> = 1) is input to the frequency dividers 312f, 312e, and 313d in the counter coincidence detection circuit DE 21 , as shown in FIG. 10D, the clock signal CLK is changed to 2 0 , 2 1 , 2 twice in each division and outputs a 3-bit counter value. At the third clock from the start of the search, the counter value “11” of the frequency dividers 312d and 312e in the counter coincidence detection circuit DE 21 matches the distance D 2111 1”. Therefore, the frequency divider 312d of counter match detection circuit DE 11, 312e, 312f, the counter value of the t5 shown in FIG. 10D bit value of "110", "1", "1", "0" EXNOR circuit 313a, It outputs to 313b and 313c, respectively. That is, the search for the distance “6” is cancelled. Since the counter value “110” corresponding to all bits and the distance D 21111 ” do not match, detection signals indicating “1” and “1” are output from the EXNOR circuits 313a and 313b to the AND circuit 313d, respectively, and EXNOR A detection signal indicating “0” is output from the circuit 313c to the AND circuit 313e. Then, the coincidence detection signal m 21 — 3 (= 0) is output from the multiplexer 314 to the counter coincidence detection circuit DE 22 and the buffer 22.

検索開始から5クロック目において、カウンタ一致検出回路DE11とDE21のいずれも最下位ビットのカウンタ値と距離とが一致しないため、カウンタ一致検出回路DE11とDE21においてクロック信号CLKが入力される。 Since the counter match detection circuits DE 11 and DE 21 do not match the counter value of the least significant bit and the distance at the fifth clock from the start of the search, the counter match detection circuits DE 11 and DE 21 receive the clock signal CLK. The

カウンタ一致検出回路DE11は、検索開始から6クロック目に、セレクタ312bを介してクロック信号CLKが入力されると、分周器312d,312e,312fは、図10Dに示すt4におけるカウンタ値「101」のビット値「1」,「0」,「1」をEXNOR回路313a,313b,313cにそれぞれ出力する。全ビットのカウンタ値「101」と距離D11101」とが一致するため、カウンタ一致検出回路DE11において、カウンタ一致検出回路DE12とバッファ22に一致検出信号m11_3(=1)が出力される。 Counter match detection circuit DE 11 is the sixth clock from the search start, when the clock signal CLK via a selector 312b is input, the frequency divider 312d, 312e, 312f, the counter value in t4 shown in FIG. 10D "101 Are output to the EXNOR circuits 313a, 313b, and 313c, respectively. Since the counter value “101” of all bits coincides with the distance D 11101 ”, the counter coincidence detection circuit DE 11 receives the coincidence detection signal m 11 — 3 (= 1) in the counter coincidence detection circuit DE 12 and the buffer 22. Is output.

カウンタ一致検出回路DE12は、一致検出信号m11_3(=1)が入力されると、一致検出回路313において、全てのビットのカウンタ値と距離との一致を検出する。検索開始から4クロック目に、カウンタ一致検出回路DE12における分周器312d,312e,312fのカウンタ値「10」と距離D11100」とが一致している。そのため、カウンタ一致検出回路DE12の分周器312d,312e,312fは、図10Dに示すt4におけるカウンタ値「100」のビット値「1」,「0」,「0」をEXNOR回路313a,313b,313cにそれぞれ出力する。全ビットのカウンタ値「100」と距離D12100」とが一致するため、カウンタ一致検出回路DE12において、カウンタ一致検出回路DE13とバッファ23に一致検出信号m12_3(=1)が出力される。 When the coincidence detection signal m 11 — 3 (= 1) is input to the counter coincidence detection circuit DE 12 , the coincidence detection circuit 313 detects coincidence between the counter values of all bits and the distance. From the search start the fourth clock, a frequency divider 312d in the counter coincidence detector DE 12, 312e, the counter value of 312f "10" and the distance D 11 "10 0" and the match. Therefore, the frequency divider 312d of counter match detection circuit DE 12, 312e, 312f, the counter value in t4 shown in FIG. 10D bit value of "100", "1", "0", "0" EXNOR circuit 313a, 313b , 313c. Since the counter value of all the bits "100" distance D 12 and "100" match, the counter match detection circuit DE 12, the coincidence detection signal to the counter coincidence detection circuit DE 13 and the buffer 23 m 12 _3 (= 1) is Is output.

カウンタ一致検出回路DE13は、一致検出信号m12_3(=1)が入力されると、一致検出回路313において、全てのビットのカウンタ値と距離との一致の検出を開始する。カウンタ一致検出回路DE13の分周器312d,312e,312fは、図10Dに示すt4におけるカウンタ値「000」のビット値「0」,「0」,「0」をEXNOR回路313a,313b,313cにそれぞれ出力する。全ビットのカウンタ値「000」と距離D13011」とは一致しないため、カウンタ一致検出回路DE13において、有効ビット設定部40に一致検出信号m13_3(=0)が出力される。 When the coincidence detection signal m 12 — 3 (= 1) is input, the counter coincidence detection circuit DE 13 starts the coincidence detection circuit 313 to detect coincidence between the counter values of all bits and the distance. Divider 312d of counter match detection circuit DE 13, 312e, 312f, the bit value "0" of the counter value "000" in the t4 shown in FIG. 10D, "0", "0" EXNOR circuit 313a, 313b, 313c Respectively. Since the counter value “000” of all bits does not match the distance D 13011 ”, the match detection signal m 13 — 3 (= 0) is output to the valid bit setting unit 40 in the counter match detection circuit DE 13 .

一方、カウンタ一致検出回路DE21は、検索開始から6クロック目に、セレクタ312cを介してクロック信号CLKが入力されると、分周器312d,312e,312fは、図10Dに示すt6におけるカウンタ値「111」のビット値「1」,「1」,「1」をEXNOR回路313a,313b,313cにそれぞれ出力する。全ビットのカウンタ値「111」と距離D21111」とは一致するため、カウンタ一致検出回路DE21において、カウンタ一致検出回路DE22とバッファ22に一致検出信号m21_3(=1)が出力される。 On the other hand, the counter match detection circuit DE 21 is the sixth clock from the search start, when the clock signal CLK via the selector 312c is input, the frequency divider 312d, 312e, 312f, the counter value in t6 shown in FIG. 10D Bit values “1”, “1”, and “1” of “111” are output to the EXNOR circuits 313a, 313b, and 313c, respectively. Since the counter value “111” of all bits and the distance D 21111 ” coincide, the counter coincidence detection circuit DE 21 receives the coincidence detection signal m 21 _3 (= 1) in the counter coincidence detection circuit DE 22 and the buffer 22. Is output.

カウンタ一致検出回路DE22は、一致検出信号m21_3(=1)が入力されると、一致検出回路313において、全てのビットのカウンタ値と距離との一致の検出を開始する。検索開始から3クロック目に、カウンタ一致検出回路DE22における分周器312d,312eのカウンタ値「00」と距離D22000」とが一致している。そのため、カウンタ一致検出回路DE22の分周器312d,312e,312fは、図10Dに示すt6におけるカウンタ値「000」のビット値「0」,「0」,「0」をEXNOR回路313a,313b,313cにそれぞれ出力する。全ビットのカウンタ値「000」と距離D22000」とが一致するため、カウンタ一致検出回路DE22において、カウンタ一致検出回路DE23とバッファ23に一致検出信号m22_3(=1)が出力される。 When the coincidence detection signal m 21 — 3 (= 1) is input, the counter coincidence detection circuit DE 22 starts the coincidence detection circuit 313 to detect coincidence between the counter values of all bits and the distance. At the third clock from the start of the search, the counter values “00” of the frequency dividers 312d and 312e in the counter coincidence detection circuit DE 22 coincide with the distance D 2200 0”. Therefore, the frequency dividers 312d, 312e, and 312f of the counter coincidence detection circuit DE 22 change the bit values “0”, “0”, and “0” of the counter value “000” at t6 illustrated in FIG. 10D to the EXNOR circuits 313a and 313b. , 313c. Since the counter value of all the bits "000" and the distance D 22 "000" match, the counter match detection circuit DE 22, counter match detection circuit DE 23 and coincidence detection signal m 22 to the buffer 23 _3 (= 1) Is output.

カウンタ一致検出回路DE23は、一致検出信号m22_3(=1)が入力されると、一致検出回路313において、全てのビットのカウンタ値と距離との一致の検出を開始する。検索開始から4クロック目に、カウンタ一致検出回路DE23における分周器312d,312eのカウンタ値「01」と距離D23010」とが一致している。そのため、カウンタ一致検出回路DE23の分周器312d,312e,312fは、図10Dに示すt6におけるカウンタ値「010」のビット値「0」,「1」,「0」をEXNOR回路313a,313b,313cにそれぞれ出力する。全ビットのカウンタ値「010」と距離D23010」とが一致するため、カウンタ一致検出回路DE23において、有効ビット設定部40に一致検出信号m23_3(=1)が出力される。 When the coincidence detection signal m 22 — 3 (= 1) is input, the counter coincidence detection circuit DE 23 starts the coincidence detection circuit 313 to detect coincidence between the counter values of all bits and the distance. At the fourth clock from the start of the search, the counter values “01” of the frequency dividers 312d and 312e in the counter match detection circuit DE 23 and the distance D 2301 0” match. Therefore, the frequency dividers 312d, 312e, and 312f of the counter match detection circuit DE 23 change the bit values “0”, “1”, and “0” of the counter value “010” at t6 illustrated in FIG. 10D to the EXNOR circuits 313a and 313b. , 313c. Since the counter value “010” of all bits matches the distance D 23010 ”, the counter match detection circuit DE 23 outputs a match detection signal m 23 — 3 (= 1) to the valid bit setting unit 40.

有効ビット設定部40は、距離/クロック数変換回路DEから最下位ビットに対する一致検出信号m23_3(=1)を受けると、その一致検出信号を受けたタイミングで、距離/クロック数変換回路DEに対するタイミング信号CをWinner検出器20に出力する。 When the valid bit setting unit 40 receives the coincidence detection signal m 23 — 3 (= 1) for the least significant bit from the distance / clock number conversion circuit DE 2 , the valid bit setting unit 40 receives the coincidence detection signal at the timing of receiving the coincidence detection signal. a timing signal C 2 to the Winner detector 20 for DE 2.

このように、図10Aの例では、参照データ2について6クロックサイクルでタイミング信号Cが出力される。第1実施形態の方法を用いた場合には、参照データ2の場合、9クロックサイクル(=7+0+2)必要であったが、本実施形態の方法を用いると3クロックサイクル削減されている。 Thus, in the example of FIG. 10A, the timing signal C 2 for the reference data 2 in 6 clock cycles it is output. When the method of the first embodiment is used, 9 clock cycles (= 7 + 0 + 2) are required in the case of the reference data 2, but when the method of the present embodiment is used, 3 clock cycles are reduced.

一致検出回路313は、上位Jビット(1≦J≦N)について距離とカウンタ値との一致を検出した一致検出信号を出力する。下位からkビット目が一致検出の対象ビットとして設定されているとき、下位k−1ビットを無視した上位(N−(k−1))ビットの一致を示す一致検出信号を出力する。そのため、kビット目が対象ビットのときに全ての参照データについて一致検出信号が「0」であれば、全ての参照データは、距離2k−1以上の距離を持つことを意味する。この場合には、下位からkビット目のカウンタにクロック信号が入力されてカウントアップされる。これは、下位からkビット目が「1」になることを意味しており、1クロックサイクルで、距離2k−1が打ち消されたことに相当する。 The coincidence detection circuit 313 outputs a coincidence detection signal for detecting coincidence between the distance and the counter value for the upper J bits (1 ≦ J ≦ N). When the k-th bit from the lower order is set as a target bit for coincidence detection, a coincidence detection signal indicating a coincidence of upper (N- (k-1)) bits ignoring the lower k-1 bits is output. Therefore, if the coincidence detection signal is “0” for all reference data when the k-th bit is the target bit, it means that all the reference data has a distance of 2 k−1 or more. In this case, the clock signal is input to the counter of the k-th bit from the lower order and counted up. This means that the k-th bit from the lower order becomes “1”, which corresponds to the distance 2 k−1 being canceled in one clock cycle.

一方、いずれかの参照データについて出力された一致検出信号が「1」であれば、その参照データは、2k−1の距離がないことを意味する。この場合には、対象ビットを下位からk−1番目のビットに設定し、全ての参照データについて距離2k−2を順次打ち消す。 On the other hand, if the coincidence detection signal output for any of the reference data is “1”, it means that the reference data has no distance of 2 k−1 . In this case, the target bit is set to the (k−1) th bit from the lower order, and the distance 2 k−2 is sequentially canceled for all the reference data.

つまり、最上位ビットから任意のビット単位に一致の検出対象となるビットを拡張して、カウンタ値と距離との一致を検出することで、大きい距離を順次打ち消している。これにより、第1、第2実施形態における一つの参照データの最長検索時間が”M×2N−1×τCLK”であるのに対し、本実施形態では、”(M×N+N−1)×τCLK”に削減することが可能になる。 That is, by extending the bit to be detected as a match from the most significant bit to an arbitrary bit unit and detecting a match between the counter value and the distance, the large distance is sequentially canceled. Thereby, the longest search time of one reference data in the first and second embodiments is “M × 2 N−1 × τ CLK ”, whereas in this embodiment, “(M × N + N−1)”. × τ CLK ″ can be reduced.

<第4実施形態>
第1実施形態及び第2実施形態では、式(1)を用いて算出された検索データと参照データとの各距離をクロック数に変換する処理を、その距離に一致する回数だけ繰り返すことで、各距離の二乗値の和、つまり、ユークリッド距離の和に相当するクロック数に変換する例について説明した。本実施形態では、各距離演算回路(DP11,DP12,…DPRW)において、各距離の二乗値の演算を行い、演算された各距離の二乗値を、距離/クロック数変換回路(DC,DC,…DC)においてクロック数に変換する例について説明する。
<Fourth embodiment>
In the first embodiment and the second embodiment, by repeating the process of converting each distance between the search data and the reference data calculated using Expression (1) into the number of clocks, the number of times matches the distance, The example in which the sum is converted to the number of clocks corresponding to the sum of the square values of the distances, that is, the sum of the Euclidean distances, has been described. In the present embodiment, each distance calculation circuit (DP 11 , DP 12 ,... DP RW ) calculates the square value of each distance, and the calculated square value of each distance is converted into a distance / clock number conversion circuit (DC 1 , DC 2 ,... DC R ) will be described as an example of conversion to the number of clocks.

図11は、本実施形態における距離演算回路の構成例を示す概略構成図である。距離演算回路DPij(1≦i≦R,1≦j≦W)は、例えば、距離が4ビットで表される場合、つまり、M=4の場合に、演算回路61〜64を含む演算回路群60と、シフトレジスタ65と、乗数ビットシフト回路66とを有する。シフトレジスタ65は、3ビットのシフトレジスタであり、3つのフリップフロップ回路65a〜65cを直列に接続して構成されている。 FIG. 11 is a schematic configuration diagram illustrating a configuration example of the distance calculation circuit in the present embodiment. The distance calculation circuit DP ij (1 ≦ i ≦ R, 1 ≦ j ≦ W) includes, for example, calculation circuits 61 to 64 when the distance is expressed by 4 bits, that is, when M = 4. A group 60, a shift register 65, and a multiplier bit shift circuit 66 are included. The shift register 65 is a 3-bit shift register, and is configured by connecting three flip-flop circuits 65a to 65c in series.

図11の例において、演算回路61〜64とフリップフロップ回路65a〜65cは、この順に、最上位ビットから最下位ビット(全7ビット)に対応して並んでいる。演算回路61〜64には、それぞれ、参照データ(Re)を反転させた反転参照データ(ReSQ)と、検索データ(In)の各ビットの値が入力される。なお、Sは1≦S≦4を満たす整数である。 In the example of FIG. 11, the arithmetic circuits 61 to 64 and the flip-flop circuits 65a to 65c are arranged in this order from the most significant bit to the least significant bit (all 7 bits). The arithmetic circuit 61 to 64, respectively, and the reference data (Re S) inverting the reference data obtained by inverting the (Re SQ), the value of each bit of the search data (an In S) is input. S is an integer satisfying 1 ≦ S ≦ 4.

演算回路61〜64は、制御回路(図示せず)から入力される二乗計算制御信号SQの信号値が「0」である場合、入力される反転参照データと検索データの絶対値差(AD,AD,AD,AD)を算出する。つまり、この場合には、演算回路61〜64は減算器として機能する。 When the signal value of the square calculation control signal SQ input from the control circuit (not shown) is “0”, the arithmetic circuits 61 to 64 have an absolute value difference (AD 1 ) between the input inverted reference data and the search data. , AD 2 , AD 3 , AD 4 ). That is, in this case, the arithmetic circuits 61 to 64 function as a subtracter.

また、制御回路(図示せず)から入力される二乗計算制御信号SQの信号値が「1」である場合、演算回路61〜64は、加算器として機能する。つまり、演算回路61は、入力される後述の被加算値M1と、シフト演算値TEとを加算し、加算結果を、シフト演算値TEとして演算回路62に出力する。演算回路62は、入力される被加算値M2と、演算回路61から入力されるシフト演算値TEとを加算し、加算結果を、シフト演算値TEとして演算回路63に出力する。演算回路63は、入力される被加算値M3と、演算回路62から入力されるシフト演算値TEとを加算し、加算結果を、シフト演算値TEとして演算回路64に出力する。演算回路64は、入力される被加算値M4と、演算回路63から入力されるシフト演算値TEとを加算し、加算結果を、シフト演算値TEとしてシフトレジスタ65のフリップフロップ回路65aに出力する。 When the signal value of the square calculation control signal SQ input from the control circuit (not shown) is “1”, the arithmetic circuits 61 to 64 function as adders. That is, the arithmetic circuit 61, the augend value M1 which will be described later is input, adds the shift operation value TE 0, and outputs the addition result as the shift operation value TE 1 to the arithmetic circuit 62. Arithmetic circuit 62, the augend M2 inputted, adds the shift operation value TE 1 inputted from the arithmetic circuit 61, and outputs the addition result as the shift operation value TE 2 to the arithmetic circuit 63. Arithmetic circuit 63, the augend M3 input, adds the shift operation value TE 2 inputted from the arithmetic circuit 62, and outputs the addition result as the shift operation value TE 3 to the arithmetic circuit 64. Arithmetic circuit 64, the augend M4 inputted, adds the shift operation value TE 3 inputted from the arithmetic circuit 63, the addition result, the flip-flop circuit 65a of the shift register 65 as the shift operation value TE 4 Output.

また、演算回路61〜64は、制御回路(図示せず)からマンハッタン距離(MD)又はユークリッド距離(ED)を示す制御信号を受ける。本実施形態において、マンハッタン距離(MD)の場合の信号値を「1」とし、ユークリッド距離(ED)の場合の信号値を「0」とする。演算回路61〜64は、制御信号に応じて上記絶対値差AD又は加算結果を示すDOUT(0≦k≦4)を距離/クロック数変換回路DCに出力する。 In addition, the arithmetic circuits 61 to 64 receive a control signal indicating a Manhattan distance (MD) or a Euclidean distance (ED) from a control circuit (not shown). In the present embodiment, the signal value in the case of the Manhattan distance (MD) is “1”, and the signal value in the case of the Euclidean distance (ED) is “0”. Arithmetic circuits 61 to 64 outputs DOUT k (0 ≦ k ≦ 4 ) indicating the absolute value difference AD S or sum above distance / clock number conversion circuit DC i in response to a control signal.

フリップフロップ回路65aは、演算回路64から入力されるシフト演算値TEを、クロック信号CLKに同期して、シフト演算値TEとしてフリップフロップ回路65bに出力するとともに、シフト演算値TEを示す出力値DOUTを距離/クロック数変換回路DCに出力する。 Flip-flop circuit 65a is a shift operation value TE 4 inputted from the arithmetic circuit 64, in synchronization with the clock signal CLK, and outputs to the flip-flop circuit 65b as the shift operation value TE 5, showing a shift operation value TE 5 It outputs an output value DOUT 5 distance / clock number conversion circuit DC i.

フリップフロップ回路65bは、フリップフロップ回路65aから入力されるシフト演算値TEを、クロック信号CLKに同期して、シフト演算値TEとしてフリップフロップ回路65cに出力するとともに、そのシフト演算値TEを示す出力値DOUTを距離/クロック数変換回路DCに出力する。 Flip-flop circuit 65b is a shift operation value TE 5 inputted from the flip-flop circuit 65a, in synchronization with the clock signal CLK, and outputs to the flip-flop circuit 65c as a shift operation value TE 6, the shift operation value TE 6 the outputs an output value DOUT 6 distance / clock number conversion circuit DC i shown.

フリップフロップ回路65cは、フリップフロップ回路65bから入力されるシフト演算値TEを、クロック信号CLKに同期して、シフト演算値TEを出力値DOUTとして距離/クロック数変換回路DCに出力する。 Flip-flop circuit 65c is output shift operation value TE 6 inputted from the flip-flop circuit 65b, in synchronization with the clock signal CLK, and the shift operation value TE 7 as an output value DOUT 7 to distance / clock number conversion circuit DC i To do.

つまり、二乗計算制御信号SQ(=1)が入力されると、演算回路61〜64においてシフト演算値TEを算出し、演算回路61〜64及びシフトレジスタ65において、1クロックごとに、各シフト演算値を下位方向に1ビットシフトさせる処理を行う。この処理は、二乗計算の終了を示す信号が制御回路(図示せず)から入力されるまで行われる。 That is, when the square calculation control signal SQ (= 1) is inputted, the arithmetic circuit calculates a shift operation value TE S at 61 to 64, the arithmetic circuit 61 to 64 and the shift register 65, every clock, each shift A process of shifting the calculated value by 1 bit in the lower direction is performed. This process is performed until a signal indicating the end of the square calculation is input from a control circuit (not shown).

ここで、演算回路61〜64の回路構成について説明する。図12は、演算回路61〜64の回路構成例を示す図である。図12の例において、演算回路61〜64は、マルチプレクサ71,72,78と、全加算器73と、Dフリップフロップ回路74と、反転制御回路75と、ラッチ回路76と、AND回路77とを有する。   Here, the circuit configuration of the arithmetic circuits 61 to 64 will be described. FIG. 12 is a diagram illustrating a circuit configuration example of the arithmetic circuits 61 to 64. In the example of FIG. 12, the arithmetic circuits 61 to 64 include multiplexers 71, 72, and 78, a full adder 73, a D flip-flop circuit 74, an inversion control circuit 75, a latch circuit 76, and an AND circuit 77. Have.

マルチプレクサ71は、検索データIn(Sは1≦S≦4を満たす整数)と、シフト演算値TES−1とを受ける。マルチプレクサ72は、参照データREを反転させた反転参照データReSQと、AND回路77から入力される被加算値Mとを受ける。 The multiplexer 71 receives the search data In S (S is an integer satisfying 1 ≦ S ≦ 4) and the shift operation value TE S−1 . Multiplexer 72 receives the reference data RE S inversion reference data Re SQ obtained by inverting, the augend M S inputted from the AND circuit 77.

マルチプレクサ71,72は、制御回路(図示せず)から二乗計算制御信号SQが入力される。本実施形態において、二乗計算制御信号SQの信号値が「1」の場合には、距離演算回路DPijにおいて、距離の二乗計算を行い、信号値が「0」である場合には距離演算回路DPijにおいて、参照データと検索データとの差の絶対値(絶対値差)を算出する。 The multiplexers 71 and 72 receive a square calculation control signal SQ from a control circuit (not shown). In the present embodiment, when the signal value of the square calculation control signal SQ is “1”, the distance calculation circuit DP ij performs a square calculation of the distance, and when the signal value is “0”, the distance calculation circuit In DP ij , the absolute value (absolute value difference) of the difference between the reference data and the search data is calculated.

マルチプレクサ71は、二乗計算制御信号SQの信号値が「0」の場合、検索データInを全加算器73に出力し、信号値が「1」の場合には、シフト演算値TES−1を全加算器73に出力する。マルチプレクサ72は、二乗計算制御信号SQの信号値が「0」の場合、反転参照データReSQを全加算器73に出力し、信号値が「1」の場合には、被加算値Mを全加算器73に出力する。 The multiplexer 71 outputs the search data In S to the full adder 73 when the signal value of the square calculation control signal SQ is “0”, and the shift operation value TE S−1 when the signal value is “1”. Is output to the full adder 73. The multiplexer 72 outputs the inverted reference data Re SQ to the full adder 73 when the signal value of the square calculation control signal SQ is “0”, and the added value M S when the signal value is “1”. Output to full adder 73.

全加算器73は、下位ビットからの桁上げ値を受ける端子CBと、上位ビットへ桁上げ値を出力する端子CN又はCAを有する。なお、演算回路64における端子CBは、下位ビットからの桁上げ値ではなく、演算回路61における桁上げ値が入力される。演算回路61は最上位ビットに対応するため、演算回路61における桁上げ値を端子CAから演算回路64へ出力する。 The full adder 73 has a terminal CB that receives the carry value from the lower bits and a terminal CN or CA 1 that outputs the carry value to the upper bits. Note that the terminal CB in the arithmetic circuit 64 receives the carry value in the arithmetic circuit 61 instead of the carry value from the lower bits. The arithmetic circuit 61 to correspond to the most significant bit, and outputs a carry value in the arithmetic circuit 61 from the terminal CA 1 to the arithmetic circuit 64.

また、演算回路64における端子CBは、AND回路64a(図11参照)と接続されている。AND回路64aには、制御回路(図示せず)からの制御信号(MD又はED)と、演算回路61の端子CAから出力される桁上げ値とが入力され、制御信号の信号値と桁上げ値の論理積を演算した結果を出力する。 The terminal CB in the arithmetic circuit 64 is connected to the AND circuit 64a (see FIG. 11). The AND circuit 64a, a control signal from a control circuit (not shown) and (MD or ED), the carry value output from the terminal CA 1 of the arithmetic circuit 61 is inputted, the signal value of the control signal and column The result of calculating the logical product of the raised values is output.

つまり、演算回路61〜64における全加算器73は、マルチプレクサ71から出力される検索データIn又はシフト演算値TES−1と、マルチプレクサ72から出力される反転参照データReSQ又は被加算値Mと、入力される桁上げ値とを加算する。以下、演算回路61〜64における全加算器73のより具体的な処理について説明する。 That is, the full adder 73 in the arithmetic circuits 61 to 64 includes the search data In S or the shift operation value TE S-1 output from the multiplexer 71 and the inverted reference data Re SQ or the added value M output from the multiplexer 72. S and the carry value to be input are added. Hereinafter, more specific processing of the full adder 73 in the arithmetic circuits 61 to 64 will be described.

演算回路61は、最上位ビットに対応するため、上位ビットにおけるシフト演算値がマルチプレクサ71に入力されない。そのため、演算回路61では、信号値「1」を示す二乗計算制御信号SQが制御回路(図示せず)から出力されると、シフト演算値TEとして「0」を入力する。従って、演算回路61における全加算器73は、マルチプレクサ72から出力される被加算値Mと、端子CBから入力される演算回路62の桁上げ値と、シフト演算値TE(=0)を加算し、加算結果をDフリップフロップ回路74に出力する。 Since the arithmetic circuit 61 corresponds to the most significant bit, the shift arithmetic value in the upper bit is not input to the multiplexer 71. Therefore, when the square calculation control signal SQ indicating the signal value “1” is output from the control circuit (not shown), the arithmetic circuit 61 inputs “0” as the shift arithmetic value TE 0 . Therefore, the full adder 73 in the arithmetic circuit 61 uses the added value M 1 output from the multiplexer 72, the carry value of the arithmetic circuit 62 input from the terminal CB, and the shift operation value TE 0 (= 0). Addition is performed, and the addition result is output to the D flip-flop circuit 74.

演算回路62,63における各全加算器73は、信号値「1」を示す二乗計算制御信号SQが制御回路から出力されると、それぞれ、マルチプレクサ72から出力される被加算値M,Mと、端子CBから入力される演算回路63,64の桁上げ値と、演算回路61,62から入力されるシフト演算値TE,TEを加算して、加算結果をDフリップフロップ回路74に出力する。 When the square calculation control signal SQ indicating the signal value “1” is output from the control circuit, the full adders 73 in the arithmetic circuits 62 and 63 are added values M 2 and M 3 output from the multiplexer 72, respectively. Then, the carry values of the arithmetic circuits 63 and 64 input from the terminal CB and the shift arithmetic values TE 1 and TE 2 input from the arithmetic circuits 61 and 62 are added, and the addition result is sent to the D flip-flop circuit 74. Output.

演算回路64における全加算器73は、信号値「1」を示す二乗計算制御信号SQが制御回路から出力されると、マルチプレクサ72から出力される被加算値Mと、端子CBを介してAND回路64aから入力される値と、演算回路63から入力されるシフト演算値TEとを加算して、加算結果をDフリップフロップ回路74に出力する。つまり、マンハッタン距離(MD)を示す制御信号(=1)がAND回路(図示せず)に入力され、演算回路61の端子CAからの桁上げ値「1」がAND回路(図示せず)に入力されると、演算回路64の端子CBに「1」が入力されて加算される。 When the square calculation control signal SQ indicating the signal value “1” is output from the control circuit, the full adder 73 in the arithmetic circuit 64 ANDs the added value M 4 output from the multiplexer 72 and the terminal CB. The value input from the circuit 64 a and the shift operation value TE 3 input from the arithmetic circuit 63 are added, and the addition result is output to the D flip-flop circuit 74. That is, a control signal (= 1) indicating the Manhattan distance (MD) is input to an AND circuit (not shown), and the carry value “1” from the terminal CA 1 of the arithmetic circuit 61 is an AND circuit (not shown). Then, “1” is input to the terminal CB of the arithmetic circuit 64 and added.

次に、演算回路61〜64における反転制御回路75は、演算回路61からの最上位ビットの桁上げ値を示す信号を受ける端子CAを有し、端子CAを介して入力される演算回路61の桁上げ値=「0」である場合には、全加算器73から出力された算出結果を反転し、反転した値(絶対値差AD)をラッチ回路76へ出力する。また、演算回路61の桁上げ値=「1」である場合には、全加算器73から出力された算出結果を反転せずにラッチ回路76へ出力する。 Next, the inversion control circuit 75 in the arithmetic circuit 61 to 64, has a terminal CA 2 receiving a signal indicating a carry value of the most significant bits from the arithmetic circuit 61, arithmetic circuit input via the terminal CA 2 When the carry value of 61 = “0”, the calculation result output from the full adder 73 is inverted, and the inverted value (absolute value difference AD S ) is output to the latch circuit 76. When the carry value of the arithmetic circuit 61 is “1”, the calculation result output from the full adder 73 is output to the latch circuit 76 without being inverted.

演算回路61〜64におけるラッチ回路76は、二乗計算制御信号SQを受ける。ラッチ回路76は、二乗計算制御信号SQの信号値が「0」から「1」になるタイミングで、反転制御回路75から出力された絶対値差(AD)を保存する。そして、AND回路77と乗数ビットシフト回路66とマルチプレクサ78にその絶対値差(AD)を出力する。 The latch circuit 76 in the arithmetic circuits 61 to 64 receives the square calculation control signal SQ. The latch circuit 76 stores the absolute value difference (AD S ) output from the inversion control circuit 75 at the timing when the signal value of the square calculation control signal SQ changes from “0” to “1”. Then, the absolute value difference (AD S ) is output to the AND circuit 77, the multiplier bit shift circuit 66, and the multiplexer 78.

演算回路61〜64におけるAND回路77は、乗数ビットシフト回路66から入力される乗数ビットMBと、ラッチ回路76から入力される絶対値差(AD)との論理積の値をマルチプレクサ72に出力する。 The AND circuit 77 in the arithmetic circuits 61 to 64 outputs a logical product value of the multiplier bit MB input from the multiplier bit shift circuit 66 and the absolute value difference (AD S ) input from the latch circuit 76 to the multiplexer 72. To do.

絶対値差ADが算出された後、制御回路(図示せず)により、演算回路61〜64におけるDフリップフロップ回路74にクロック信号CLKが入力される。演算回路61〜64におけるDフリップフロップ回路74は、クロック信号CLKのクロックが立ち上がるタイミングで、全加算器73から出力される加算結果を入力する。そして、クロックが立ち下がるタイミングで、その加算結果が、シフト演算値(TE)として、下位ビットの演算回路におけるマルチプレクサ71又はシフトレジスタ65に出力される。 After the absolute value difference AD S is calculated by the control circuit (not shown), the clock signal CLK is input to the D flip-flop circuit 74 in the arithmetic circuit 61 to 64. The D flip-flop circuit 74 in the arithmetic circuits 61 to 64 inputs the addition result output from the full adder 73 at the timing when the clock of the clock signal CLK rises. Then, at the timing when the clock falls, the addition result is output as a shift operation value (TE S ) to the multiplexer 71 or the shift register 65 in the lower bit arithmetic circuit.

演算回路61〜64におけるマルチプレクサ78は、制御回路(図示せず)からマンハッタン距離(MD)又はユークリッド距離(ED)を示す制御信号を受ける。例えば、この例において、マンハッタン距離(MD)の場合の信号値を「1」とし、ユークリッド距離(ED)の場合の信号値を「0」とする。マルチプレクサ78は、マンハッタン距離(MD)を示す制御信号(=1)が入力されると、演算回路61〜64における各ラッチ回路76から出力される算出結果(絶対値差AD)を出力する。また、マルチプレクサ78は、ユークリッド距離(ED)を示す制御信号(=0)が入力されると、演算回路61〜64における各Dフリップフロップ回路74から出力される算出結果(TE)を出力する。 The multiplexer 78 in the arithmetic circuits 61 to 64 receives a control signal indicating a Manhattan distance (MD) or a Euclidean distance (ED) from a control circuit (not shown). For example, in this example, the signal value in the case of Manhattan distance (MD) is “1”, and the signal value in the case of Euclidean distance (ED) is “0”. When the control signal (= 1) indicating the Manhattan distance (MD) is input, the multiplexer 78 outputs the calculation result (absolute value difference AD S ) output from each latch circuit 76 in the arithmetic circuits 61 to 64. Further, when the control signal (= 0) indicating the Euclidean distance (ED) is input, the multiplexer 78 outputs the calculation result (TE S ) output from each D flip-flop circuit 74 in the arithmetic circuits 61 to 64. .

乗数ビットシフト回路66は、クロック信号CLKに同期して、演算回路61〜64におけるラッチ回路76から出力される絶対値差ADの値を受ける。乗数ビットシフト回路66は、下位ビットから順に、つまり、絶対値差AD→AD→AD→ADの順に、その絶対値差を乗数ビットMBとしてAND回路77に出力する。乗数ビットシフト回路66は、最上位ビットの絶対値差(AD)の値を出力すると、制御回路(図示せず)に二乗計算の終了を示す信号を出力する。 Multiplier bit shift circuit 66 in synchronism with the clock signal CLK, receives the value of the absolute value difference AD S outputted from the latch circuit 76 in the arithmetic circuit 61 to 64. The multiplier bit shift circuit 66 outputs the absolute value difference to the AND circuit 77 as a multiplier bit MB in order from the lower bits, that is, in the order of the absolute value difference AD 4 → AD 3 → AD 2 → AD 1 . When the multiplier bit shift circuit 66 outputs the value of the absolute value difference (AD 1 ) of the most significant bit, it outputs a signal indicating the end of the square calculation to the control circuit (not shown).

AND回路77は、乗数ビットシフト回路66から入力される乗数ビットMBと、ラッチ回路76から入力される絶対値差ADとの論理積の値を、被加算値Mとしてマルチプレクサ72に出力する。 The AND circuit 77 outputs a logical product value of the multiplier bit MB input from the multiplier bit shift circuit 66 and the absolute value difference AD S input from the latch circuit 76 to the multiplexer 72 as an added value M S. .

図13は、距離演算回路DPijにおける二乗計算の処理過程を示す図である。この例では、検索データと参照データとの絶対値差AD=710=0111である場合を示している。図13の例では、演算回路61〜64の各AND回路77には、クロック信号CLKに同期して、絶対値差の下位ビットから「1→1→1→0」の順に、乗数ビットMBが乗数ビットシフト回路66によって入力される。また、演算回路61〜64のマルチプレクサ71には、シフト演算値TES−1として初期値「0」が設定されている。 FIG. 13 is a diagram illustrating a process of square calculation in the distance calculation circuit DP ij . This example shows a case where the absolute value difference AD S = 7 10 = 0111 2 between the search data and the reference data. In the example of FIG. 13, each AND circuit 77 of the arithmetic circuits 61 to 64 has a multiplier bit MB in the order of “1 → 1 → 1 → 0” from the lower bit of the absolute value difference in synchronization with the clock signal CLK. It is input by a multiplier bit shift circuit 66. In addition, an initial value “0” is set as the shift operation value TE S−1 in the multiplexer 71 of the arithmetic circuits 61 to 64.

距離演算回路DPijは、二乗計算制御信号SQ(=1)が制御回路から入力されると二乗計算を開始する。演算回路61〜64において、各マルチプレクサ71に設定されているシフト演算値TES−1「0000」が、全加算器73に入力される(ステップS1)。また、演算回路61〜64のAND回路77から、乗数ビット”1”と絶対値差AD「0111」との論理積を示す被加算値M「0111」が各マルチプレクサ72に入力され、各マルチプレクサ72から全加算器73に被加算値M「0111」が入力される(ステップS2)。演算回路61〜64の全加算器73において、シフト演算値TES−1「0000」と被加算値M「0111」が加算されて出力される。加算結果「0111」は、1クロック目が立ち上がるタイミングで演算回路61〜64のDフリップフロップ回路74にそれぞれ入力され、1クロック目が立ち下がるまで保持される(ステップS3)。 The distance calculation circuit DP ij starts the square calculation when the square calculation control signal SQ (= 1) is input from the control circuit. In the arithmetic circuits 61 to 64, the shift arithmetic value TE S-1 “0000” set in each multiplexer 71 is input to the full adder 73 (step S1). In addition, an added value M S “0111” indicating a logical product of the multiplier bit “1” and the absolute value difference AD S “0111” is input to each multiplexer 72 from the AND circuit 77 of the arithmetic circuits 61 to 64. The added value M S “0111” is input from the multiplexer 72 to the full adder 73 (step S2). In the full adders 73 of the arithmetic circuits 61 to 64, the shift operation value TE S-1 “0000” and the added value M S “0111” are added and output. The addition result “0111” is input to the D flip-flop circuits 74 of the arithmetic circuits 61 to 64 at the timing when the first clock rises, and is held until the first clock falls (step S3).

1クロック目が立ち下がると、演算回路61〜64のAND回路77から、乗数ビット”1”と絶対値差AD「0111」の論理積を示す被加算値M「0111」が各マルチプレクサ72に入力され、各マルチプレクサ72から全加算器73に被加算値M「0111」が入力される(ステップS4)。また、ステップS3において、演算回路61〜64のDフリップフロップ回路74に保持されている加算結果「0111」は、シフト演算値TEとして、演算回路62〜64のマルチプレクサ71と、シフトレジスタ65のフリップフロップ回路65aとに出力される(ステップS5)。 When the first clock falls, the added values M S “0111” indicating the logical product of the multiplier bit “1” and the absolute value difference AD S “0111” are output from the AND circuits 77 of the arithmetic circuits 61 to 64 to the multiplexers 72. The added value M S “0111” is input from each multiplexer 72 to the full adder 73 (step S4). Further, in step S3, addition result held in the D flip-flop circuit 74 of the arithmetic circuit 61 to 64 "0111", as the shift operation value TE S, a multiplexer 71 of the arithmetic circuit 62 to 64, the shift register 65 The data is output to the flip-flop circuit 65a (step S5).

1クロック目の立ち下がりから2クロック目が立ち上がるまで、演算回路61〜64の全加算器73において、被加算値M「0111」とシフト演算値TES−1「0111」とが加算されて出力される。加算結果「1010」は、2クロック目が立ち上がるタイミングで、演算回路61〜64のDフリップフロップ回路74に入力され、2クロック目が立ち下がるまで保持される。また、シフトレジスタ65のフリップフロップ回路65aに入力されたシフト演算値TE「1」は、2クロック目が立ち下がるまで保持される(ステップS6)。 From the fall of the first clock to the rise of the second clock, the full adder 73 of the arithmetic circuits 61 to 64 adds the added value M S “0111” and the shift operation value TE S−1 “0111”. Is output. The addition result “1010” is input to the D flip-flop circuit 74 of the arithmetic circuits 61 to 64 at the timing when the second clock rises, and is held until the second clock falls. Further, the shift operation value TE 4 “1” input to the flip-flop circuit 65a of the shift register 65 is held until the second clock falls (step S6).

2クロック目が立ち下がると、演算回路61〜64のAND回路77から、乗数ビット”1”と絶対値差「0111」の論理積を示す被加算値M「0111」が各マルチプレクサ72に入力され、各マルチプレクサ72から各全加算器73に被加算値M「0111」が入力される(ステップS7)。 When the second clock falls, the AND circuit 77 of the arithmetic circuits 61 to 64 inputs the added value M S “0111” indicating the logical product of the multiplier bit “1” and the absolute value difference “0111” to each multiplexer 72. Then, the added value M S “0111” is input from each multiplexer 72 to each full adder 73 (step S7).

また、2クロック目が立ち下がると、ステップS6において、演算回路61〜64のDフリップフロップ回路74に保持されている加算結果「1010」は、シフト演算値TEとして、演算回路62〜64のマルチプレクサ71とフリップフロップ回路65aに出力される。演算回路61〜64のマルチプレクサ71は、シフト演算値TE,TE,TE,TEとして「0,1,0,1」を全加算器73に入力する。フリップフロップ回路65aは、保持しているシフト演算値TE「1」をシフト演算値TE(=DOUT)としてフリップフロップ回路65bに出力し、演算回路64から出力されたシフト演算値TE「0」を入力する(ステップS8)。 Further, when the second clock falls, in step S6, the results summed held in the D flip-flop circuit 74 of the arithmetic circuit 61 to 64 "1010", as the shift operation value TE S, the arithmetic circuit 62 to 64 It is output to the multiplexer 71 and the flip-flop circuit 65a. The multiplexer 71 of the arithmetic circuits 61 to 64 inputs “ 0 , 1 , 0 , 1 ” to the full adder 73 as the shift arithmetic values TE 0 , TE 1 , TE 2 , TE 3 . The flip-flop circuit 65a outputs the held shift operation value TE 4 “1” as the shift operation value TE 5 (= DOUT 5 ) to the flip-flop circuit 65b, and the shift operation value TE 4 output from the operation circuit 64. “0” is input (step S8).

2クロック目の立ち下がりから3クロック目が立ち上がるまで、演算回路61〜64の全加算器73において、被加算値M「0111」とシフト演算値TES−1「0101」とが加算されて出力される。加算結果「1100」は、3クロック目が立ち上がるタイミングで演算回路61〜64のDフリップフロップ回路74に入力され、3クロック目が立ち下がるまで保持される。また、フリップフロップ回路65aにおいて、演算回路64からのシフト演算値TE「0」は、3クロック目が立ち下がるまで保持される。フリップフロップ回路65bにおいて、フリップフロップ回路65aからのシフト演算値TE「1」は3クロック目が立ち下がるまで保持される(ステップS9)。 From the falling edge of the second clock to the rising edge of the third clock, the full adder 73 of the arithmetic circuits 61 to 64 adds the added value M S “0111” and the shift operation value TE S−1 “0101”. Is output. The addition result “1100” is input to the D flip-flop circuit 74 of the arithmetic circuits 61 to 64 at the timing when the third clock rises, and is held until the third clock falls. Further, in the flip-flop circuit 65a, the shift operation value TE 4 “0” from the arithmetic circuit 64 is held until the third clock falls. In the flip-flop circuit 65b, the shift operation value TE 5 “1” from the flip-flop circuit 65a is held until the third clock falls (step S9).

3クロック目が立ち下がると、演算回路61〜64のAND回路77から、乗数ビット”0”と絶対値差「0111」の論理積を示す被加算値M「0000」が各マルチプレクサ72に入力され、各マルチプレクサ72から全加算器73に被加算値M「0000」が入力される(ステップS10)。 When the third clock falls, the added value M S “0000” indicating the logical product of the multiplier bit “0” and the absolute value difference “0111” is input to each multiplexer 72 from the AND circuit 77 of the arithmetic circuits 61 to 64. The added value M S “0000” is input from each multiplexer 72 to the full adder 73 (step S10).

また、ステップS9において、演算回路61〜64のDフリップフロップ回路74に保持されている加算結果「1100」は、3クロック目が立ち下がると、シフト演算値TEとして、演算回路62〜64のマルチプレクサ71とフリップフロップ回路65aに出力される。演算回路61〜64のマルチプレクサ71は、シフト演算値TE,TE,TE,TEとして「0,1,1,0」を全加算器73に入力する。フリップフロップ回路65aは、保持しているシフト演算値TE「0」をシフト演算値TEとして出力し、演算回路64から出力されたシフト演算値TE「0」を入力する。フリップフロップ回路65bは、保持しているシフト演算値TE「1」をシフト演算値TE(=DOUT)として出力し、フリップフロップ回路65aから出力されたシフト演算値TE「0」を入力する。フリップフロップ回路65cは、フリップフロップ回路65bから出力されたシフト演算値TE「1」を入力する(ステップS11)。 Further, in step S9, the result summed held in the D flip-flop circuit 74 of the arithmetic circuit 61 to 64 "1100" is 3 when the clock cycle falls, the shift operation value TE S, the arithmetic circuit 62 to 64 It is output to the multiplexer 71 and the flip-flop circuit 65a. The multiplexer 71 of the arithmetic circuits 61 to 64 inputs “ 0 , 1 , 1 , 0 ” to the full adder 73 as the shift arithmetic values TE 0 , TE 1 , TE 2 , TE 3 . The flip-flop circuit 65 a outputs the held shift operation value TE 4 “0” as the shift operation value TE 5 , and receives the shift operation value TE 4 “0” output from the operation circuit 64. The flip-flop circuit 65b outputs the held shift operation value TE 5 “1” as the shift operation value TE 6 (= DOUT 6 ), and uses the shift operation value TE 5 “0” output from the flip-flop circuit 65a. input. The flip-flop circuit 65c receives the shift operation value TE 6 “1” output from the flip-flop circuit 65b (step S11).

3クロック目が立ち下がっている間、乗数ビットシフト回路66から乗数ビットMB”0”が各演算回路61〜64に出力されると、二乗計算の終了を示す信号が制御回路(図示せず)に出力される。3クロック目の立ち下がりから4クロック目が立ち上がるまで、演算回路61〜64の全加算器73において、被加算値M「0000」とシフト演算値TES−1「0110」とが加算されて出力される。4クロック目が立ち上がると、加算結果「0110」は、それぞれシフト演算値TE,TE,TE,TEとして、Dフリップフロップ回路74に出力される(ステップS12)。シフトレジスタ65には、ステップS11において入力されたシフト演算値TE,TE,TEの各値(0,0,1)が、シフト演算値TE,TE,TEとして保持される。 When the multiplier bit shift circuit 66 outputs the multiplier bit MB “0” to each of the arithmetic circuits 61 to 64 while the third clock is falling, a signal indicating the end of the square calculation is sent to the control circuit (not shown). Is output. The adder value M S “0000” and the shift operation value TE S-1 “0110” are added in the full adder 73 of the arithmetic circuits 61 to 64 until the fourth clock rises from the fall of the third clock. Is output. When the fourth clock rises, the addition result “0110” is output to the D flip-flop circuit 74 as the shift operation values TE 1 , TE 2 , TE 3 , TE 4 (step S12). In the shift register 65, the values (0, 0, 1) of the shift operation values TE 4 , TE 5 , TE 6 input in step S11 are held as shift operation values TE 5 , TE 6 , TE 7. .

4クロック目が立ち下がると、演算回路61〜64において、それぞれのDフリップフロップ回路74に保持されているシフト演算値TE,TE,TE,TEは、それぞれのマルチプレクサ78に出力され、DOUT=0,DOUT=0、DOUT=1、DOUT=1、DOUT=0として距離/クロック数変換回路DCに出力される。また、シフトレジスタ65において、フリップフロップ回路65a〜65cに保持されているシフト演算値TE「0」,TE「0」,TE「1」についても、4クロック目が立ち下がると、それぞれ、DOUT=0、DOUT=0、DOUT=1として、距離/クロック数変換回路DCに出力される。つまり、DOUT〜DOUTは、絶対値差(=710)の二乗値(=4910)を示す距離信号Dijとして距離/クロック数変換回路DCに出力される。 When the fourth clock falls, the shift calculation values TE 1 , TE 2 , TE 3 , TE 4 held in the respective D flip-flop circuits 74 are output to the respective multiplexers 78 in the arithmetic circuits 61 to 64. , DOUT 0 = 0, DOUT 1 = 0, DOUT 2 = 1, DOUT 3 = 1, and DOUT 4 = 0 are output to the distance / clock number conversion circuit DC i . Further, in the shift register 65, the shift operation values TE 5 “0”, TE 6 “0”, and TE 7 “1” held in the flip-flop circuits 65a to 65c are respectively decreased when the fourth clock falls. , DOUT 5 = 0, DOUT 6 = 0, and DOUT 7 = 1 are output to the distance / clock number conversion circuit DC i . That is, DOUT 0 to DOUT 7 are output to the distance / clock number conversion circuit DC i as the distance signal D ij indicating the square value (= 49 10 ) of the absolute value difference (= 7 10 ).

距離/クロック数変換回路DCは、距離演算回路DPijから出力される絶対値差の二乗値をクロック数に変換する。図14は、図2Aに示す距離/クロック数変換回路DCにおけるカウンタ一致検出回路31の概略構成を示す図である。図14に示すように、カウンタ一致検出回路31は、カウンタ311と一致検出回路3121とを含む。 The distance / clock number conversion circuit DC i converts the square value of the absolute value difference output from the distance calculation circuit DP ij into a clock number. Figure 14 is a diagram showing a schematic configuration of a counter coincidence detection circuit 31 at a distance / clock number conversion circuit DC 1 shown in Figure 2A. As shown in FIG. 14, the counter coincidence detection circuit 31 includes a counter 311 and a coincidence detection circuit 3121.

カウンタ311は、バッファ21からクロック信号CLKを受け、連想メモリ100の制御回路(図示せず)からリセット信号RSTを受ける。カウンタ311は、リセット信号RSTを受けると、カウンタ値をリセットし、Mビットのビット値をクロック信号CLKに同期して昇順にカウントアップする。カウンタ311は、そのカウンタ値CV11をクロック信号CLKに同期して一致検出回路3121へ順次出力する。 The counter 311 receives a clock signal CLK from the buffer 21 and a reset signal RST from a control circuit (not shown) of the associative memory 100. Upon receiving the reset signal RST, the counter 311 resets the counter value, and counts up the M-bit bit value in ascending order in synchronization with the clock signal CLK. The counter 311 sequentially outputs the counter value CV 11 to the coincidence detection circuit 3121 in synchronization with the clock signal CLK.

一致検出回路3121は、バッファ21からクロック信号CLKを受け、制御回路(図示せず)から検索開始信号SBを受ける。また、一致検出回路3121は、カウンタ311からカウンタ値CV11を受け、距離演算回路DP11から距離信号D11を受ける。一致検出回路3121は、検索開始信号SBが立ち上がると、距離信号D11に一致するカウンタ値CV11が得られるときのクロック信号CLKのクロック数をカウントする。そして、一致検出回路3121は、そのクロック数をカウントしたタイミングを示す一致信号MTH1をカウンタ一致検出回路32へ出力する。一致検出回路3121は、一致信号MTH1を出力すると動作を停止する。 Match detection circuit 3121 receives clock signal CLK from buffer 21 and receives search start signal SB from a control circuit (not shown). The coincidence detection circuit 3121 receives the counter value CV 11 from the counter 311 and the distance signal D 11 from the distance calculation circuit DP 11 . Coincidence detecting circuit 3121, rises the search start signal SB, and counts the number of clocks of the clock signal CLK when the counter value CV 11 matching the distance signal D 11 is obtained. Then, the coincidence detection circuit 3121 outputs a coincidence signal MTH1 indicating the timing of counting the number of clocks to the counter coincidence detection circuit 32. When the coincidence detection circuit 3121 outputs the coincidence signal MTH1, the operation is stopped.

なお、図2Aに示すカウンタ一致検出回路32〜3Wの各々についても、図14に示すカウンタ一致検出回路31と同様の構成を有する。カウンタ一致検出回路32〜3Wは、それぞれ、カウンタ一致検出回路31〜3W−1の一致検出回路3121から一致信号MTH1〜MTHW−1を受けるまで動作を停止し、一致信号MTH1〜MTHW−1を受けると駆動して動作を開始する。   Note that each of the counter coincidence detection circuits 32 to 3W shown in FIG. 2A has the same configuration as the counter coincidence detection circuit 31 shown in FIG. Counter match detection circuits 32 to 3W stop operating until they receive match signals MTH1 to MTHW-1 from match detection circuits 3121 of counter match detection circuits 31 to 3W-1, and receive match signals MTH1 to MTHW-1. To start operation.

カウンタ一致検出回路3Wから一致信号MTHWが出力されるタイミングで、距離/クロック数変換回路DCに対するタイミング信号CがWinner検出器20へ出力される。つまり、タイミング信号Cは、距離/クロック数変換回路DCに入力される距離信号Di1〜DiWが示す各絶対値差の二乗値の和、すなわち、ユークリッド距離値の和に相当するクロック数が得られるタイミングで出力される。 At the timing when the coincidence signal MTHW is outputted from the counter coincidence detection circuit 3W, the timing signal C i for the distance / clock number conversion circuit DC i is outputted to the Winner detector 20. That is, the timing signal C i is a clock corresponding to the sum of square values of the absolute value differences indicated by the distance signals D i1 to D iW input to the distance / clock number conversion circuit DC i , that is, the sum of the Euclidean distance values. It is output when the number is obtained.

上記の例では、ユークリッド距離を用いて検索を行う例を説明したが、図12に示す演算回路61〜64のマルチプレクサ78に、マンハッタン距離を示す制御信号(MD)が制御回路(図示せず)から入力される場合には、各マルチプレクサ78から、検索データと参照データの絶対値差(AD〜AD)で表される距離信号Dijが出力される。その場合も、ユークリッド距離と同様、距離/クロック数変換回路DCにおいて、距離信号Dijに一致するカウンタ値CVijが得られるときのクロック信号CLKのクロック数をカウントすればよい。 In the above example, the example of performing the search using the Euclidean distance has been described. However, the control signal (MD) indicating the Manhattan distance is supplied to the multiplexer 78 of the arithmetic circuits 61 to 64 shown in FIG. Are input from each multiplexer 78, a distance signal D ij represented by an absolute value difference (AD 1 to AD 4 ) between the search data and the reference data is output. In this case also, similar to the Euclidean distance, the distance / clock number conversion circuit DC i, may be counted the number of clocks of the clock signal CLK when the counter value CV ij matching distance signal D ij is obtained.

上述した第4実施形態では、距離演算回路において、検索データと参照データとの絶対値差の演算を行うとともに、絶対値差の二乗演算を行うことができる。そのため、絶対値差の演算と絶対値差の二乗演算とを別個の回路によって実現する場合等と比べて回路面積を小さくすることができる。また、マンハッタン距離とユークリッド距離のいずれを用いた検索にも適用することができる。   In the fourth embodiment described above, the distance calculation circuit can calculate the absolute value difference between the search data and the reference data, and can also perform the square calculation of the absolute value difference. Therefore, the circuit area can be reduced as compared with the case where the absolute value difference calculation and the absolute value difference square calculation are realized by separate circuits. It can also be applied to searches using either the Manhattan distance or the Euclidean distance.

<変形例> <Modification>

(1)上述した第1実施形態では、ユークリッド距離を用いた検索を行う例について説明したが、マンハッタン距離とユークリッド距離のいずれを用いても検索されるように構成してもよい。図15は、本変形例におけるカウンタ一致検出回路の構成例を示す概略図である。カウンタ一致検出回路31は、デマルチプレクサ31xを有し、カウンタ一致検出回路32は、デマルチプレクサ32xを有する。 (1) In the first embodiment described above, an example of performing a search using the Euclidean distance has been described. However, the search may be performed using any of the Manhattan distance and the Euclidean distance. FIG. 15 is a schematic diagram illustrating a configuration example of a counter coincidence detection circuit in the present modification. The counter match detection circuit 31 includes a demultiplexer 31x, and the counter match detection circuit 32 includes a demultiplexer 32x.

デマルチプレクサ31x,32xには、マンハッタン距離かユークリッド距離かを示す制御信号SLが制御回路(図示せず)から入力される。クロック数変換回路31aにおいて、距離信号D11とクロック数とが一致すると、デマルチプレクサ31xにHレベルの一致検出信号を出力する。デマルチプレクサ31xは、入力された制御信号がマンハッタン距離を示す場合には、クロック数変換回路31aから出力される一致検出信号をバッファ22とクロック数変換回路31aに出力して動作を停止する。 A control signal SL indicating a Manhattan distance or an Euclidean distance is input to the demultiplexers 31x and 32x from a control circuit (not shown). The clock number conversion circuit 31a, the distance signal D 11 and the clock count and matches, outputs the H level coincidence detection signal to the demultiplexer 31x. When the input control signal indicates a Manhattan distance, the demultiplexer 31x outputs the coincidence detection signal output from the clock number conversion circuit 31a to the buffer 22 and the clock number conversion circuit 31a and stops its operation.

カウンタ一致検出回路31から一致検出信号が出力されると、バッファ22からクロック数変換回路32aにクロック信号CLKが入力される。クロック数変換回路32aにおいて、距離信号D12とクロック数とが一致すると、デマルチプレクサ32xにHレベルの一致検出信号を出力する。デマルチプレクサ32xは、入力された制御信号がマンハッタン距離を示す場合には、クロック数変換回路32aからのHレベルの一致検出信号が入力されたタイミングでWinner検出器20にタイミング信号Cを出力して動作を停止する。 When the coincidence detection signal is output from the counter coincidence detection circuit 31, the clock signal CLK is input from the buffer 22 to the clock number conversion circuit 32a. The clock number conversion circuit 32a, the distance signal D 12 and the clock count and matches, outputs the H level coincidence detection signal to the demultiplexer 32x. Demultiplexer 32x is inputted control signal to indicate Manhattan distance, and outputs a timing signal C 1 to Winner detector 20 at the timing when the coincidence detection signal of H level from the clock number conversion circuit 32a is input Stop operation.

なお、ユークリッド距離を示す制御信号がデマルチプレクサ31x,32xに入力された場合には、マルチプレクサ31x,32xは、クロック数変換回路31a,32aからのHレベルの一致検出信号をカウンタ31b,32bにそれぞれ出力し、上述した第1実施形態と同様、カウンタ31b,32bのカウンタ値と距離信号D11,D12とが一致するまで動作を繰り返す。 When a control signal indicating the Euclidean distance is input to the demultiplexers 31x and 32x, the multiplexers 31x and 32x respectively receive the H level coincidence detection signals from the clock number conversion circuits 31a and 32a to the counters 31b and 32b. outputs, as with the first embodiment described above, and repeats the operation until the counter 31b, and the 32b counter value and the distance signal D 11, D 12 of matching.

(2)上述した第3実施形態では、距離とカウンタ値との一致検出の際、最上位ビットから下位方向に1ビットずつ対象ビットを拡張する例について説明したが、複数ビット単位に対象ビットを拡張するようにしてもよい。また、対象ビットを拡張するごとに、拡張するビットの数が異なっていてもよい。例えば、距離とカウンタ値とが6ビット長である場合において、最上位のビットについて一致の検索を行い、いずれかの参照データについての一致検出信号が立ち上がると、2番目と3番目の2つのビットを対象ビットとし、上位3ビットまで拡張する。そして、いずれかの参照データについて、上位3ビットに対する一致検出信号が立ち上がると、4番目〜6番目の3つのビットを次の検索対象のビットとし、全ビットに対象ビットを拡張する。 (2) In the third embodiment described above, the example in which the target bit is expanded one bit at a time from the most significant bit to the lower direction when detecting the coincidence between the distance and the counter value has been described. It may be expanded. Further, the number of bits to be expanded may be different every time the target bit is expanded. For example, when the distance and the counter value are 6 bits long, a match search is performed for the most significant bit, and when the match detection signal for any reference data rises, the second and third two bits Is extended to the upper 3 bits. For any reference data, when the match detection signal for the upper 3 bits rises, the fourth to sixth bits are set as the next search target bits, and the target bits are extended to all bits.

この発明は、連想メモリに適用される。   The present invention is applied to an associative memory.

1…メモリ部、2…行デコーダ、3…列デコーダ、4…読出/書込回路、5…検索データ保存回路、6,77,64a,300c,313d,313e…AND回路、10…メモリアレイ部、20…Winner検出器、21〜2W…バッファ,31〜3W,…カウンタ一致検出回路、31a,32a…クロック数変換回路、31b,32b,300b,311,312…カウンタ、31c,31c’,32c,32c’,313,3121…一致検出回路、40…有効ビット設定部、61〜64…演算回路、65…シフトレジスタ、65a,65b,65c…フリップフロップ回路、66…乗数ビットシフト回路、71,72,78,31d,32d,300a,314…マルチプレクサ、73…全加算器、74…Dフリップフロップ回路、75…反転制御回路、76…ラッチ回路、300…カウンタ一致検出ユニット、310,320…距離/クロック数変換ユニット、312a〜312c…セレクタ、312d〜312f…分周器、313a〜313c…EXNOR回路、DC〜DC,DE〜DE…距離/クロック数変換回路、DE11〜DE1W…カウンタ一致検出回路、DP11〜DPRW…距離演算回路 DESCRIPTION OF SYMBOLS 1 ... Memory part, 2 ... Row decoder, 3 ... Column decoder, 4 ... Read / write circuit, 5 ... Search data storage circuit, 6, 77, 64a, 300c, 313d, 313e ... AND circuit, 10 ... Memory array part 20 ... Winner detector, 21-2W ... buffer, 31-3W, ... counter coincidence detection circuit, 31a, 32a ... clock number conversion circuit, 31b, 32b, 300b, 311, 312 ... counter, 31c, 31c ', 32c 32c ', 313, 3121 ... coincidence detection circuit, 40 ... effective bit setting unit, 61-64 ... arithmetic circuit, 65 ... shift register, 65a, 65b, 65c ... flip-flop circuit, 66 ... multiplier bit shift circuit, 71, 72, 78, 31d, 32d, 300a, 314 ... multiplexer, 73 ... full adder, 74 ... D flip-flop circuit, 5 ... Inversion control circuit, 76 ... Latch circuit, 300 ... Counter coincidence detection unit, 310, 320 ... Distance / clock number conversion unit, 312a-312c ... Selector, 312d-312f ... Frequency divider, 313a-313c ... EXNOR circuit, DC 1 to DC R , DE 1 to DE R ... Distance / clock number conversion circuit, DE 11 to DE 1W ... Counter coincidence detection circuit, DP 11 to DP RW .

Claims (5)

各々がM×W(Mは1以上の整数、Wは2以上の整数)ビットのビット長を有するR(Rは2以上の整数)個の参照データを保存する参照データ保存手段と、
前記R個の参照データに対応して設けられ、M×Wビットのビット長を有する検索対象の検索データと前記参照データとの差の絶対値を表すR×W個の絶対値差を、前記検索データと前記参照データの距離として算出する第1距離算出手段と、
前記参照データごとに、前記第1距離算出手段で算出された前記距離を用い、前記参照データと前記検索データとのユークリッド距離に一致するクロック数を検出したタイミングを示すタイミング信号を出力するタイミング信号出力処理を、前記R個の参照データについて行うタイミング信号出力手段と、
前記タイミング信号出力手段から出力されるR個のタイミング信号に基づいて、前記タイミング信号の出力が早い順に、k個(kは1≦k<Rを満たす整数)の前記タイミング信号を検出し、検出した前記k個のタイミング信号を、前記検索データと前記参照データとの類似度を示すマッチ信号として出力するマッチ信号出力手段と、
を備える連想メモリ。
Reference data storage means for storing R (R is an integer of 2 or more) reference data each having a bit length of M × W (M is an integer of 1 or more, W is an integer of 2 or more) bits;
R × W absolute value differences representing absolute values of differences between the search data to be searched and the reference data provided corresponding to the R reference data and having a bit length of M × W bits, First distance calculating means for calculating the distance between the search data and the reference data;
A timing signal that outputs a timing signal indicating the timing at which the number of clocks matching the Euclidean distance between the reference data and the search data is detected for each reference data using the distance calculated by the first distance calculating unit Timing signal output means for performing output processing on the R reference data;
Based on R timing signals output from the timing signal output means, k timing signals (k is an integer satisfying 1 ≦ k <R) are detected in order of output of the timing signals, and detected. Match signal output means for outputting the k timing signals as match signals indicating the similarity between the search data and the reference data;
Associative memory.
前記タイミング信号出力手段は、前記タイミング信号出力処理として、前記各参照データにつき、前記W個の絶対値差の各々に一致する回数だけ、前記絶対値差と一致するクロック数を検出する処理を繰り返すことにより、前記参照データと前記検索データとのユークリッド距離に一致するクロック数を検出したタイミングを示す前記タイミング信号を出力する、請求項1に記載の連想メモリ。   The timing signal output means repeats a process of detecting the number of clocks matching the absolute value difference as many times as the timing signal output process matches each of the W absolute value differences for each reference data. The associative memory according to claim 1, wherein the associative memory outputs the timing signal indicating the timing at which the number of clocks matching the Euclidean distance between the reference data and the search data is detected. 前記各参照データにつき、前記第1距離算出手段で算出された前記W個の絶対値差の各々の二乗値を算出することにより、前記検索対象の検索データと前記参照データとの距離として、前記W個の絶対値差の二乗値を算出する第2距離算出手段を更に備え、
前記タイミング信号出力手段は、前記タイミング信号出力処理として、前記参照データごとに、前記第2距離算出手段で算出された前記W個の前記絶対値差の二乗値の和に一致するクロック数を検出することにより、前記参照データと前記検索データとのユークリッド距離に一致するクロック数を検出したタイミングを示す前記タイミング信号を出力する、請求項1に記載の連想メモリ。
By calculating the square value of each of the W absolute value differences calculated by the first distance calculation means for each reference data, the distance between the search target search data and the reference data is A second distance calculating means for calculating a square value of W absolute value differences;
The timing signal output means detects, as the timing signal output process, the number of clocks that matches the sum of the squares of the W absolute value differences calculated by the second distance calculation means for each reference data. The associative memory according to claim 1, wherein the timing signal indicating the timing at which the number of clocks matching the Euclidean distance between the reference data and the search data is detected is output.
マンハッタン距離とユークリッド距離のいずれかの距離を選択する選択手段を備え、
前記タイミング信号出力手段は、前記選択手段によって前記マンハッタン距離が選択された場合には、前記各参照データにつき、前記W個の絶対値差の和に一致するクロック数を検出したタイミングを示す前記タイミング信号を出力し、前記選択手段によって前記ユークリッド距離が選択された場合には、前記各参照データについて前記タイミング信号出力処理を行う、請求項1から請求項3のいずれか一項に記載の連想メモリ。
A selection means for selecting either the Manhattan distance or the Euclidean distance;
The timing signal output means, when the Manhattan distance is selected by the selection means, the timing indicating the timing at which the number of clocks matching the sum of the W absolute value differences is detected for each reference data 4. The associative memory according to claim 1, wherein a signal is output, and when the Euclidean distance is selected by the selection unit, the timing signal output process is performed on each reference data. 5. .
各々がM×W(Mは1以上の整数、Wは2以上の整数)ビットのビット長を有するR(Rは2以上の整数)個の参照データを保存する参照データ保存手段と、
前記R個の参照データに対応して設けられ、M×Wビットのビット長を有する検索対象の検索データと前記参照データとのR×W個の距離を算出する距離算出手段と、
前記参照データごとに、前記距離算出手段で算出された距離を表すビットのうち、設定された対象ビットの値と一致するクロック数を検出したタイミングで一致検出信号を出力する一致検出手段と、
前記各参照データについて算出された前記距離を表す最上位ビットから順に、予め定められたビット単位に前記対象ビットを設定し、いずれかの前記参照データについて、前記対象ビットに対する前記一致検出信号が出力される毎に、前記対象ビットを拡張するビット設定手段と、
前記各参照データについて、前記距離を表す全てのビットに対する前記一致検出信号が出力されたタイミングを示すタイミング信号を出力する処理を、R個の前記参照データについて行うタイミング信号出力手段と、
前記タイミング信号出力手段から出力されるR個のタイミング信号に基づいて、前記タイミング信号の出力が早い順に、k個(kは1≦k<Rを満たす整数)の前記タイミング信号を検出し、検出した前記k個のタイミング信号を、前記検索データと前記参照データとの類似度を示すマッチ信号として出力するマッチ信号出力手段と、
を備える連想メモリ。
Reference data storage means for storing R (R is an integer of 2 or more) reference data each having a bit length of M × W (M is an integer of 1 or more, W is an integer of 2 or more) bits;
Distance calculating means provided corresponding to the R reference data and calculating R × W distances between search data to be searched having a bit length of M × W bits and the reference data;
For each of the reference data, among the bits representing the distance calculated by the distance calculating means, a coincidence detecting means for outputting a coincidence detection signal at a timing at which the number of clocks that matches the set target bit value is detected,
The target bits are set in predetermined bit units in order from the most significant bit representing the distance calculated for each reference data, and the coincidence detection signal for the target bits is output for any of the reference data Bit setting means for extending the target bit each time,
A timing signal output means for performing a process of outputting a timing signal indicating a timing at which the coincidence detection signal is output for all the bits representing the distance for each of the reference data;
Based on R timing signals output from the timing signal output means, k timing signals (k is an integer satisfying 1 ≦ k <R) are detected in order of output of the timing signals, and detected. Match signal output means for outputting the k timing signals as match signals indicating the similarity between the search data and the reference data;
Associative memory.
JP2013025465A 2013-02-13 2013-02-13 Associative memory Expired - Fee Related JP6085187B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013025465A JP6085187B2 (en) 2013-02-13 2013-02-13 Associative memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013025465A JP6085187B2 (en) 2013-02-13 2013-02-13 Associative memory

Publications (2)

Publication Number Publication Date
JP2014154196A true JP2014154196A (en) 2014-08-25
JP6085187B2 JP6085187B2 (en) 2017-02-22

Family

ID=51575925

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013025465A Expired - Fee Related JP6085187B2 (en) 2013-02-13 2013-02-13 Associative memory

Country Status (1)

Country Link
JP (1) JP6085187B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013101729A (en) * 2011-11-07 2013-05-23 Hiroshima Univ Content addressable memory
JP2016157496A (en) * 2015-02-25 2016-09-01 国立大学法人広島大学 K vicinity method association memory which can be reconfigured

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5619182A (en) * 1979-07-26 1981-02-23 Nippon Telegr & Teleph Corp <Ntt> Associative memory unit
JP2007080375A (en) * 2005-09-14 2007-03-29 Hiroshima Univ Associative memory device for retrieving minimum euclidean distance
JP2011076688A (en) * 2009-10-01 2011-04-14 Hiroshima Univ Associative memory

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5619182A (en) * 1979-07-26 1981-02-23 Nippon Telegr & Teleph Corp <Ntt> Associative memory unit
JP2007080375A (en) * 2005-09-14 2007-03-29 Hiroshima Univ Associative memory device for retrieving minimum euclidean distance
JP2011076688A (en) * 2009-10-01 2011-04-14 Hiroshima Univ Associative memory

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013101729A (en) * 2011-11-07 2013-05-23 Hiroshima Univ Content addressable memory
JP2016157496A (en) * 2015-02-25 2016-09-01 国立大学法人広島大学 K vicinity method association memory which can be reconfigured

Also Published As

Publication number Publication date
JP6085187B2 (en) 2017-02-22

Similar Documents

Publication Publication Date Title
JP5800422B2 (en) Associative memory
JP5916563B2 (en) Associative memory
JP6085187B2 (en) Associative memory
JPS62256034A (en) Pipeline computing unit
US20120117337A1 (en) Semiconductor integrated circuit and exponent calculation method
JP6327717B2 (en) k-neighbor associative memory
WO2024066561A1 (en) Apparatus and method for searching for free memory and chip
Ganavi et al. Design of low-power square root carry select adder and wallace tree multiplier using adiabatic logic
Sk High speed multiplexer design using tree based decomposition algorithm
WO2023134507A1 (en) Stochastic calculation method, circuit, chip, and device
Zhao et al. An fpga-based hardware accelerator of ransac algorithm for matching of images feature points
KR960028176A (en) High Speed Digital Image Pattern Matching Circuit
Ilić et al. Address generation unit as accelerator block in DSP
JP2011040009A (en) Bit sequence data sorting device, sorting method, and program
JP6411914B2 (en) Reconfigurable k-neighbor associative memory
RU2424551C2 (en) Method of generating random numbers
RU2786204C1 (en) Digital smoother
JP2013069000A (en) Parity prediction unit, carry-less multiplier, and arithmetic processing unit
RU2580803C1 (en) Device for information search
RU1774328C (en) Decimal numbers divider
SU1571581A1 (en) Device for extracting of square root
JP6212728B2 (en) Random number generator and mapping operation circuit
JP2005260285A (en) Data compression apparatus
JP2015149113A (en) associative memory
JP2589884B2 (en) Bit search circuit

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20151006

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160810

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160906

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20161020

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: 20170124

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170127

R150 Certificate of patent or registration of utility model

Ref document number: 6085187

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees