Method for realizing Manhattan distance measurement based on multi-valued content addressable memory thermometer coding

By using thermometer encoding and FeFET-based MCAM units in MCAM, the high computing cost and delay problems of traditional Manhattan distance measurement methods in hardware implementation are solved, and an efficient and low-overhead Manhattan distance measurement is achieved.

CN120220766APending Publication Date: 2025-06-27PEKING UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510231751.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-28
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

Traditional Manhattan distance measurement methods have high computational costs and delays when implemented in hardware, especially in resource-constrained embedded devices or accelerators with high throughput requirements, and CAM-based methods have high hardware overhead as the number of bits increases.

Method used

Using a thermometer encoding method based on multi-value content addressable memory (MCAM) to design a FeFET-based MCAM cell to achieve efficient Manhattan distance measurement. This method utilizes the multi-value storage capability of MCAM and multi-value thermometer encoding, reducing hardware overhead and improving computing energy efficiency.

Benefits of technology

Efficient Manhattan distance measurement is achieved, reducing hardware overhead, improving computing energy efficiency, and supporting arbitrary bit-number and linear Manhattan distance measurements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120220766A_ABST
    Figure CN120220766A_ABST
Patent Text Reader

Abstract

The invention discloses a method for realizing Manhattan distance measurement based on multi-valued content addressable memory thermometer coding, and belongs to the technical field of novel storage and calculation. According to the multi-valued content addressable memory (MCAM) unit based on the FeFET, the multi-valued storage capacity of the MCAM is utilized, multi-valued thermometer coding is designed, and Manhattan distance measurement of any bit width is efficiently achieved. Compared with a traditional method for realizing Manhattan distance measurement based on binary CAM, the method has the advantages that the number of required CAM units is reduced, the hardware overhead can be greatly reduced, higher area efficiency improvement is brought, and the calculation energy efficiency is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of novel storage and computing technologies, and particularly relates to a method for implementing Manhattan distance measurement based on thermometer coding of a multi - valued content - addressable memory. Background Art

[0002] In recent years, the demand for efficient similarity calculation methods in fields such as computer vision, pattern recognition, data compression, and neural networks has been increasing day by day. Distance measurement is a key link in these applications. Traditional distance measurement methods, such as Euclidean distance, involve square - sum and square - root operations, which have high computational costs and delays in hardware implementation, especially in resource - constrained embedded devices or accelerators with high - throughput requirements. On the other hand, Hamming distance is the simplest distance measurement method, which is used to measure the number of different bits at corresponding positions between two equal - length binary vectors. Since it only involves exclusive - OR and bit - counting operations, the hardware implementation of Hamming distance is simpler and has wide applications in error - correcting coding, information retrieval, and simple pattern matching. However, in advanced machine - learning tasks, such as the classification of complex datasets like face recognition, quantifying the dataset into binary Boolean vectors often leads to significant accuracy loss. To improve the classification accuracy, it is usually necessary to expand each bit of the feature vector into multi - valued information to capture richer feature expressions. In this case, Manhattan distance is widely used in similarity calculation because its measurement method can more accurately measure the differences between multi - valued vectors. In addition, Manhattan distance also has important applications in fields such as urban road planning, data mining, digital image processing, bioinformatics, and sequence analysis. Its core calculation method is to take the absolute value of the difference between corresponding positions of two feature vectors and sum them to quantify the distance between them.

[0003] The hardware implementation of the traditional Manhattan distance metric mainly has two methods: one is based on CMOS digital circuits and the other is based on content-addressable memory (CAM). The design based on CMOS digital circuits uses SRAM for data storage and requires additional subtraction and absolute value calculation circuits. It not only has high hardware overhead but also has high energy consumption overhead. The CAM based on SRAM and new non-volatile memories can achieve highly parallel Manhattan distance calculations inside the CAM array through thermometer coding without the need for additional calculation circuits, thus having higher computational energy efficiency. However, since the number of CAM cells required for thermometer coding increases exponentially with the number of bits of the Manhattan distance, the hardware overhead required for the Manhattan distance metric based on CAM increases with the increase in the number of bits, limiting its practical application scenarios. Recently, by utilizing the multi-value storage capabilities of new non-volatile memories, such as resistive random access memory (RRAM), ferroelectric field-effect transistor (FeFET), etc., the designed multi-value CAM (MCAM) has a higher storage density, providing new possibilities for high-area-efficiency and energy-efficiency Manhattan distance calculation circuits. Summary of the Invention

