This application is based upon and claims the benefit of priority from prior Japanese Patent Application No. 2004-017429, filed Jan. 26, 2004, the entire contents of which are incorporated herein by reference.
1. Field of the Invention
The present invention relates to an associative-memory apparatus which is used for an apparatus for information processing such as color or gray scale image compression and image recognition, and which has a function of searching for data in which the Manhattan distance is a minimum by fully-parallel processing.
2. Description of the Related Art
In recent years, in the field of information processing, in particular, of image compression and image recognition, an associative memory apparatus having a function of searching for minimum distance data has been given attention. The associative memory apparatus is one of the typical memories having a function of searching for data most similar (closest) to input information data (search data) from among a plurality of reference data registered in advance. Then, due to the excellent searching function, the associative memory apparatus is expected, when the associative memory apparatus is used for an application requiring a pattern matching function such as image compression and image recognition described above, to be able to greatly improve the performance of the pattern matching.
Here, the distance means a degree of inconsistency when search data and reference data are compared with one another, and it has been known that there are mainly the Hamming distance and the Manhattan distance. Given that the search data is SW={SW1, SW2, . . . , SWW}, and the reference data stored in i row of the memory is REFi={REFi1, REFi2, . . . , REFiW}, the Hamming distance between the ith reference data and the search data is expressed by:
The Manhattan distance follows:
The Hamming distance DHamm is mainly used for recognizing data sequences, sound, characters, and the like, and the Manhattan distance DManh is used for color or gray scale image compression/image recognition. As the fully-parallel type associative memory apparatuses which have been developed until now, a distance calculating circuit for searching for the a Hamming distance has been realized (refer to Document 1). However, there is no fully-parallel type associative memory apparatus in which a function of searching for the Manhattan distance needed for color or gray scale image compression/image recognition, or the like is realized at the memory region of the associative memory.
On the other hand, a system in which the Manhattan distance is encoded by using an associative memory for searching for the Hamming distance has been proposed (refer to Document 2). However, in this system, the circuit area is rapidly made large when the number of bits of each pattern is greater than or equal to 4 bits, and there is the problem that the electric power consumption increases accompanying with an increase in the circuit area. Further, in order to realize a Manhattan distance calculating circuit, it suffices that a circuit of calculating the absolute value of difference between the search data and the reference data is realized. However, in the case of using a subtracter (an adder) or an absolute value calculating circuit which have been conventionally known, there is the defect that the circuit scale (the number of transistors) become large.
An object of the present invention is to provide an associative memory apparatus which can realize a search for the Manhattan distance needed for color or gray scale image compression/image recognition at high speed and with a small area circuit by fully-parallel processing, and which is for searching for data in which the Manhattan distance is a minimum.
According to the present invention, there is provided an associative memory apparatus for searching reference data REF most similar to search data SW which is input with the same unit structure, from among W×R (W and R are arbitrary natural numbers) of reference data REF which are registered in advance in a memory region and which are respectively made to be units in k-bit (k1) units, on the basis of an index of a Manhattan distance, the apparatus comprising:
In accordance with the present invention, a reduction in a circuit scale and accelerating of calculating processing can be realized because all of the calculations of the absolute value of difference in the calculation of a Manhattan distance are realized by addition processing on the basis of a complement 2's, and a circuit configuration is scaled down due to it being determined whether an output signal is inverted by a carrying signal of the least significant bit, or 1 is added to the sum total of the outputs, by using dual signals (non-inversion signal and inversion signal) of a bit line of the search data existing at a unit storage circuit. As a result, by applying the present invention to the associative memory apparatus, a search of a minimum Manhattan distance can be realized with a chip configuration at a low electric power consumption and with a small area.
In this way, in the present invention, in a fully-parallel associative memory base system, a Manhattan distance calculating circuit needed for color and gray scale image compression/image recognition, or the like, is developed, and a minimum Manhattan distance searching associative memory apparatus at a low electric power consumption and with a small area is realized. In particular, the circuit configuration can make a highly efficient fully-parallel associative memory apparatus be a chip by using a conventional CMOS technology with respect to a pattern matching application (for example, a network router, code book base data compression, and object recognition).
Additional objects and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objects and advantages of the invention may be realized and obtained by means of the instrumentalities and combinations particularly pointed out hereinafter.
The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate presently preferred embodiments of the invention, and together with the general description given above and the detailed description of the preferred embodiments given below, serve to explain the principles of the invention.
Hereinafter, best modes for carrying out the present invention will be described in detail with reference to the drawings.
Fully-Parallel Type Associative Memory Architecture
The memory region 100 is configured of W×R of unit storage circuits (unit storage: US) formed from SRAM cells for storing reference data in units (k bits), W×R of unit comparison circuits (unit comparison: UC) for calculating an absolute value of a difference between the reference data and the search data, i.e., a Manhattan distance, for each unit, and R of word weight comparison circuits (word comparison: WC) for converting the calculated distance into an analog voltage (or electric current).
A signal C (comparison signal) generated at the word weight comparison circuit WC enters the WLA circuit 200, and the WLA circuit 200 controls the signal C with the balance of the circuit itself, and amplifies the differences of the voltages between the respective rows to the maximums at the first stage. The WLA circuit 200 and the WTA circuit 300 have the feature that a ratio of an increase in areas with respect to the number of rows R becomes a linear O(R) with respect to the number of rows R.
The WTA circuit 300 has a function of further amplifying the differences between voltage outputs LA of the respective rows amplified by the WLA circuit 200. With respect to the output M of the WTA circuit 300, a winner row is “1” digital signal, and the other loser rows are “0” digital signals. The WLA circuit 200 accelerates feedback by using a voltage follower circuit built in the WLA circuit 200 at the time of returning a feedback signal F to the word weight comparison circuit WC.
Manhattan Distance Calculating Circuit
The Manhattan distance calculating circuit used for the associative memory apparatus of the present invention is a circuit in which W of units corresponding to k bits (k>1) that data to be dealt with are encoded are arranged as shown in
A Manhattan distance is used for image data processing by which comparison between the k-bit W of data such as a color image, a gray scale image, and the like is required. In order to realize the calculation of a Manhattan distance, there is required a circuit for carrying out a comparison between the weighted search data (SW) and the reference data (REFi), i.e., a circuit (absolute-value-of-difference calculating circuit |SWi-REFij|) which generates absolute values of the differences between two k-bit data of W of the respective units.
Generally, the k-bit subtracter 11 and the absolute value calculating circuit 12 shown in
30×(k−1)+12×(k+1)+2×k+6×k=50k−18 (number of transistors) (4),
and the number of transistors is many, and calculation of sign bits is required.
Then, in the present invention, a circuit in which the number of transistors is not many and the calculation of the absolute value of difference (Manhattan distance calculation) is carried out is provided for an associative memory. Further, this absolute-value-of-difference calculating circuit is built into the fully-parallel type associative memory as an unit comparison circuit UC, and all of the outputs of W of the absolute-value-of-difference calculating circuit are inputted to the word weight comparison circuit WC and processed thereat, whereby the calculation of a Manhattan distance between the search data and the reference data is realized.
The absolute-value-of-difference calculating circuit of the present invention is basically formed from two of the addition circuit and the bit inversion circuit.
A truth table of the subtraction circuit (addition circuit) used in the absolute-value-of-difference calculating circuit is shown in Table 1.
Yi = SW ⊕ {overscore (REFi)}) · Ci−1 (k > 1)
Ci = ({overscore (SWi ⊕ REFi)}) · ({overscore (REFi)}) + (SWi ⊕ {overscore (REFi)}) · Ci−1
On the other hand, in the associative memory apparatus, the SRAM cell of the unit storage circuit US is operated by dual signals (non-inversion signal SW and inversion signal ˜SW) of the bit line. Therefore, in the present invention, on the basis of the calculating method of
In the unit comparison circuit UCij, the respective cell output data REF1, REF2, . . . , REFk are transmitted to XOR circuits A1, A2, . . . , Ak which operate an exclusive OR, and are outputted so as to be inverted/non-inverted in accordance with bit data corresponding to the respective bit data SWi,j1, SWi,j2, . . . , SWi,jk (non-inversion signal and inversion signal) of the k-bit search data. Accordingly, subtraction between the bits of the search data and the reference data is realized by addition processing.
The calculating circuit at each bit is configured of portions of XOR circuits B2, . . . , Bk, carry generation circuits D1, D2, . . . , Dk, and XOR circuits E1, E2, . . . , Ek. The XOR circuits B2, . . . , Bk carry out addition processing due to the exclusive OR of the bit output to which the unit storage circuit US corresponds and carrying data from less significant bits C1, C2, . . . , Ck−1. The carry generation circuits D1, D2, . . . , Dk have a selector configuration in which carrying data to the more significant bit Ck (=Cmax) is generated by selecting and outputting one of the inversion bit input of the above-described search data and the carrying data from less significant bits in accordance with an operated result of the above-described XOR circuits A1, A2, . . . , Ak. The XOR circuits E1, E2, . . . , Ek are for inverting the addition processed results of the respective bits when the carrying data of the most significant bit is 0. With respect to only the least significant bit (LSB), because there is no carrying from the lower digit, the XOR circuit B for addition output is not required. Further, when the carrying output Cmax of the most significant bit carry generation circuit Dk is 1, a signal is added to the match line of the word weight comparison circuit WCi in order to add 1 to the calculated result. In accordance therewith, carrying processing due to +1 can be realized with a simple circuit configuration. Furthermore, in accordance with the above configuration, calculation of the absolute value of difference due to the addition processing of a complement 2's described in
With respect to the number of transistors of the Manhattan distance calculating circuit of the invention, the circuit scale can be reduced by efficiently using the inversion signal in the memory. Further, 1 addition processing in the case of SW>REF can be realized with a simple structure. For example, in the circuit configuration of
20×(k−1)+16+2=20k−2 (number of transistors) (5),
and a great reduction of about ⅖ of 50k−18 which is the number of transistors in accordance with a conventional method can be realized.
Table 2 shows the comparison of the circuit scales in a case of realizing a Manhattan distance by a Hamming distance system (refer to Document 2) and in a case of realizing a Manhattan distance directly by the present invention.
Comparisons of circuit scales in cases of being realized by a system for encoding Hamming distance and by Manhattan distance system directly
Table 2A shows an example of encoding of a Manhattan distance by a Hamming distance, and Table 2B shows the relationships between distance indices and circuit scales. In particular, in Table 2B, there is shown the relationship between the number of transistors and the number of bits k which are respectively required in the cases by a method (system 1) for realizing the Manhattan distance search directly by the circuit and a method (system 2) for realizing the Manhattan distance search by encoding a Hamming distance.
The cost for this mapping (encoding) is 2k−1 with respect to the number of bits k. Therefore, although a delay time does not affect on the reduction, a tradeoff arises with respect to a magnitude of the advantage in area. Because the actual number of transistors for the subtraction per bit and the absolute value calculating circuit is 18, the number of transistors reduced at the memory region of the associative memory core by mapping can be obtained by the following conditional expression (6).
9(2k−1)=the number of transistors (in case of encoding: system 2)<24k+2k number of transistors (in case of non-encoding: system 1) (6)
When mapping (encoding) is carried out with respect to the Manhattan distance search on the Hamming distance associative memory by solving Formula (6) with respect to k, it is possible make an area of the associative memory core small without increasing a minimum distance searching time up to a k≦3 bit binary number. However, in the case of k>3 bits, a circuit area can be greatly reduced by directly realizing the Manhattan distance calculating circuit in the associative memory.
Design of Associative Memory LSI for Searching Minimum Manhattan Distance
5-bit minimum Manhattan distance searching associative memory according to the invention was designed by using a three-layered wiring 0.35 μm CMOS technology, an experimental manufacture of chip was carried out, and the performance thereof was evaluated. A layout of the designed 128 columns×80 rows (k=5 bits×W=16 units) of associative memory is shown in
In order to evaluate the performance of the associative memory for searching the minimum Manhattan distance which was designed and experimentally manufactured, a circuit simulation using a circuit simulator HSPICE was carried out. The result of the time (winner searching time) for searching the reference data of the minimum Manhattan distance due to the HSPICE simulation is shown in
In
The measured results of the chip which was experimentally manufactured are shown in
Note that the logic of the circuit shown in
The associative memory apparatus according to the present invention can be used for general compression and recognition processing techniques such as an artificial intelligence system, a data bank system, an Internet router, a mobile terminal (for example, a mobile video telephone), code book base data, compression, and object recognition, etc.
Additional advantages and modifications will readily occur to those skilled in the art. Therefore, the invention in its broader aspects is not limited to the specific details and representative embodiments shown and described herein. Accordingly, various modifications may be made without departing from the spirit or scope of the general inventive concept as defined by the appended claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
2004-017429 | Jan 2004 | JP | national |