[0004] In view of the problems existing in the above prior art, the present invention proposes a method for implementing the Manhattan distance metric based on multi-value thermometer coding MCAM (TEMCAM), and designs an MCAM cell based on FeFET that can be used for thermometer coding to efficiently implement the Manhattan distance metric with any bit width, greatly reducing the hardware overhead and improving the computational energy efficiency.

[0005] The technical solution of the present invention is as follows:

[0006] A method for implementing the Manhattan distance metric based on TEMCAM, the specific steps are as follows:

[0007] 1) Adopt a CAM array structure, where each row of MCAM cells corresponds to a storage entry for storing feature vectors. Each row of the CAM array shares a match line (ML), and each column of the CAM array shares a pair of search lines

[0008] 2) For the states 0 to m of the query / entry, it is represented by the first MCAM cell. The first MCAM cell has a total of m + 1 states, that is, encoded as 0…00, 0…01, …, 0…0m; for the states m + 1 to 2m of the query / entry, the first MCAM cell is programmed to the m state and represented by the second MCAM cell, that is, encoded as 0…1m, 0…2m, …, 0…mm; a total of n MCAM cells represent (n·m + 1) states, and the last state n·m is represented as m…mm;

[0009] 3) When performing a search, search signals are applied to all search lines according to a query. Only when the search query and the stored entry are exactly the same, this group of MCAM cells is a perfect match. ML is the off-state current, indicating that the Manhattan distance is 0; when the search query and the stored entry are not the same, ML is related to the number of unmatched cells and the state of the MCAM cells, and as long as the degree of mismatch of the MCAM cells and ML are linearly positively correlated, that is, the Manhattan distance metric between the search vector and the stored vector can be realized.

[0010] Furthermore, the MCAM cell consists of two parallel-connected FeFETs. The voltage programming of the FeFET represents the entry state; for SL, the applied voltage programming represents the query state. Taking the 2-bit MCAM cell as an example to illustrate its working principle, by applying a programming voltage, the threshold voltage (V th ) of the FeFET can be modulated to four states V th0 , V th1 , V th2 , V th3 , and the four voltages are equally spaced. The corresponding four input voltages are V0, V1, V2, V3. For the FeFET in the V th0 state, the four input voltages are respectively applied, and the drain currents of the FeFET are i0, i1, i2, i3, where i3 = 3i1, i2 = 2i1, and both are much larger than i0. By programming the V 1b of F1 and F th to (V th0 , V th3 ), (V th1 , V th2 ), (V th2 , V th1 ), (V th3 , V th0 ) to represent the entry states 0, 1, 2, 3; for , applying (V0, V3), (V1, V2), (V2, V1), (V3, V0) represents the query states 0, 1, 2, 3. Therefore, when the degree of mismatch between the query and the entry is 0, 1, 2, 3 respectively, the currents of the MCAM cell are I0(2i0), I1(i1 + i0), I2(i2 + i0), I3(i3 + i0). Since i1, i2, i3 are all much larger than i0, and i3 = 3i1, i2 = 2i1, the current of the MCAM cell is approximately 0, i1, 2i1, 3i1, which is proportional to the degree of mismatch.

[0011] The present invention proposes a method for implementing Manhattan distance measurement based on TEMCAM. The ferroelectric material therein needs to adopt various HfO2-doped multi-domain ferroelectric materials such as HfO2 doped with Zr (HZO), HfO2 doped with Al (HfAlO), etc. The device gate stack can be based on various structures such as MFMIS, MFIS, and MFS.

[0012] The technical effects of the present invention are as follows:

[0013] 1. The method for implementing Manhattan distance measurement based on TEMCM proposed by the present invention utilizes the multi-value storage ability of MCAM and designs a multi-value thermometer code, which can efficiently implement Manhattan distance measurement. Compared with the traditional method for implementing Manhattan distance measurement based on binary CAM, the number of required CAM cells is reduced, and with the increase of the number of storage states of MCAM cells, higher area efficiency improvement can be brought, thereby improving the computing energy efficiency.

[0014] 2. The method for implementing Manhattan distance measurement based on TEMCM proposed by the present invention further designs an MCAM cell based on FeFET, whose mismatch degree is linearly positively correlated with I ML Combined with the proposed multi-value thermometer code, it can implement Manhattan distance measurement with arbitrary bits and linearity. Each MCAM cell only requires two transistors, further reducing the hardware overhead. Description of the Drawings

[0015] Figure 1 It is a schematic diagram of the array structure and coding method for implementing Manhattan distance measurement based on TEMCAM thermometer coding proposed by the present invention;

[0016] Figure 2 It is a schematic diagram of the circuit structure and operation principle of the MCAM cell in TEMCAM proposed by the present invention;

[0017] Figure 3 It is a schematic diagram of the principle for implementing Manhattan distance measurement by thermometer coding with two 2-bit MCAM cells as a group in TEMCAM proposed by the present invention.

[0018] In the figure: 1 - Schematic diagram of the thermometer coding of two 2-bit MCAM cells; 2 - Schematic diagram of the principle for implementing Manhattan distance measurement Detailed Embodiments

[0019] The following combines the drawings and further elaborates the present invention clearly and completely through specific embodiments.

[0020] The schematic diagram of the array structure and coding method for implementing Manhattan distance measurement based on TEMCAM thermometer coding proposed by the present invention is as Figure 1As shown, TEMCAM adopts a conventional NOR - type CAM array structure. Each row of the CAM array shares a match line (ML), and each column shares a pair of search lines By detecting the magnitude of the current (I ML ) on the ML, the result of the Manhattan distance metric is obtained. Encoding is performed in groups of n MCAM cells. Assuming that the number of states that each MCAM cell can represent is m + 1 (i.e., 0, 1, …, m), the multi - value thermometer encoding method is as follows. For the states 0 to m of the query / entry, they are represented by the first MCAM cell, that is, encoded as 0…00, 0…01, …, 0…0m; for the states m + 1 to 2m of the query / entry, the first MCAM cell is programmed to the m state, and the states are represented by the second MCAM cell, that is, encoded as 0…1m, 0…2m, …, 0…mm; thus, the first MCAM cell has a total of m + 1 states. For each additional MCAM cell, m more states can be added. Then, n MCAM cells can represent a total of (n·m + 1) states, and the last state n·m is represented as m…mm. The traditional thermometer encoding based on binary CAM cells can only increase the number of representable states by increasing the number of bits, and n·m binary CAM cells are required to represent (n·m + 1) states. Therefore, the multi - value thermometer encoding proposed in the present invention can greatly reduce the hardware overhead.

[0021] Figure 2 FIG. is a schematic diagram of the circuit structure and operation principle of the MCAM cell in TEMCAM proposed by the present invention. The MCAM cell consists of two FeFETs (F1 and F 1b ). Taking the 2 - bit MCAM cell as an example, by applying a programming voltage, the threshold voltages (V 1b ) of F1 and F th are programmed to (V th0 , V th3 ), (V th1 , V th2 ), (V th2 , V th1 ), (V th3 , V th0 ) to represent the entry states 0, 1, 2, 3; for the search line Applying (V0, V3), (V1, V2), (V2, V1), (V3, V0) represents query states 0, 1, 2, 3. When the mismatch degrees between query and entry are 0, 1, 2, 3 respectively, the currents of the MCAM unit are I0(2i0), I1(i1 + i0), I2(i2 + i0), I3(i3 + i0). Since i1, i2, i3 are all much larger than i0, and i3 = 3i1, i2 = 2i1, thus the currents of the MCAM unit are approximately 0, i1, 2i1, 3i1, which are proportional to the mismatch degree. On the basis of the MCAM unit, multi-valued thermometer coding is further implemented. Further, by making the input voltage V th0 become smaller and making V th3 become larger, the currents when both the input query and the stored entry are 0 or 3 can be reduced, which helps to improve the linearity of using multi-valued thermometer coding for Manhattan distance measurement.

[0022] Figure 3 The following is the schematic diagram of using two 2-bit MCAM units as a group in the TEMCAM proposed by the present invention to implement thermometer coding for Manhattan distance measurement. Two 2-bit MCAM units can encode 7 states (0, 1,..., 6), and the encoding form is (00, 01,..., 33). Taking the input query state 3 (03) as an example, for the entry states from 0 (00) to 6 (33), I ML are respectively 3I1(I0 + I3), 2I1(I0 + I2), I1(I0 + I1), 0(I0 + I0), I1(I0 + I1), 2I1(I0 + I2), 3I1(I0 + I3), which are proportional to the magnitude of the Manhattan distance. By detecting I ML the result of Manhattan distance measurement can be obtained.

[0023] This embodiment elaborates in a complete and detailed manner the method of implementing Manhattan distance measurement based on TEMCAM thermometer coding, utilizes the multi-valued storage ability of MCAM and designs multi-valued thermometer coding, and designs an MCAM unit based on FeFET. Its mismatch degree is linearly positively correlated with I ML Combined with the proposed multi-valued thermometer coding, it can achieve Manhattan distance measurement with arbitrary number of bits and linearity, reduce the hardware overhead, and improve the computing energy efficiency.

[0024] Finally, it should be noted that the purpose of publishing the embodiments is to help further understand the present invention. However, those skilled in the art can understand that: without departing from the spirit and scope of the present invention and the appended claims, various substitutions and modifications are possible. Therefore, the present invention should not be limited to the content disclosed in the embodiments, and the scope claimed by the present invention is defined by the scope of the claims.

Claims

1. A method for implementing Manhattan distance measurement based on multi-valued content addressable memory thermometer coding, the specific steps comprising the following steps: 1) A CAM array structure is adopted, in which each row of MCAM cells corresponds to a storage entry for storing feature vectors, each row of the CAM array shares a match line ML, and each column of the CAM array shares a pair of search lines SL, SL; 2) For query / entry states 0 to m, the first MCAM unit is used to represent them. The first MCAM unit has m+1 states, which are encoded as 0…00, 0…01, …, 0…0m; for query / entry states m+1 to 2m, the first MCAM unit is programmed to the m state, which is represented by the second MCAM unit, which is encoded as 0…1m, 0…2m, …, 0…mm; n MCAM units represent a total of n·m+1 states, and the last state n·m is represented as m…mm; 3) When searching, the search signal is applied to all search lines according to the query. Only when the search query and the storage entry are completely consistent, the group of MCAM units is completely matched. ML is the off-state current, indicating that the Manhattan distance is 0; when the search query and the storage entry are inconsistent, the mismatch degree of the MCAM unit is ML Linear positive correlation, implementing the Manhattan distance metric between the search vector and the stored vector.

2. The method for implementing Manhattan distance metric based on multi-valued content addressable memory thermometer coding according to claim 1, characterized in that: The MCAM unit consists of two parallel FeFETs. The voltage of the FeFET is programmed to represent the entry state; the voltage applied to SL and SL is programmed to represent the query state.

3. The method for implementing Manhattan distance metric based on multi-valued content addressable memory thermometer coding according to claim 2, characterized in that: The ferroelectric material of the FeFET is HfO2 doped with Zr or HfO2 doped with Al.

4. The method for implementing Manhattan distance metric based on multi-valued content addressable memory thermometer coding according to claim 2, characterized in that: The FeFET is based on MFMIS, MFIS, and MFS structures.