A single-sample learning similarity calculation circuit and method

By designing a single sample learning similarity calculation circuit based on TCAM and ferroelectric diodes, the energy consumption and delay problems caused by data transmission in single sample learning are solved, and efficient feature storage and similarity calculation are realized, improving the performance and reliability of the circuit.

CN114638279BActive Publication Date: 2025-05-27ZHEJIANG LAB
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210097706.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-27
Publication Date
2025-05-27
Estimated Expiration
2042-01-27

AI Technical Summary

Technical Problem

In the prior art, the repeated transmission of data between the CPU/GPU and DRAM during the single sample learning process leads to high energy consumption and time delay, and the existing TCAM circuits have problems such as large device deviations, high write power consumption, and low durability.

Method used

A single-sample learning similarity calculation circuit is designed, using the complete module of the TCAM peripheral circuit and the diode storage and matching module, and using two three-dimensional stackable ferroelectric diodes that are fully compatible with CMOS as the basic unit structure to realize feature storage and similarity calculation.

Benefits of technology

It effectively reduces the energy consumption and delay caused by data transmission, improves computing speed and storage density, reduces power consumption and hardware costs, and improves the stability and durability of the circuit.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114638279B_ABST
    Figure CN114638279B_ABST
Patent Text Reader

Abstract

The present invention relates to the fields of memory technology and machine learning, and in particular to a circuit and method for calculating similarity of single-sample learning. A three-state content addressable memory (TCAM) circuit based on a ferroelectric diode is used to store features extracted by a memory-enhanced neural network (MANN) in single-sample learning and perform similarity calculation. The similarity is calculated inside the TCAM circuit and then returned to a processor, thereby reducing energy consumption and delay caused by data transmission between a computing unit and a memory in a traditional computer von Neumann architecture. In the TCAM circuit of the present invention, only two three-dimensional stackable ferroelectric diodes that are fully compatible with CMOS are used to form a basic unit structure, thereby realizing fast similarity calculation and category prediction. Compared with other TCAM circuits, the circuit is compact, energy-saving, stable and reliable, has high storage density and long read-write life, and can effectively reduce the hardware cost and power consumption of similarity calculation in single-sample learning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical fields of memory and machine learning, and particularly to a single-sample learning similarity calculation circuit and method. Background Art

[0002] Single-sample learning in meta-learning can complete the classification of unknown samples with only a small number of pictures, greatly reducing its dependence on labeled data. During the single-sample learning process, it is usually implemented by combining a convolutional neural network and a memory-augmented network. The convolutional neural network is trained using a training set to obtain a network model. Then, the support set and the test set are input into the network model to obtain the feature vectors of the corresponding classes and the unknown class. After that, these vectors are input into the memory-augmented network to calculate the similarity between the unknown vector and the class vector, and the class corresponding to the test set is obtained according to the most similar situation. During the similarity calculation process of the support set and the test set, a large amount of energy consumption and latency are brought about by the repeated transmission of data between the CPU / GPU and the DRAM. Therefore, the content-addressable memory CAM can be used as a memory module to store the obtained feature vectors and directly calculate the similarity inside the memory, thereby effectively avoiding the repeated transmission of data, effectively reducing the inference time, and reducing the energy consumption.

[0003] There are various circuit designs for the content-addressable memory CAM. Currently, there are two types of addressable memories applied to single-sample learning, namely, the TCAM using 2T-2R RRAM and the TCAM based on two ferroelectric field-effect transistors. The TCAM based on 2T-2R RRAM is fully compatible with the CMOS process and has a smaller area than the CAM with 16 transistors using the traditional CMOS process. However, it has problems such as large device deviation, high write power consumption and long write time, low durability in use, and poor retention. The TCAM based on two ferroelectric field-effect transistors only uses two transistors and is voltage-driven, with low write power consumption, simple circuit design, and small storage cell area. However, it has deficiencies such as poor durability in use, high requirements for process deviation, and long similarity calculation time. Summary of the Invention

[0004] In order to solve the above technical problems existing in the prior art, the present invention proposes a single-sample learning similarity calculation circuit and method, which have the advantages of high integration and storage density, low read and write power consumption, fast calculation speed, simple structure, and stable and durable performance. The specific technical solutions are as follows:

[0005] A single-sample learning similarity calculation circuit consists of a complete TCAM peripheral circuit module and a diode storage and matching module. The basic unit structure of the diode storage and matching module uses two three-dimensional stackable ferroelectric diodes that are fully compatible with CMOS. The complete TCAM peripheral circuit module includes a match line control module, a search line control module, and a register calculation module. The match line control module is used to drive the match line and control the voltage of the match line. The search line control module is used to drive the search line and control the voltage of the search line. The diode storage and matching module is a TCAM array composed of multiple layers of M rows * N columns of TCAM unit circuit sub-modules, search lines, match lines, and match line sense amplifiers. Each layer of the TCAM array can reuse the complete TCAM peripheral circuit module to control the match line and search line, and register and calculate the matching result. The register calculation module includes a register to register the searched matching result, and a counting and calculation unit for calculating the similarity and outputting the final result.

[0006] Further, the TCAM unit circuit sub-module uses two ferroelectric diodes, which are connected by a match line ML and two search lines SL. The ferroelectric diode uses TIN as the substrate, and silicon dioxide SiO 2 is stacked on the HZO layer, and a TIN top is deposited thereon by atomic layer deposition technology ALD.

[0007] Further, the ferroelectric diode is a non-linear diode with a volt-ampere characteristic. After scanning a positive voltage, the current changes from low to high, and the state changes from a negative diode to a positive diode. After scanning a negative voltage, its state changes from a positive diode to a negative diode.

[0008] Further, the ferroelectric diode can store tri-state contents of 0, 1, and X using its volt-ampere characteristic. Specifically: Using the volt-ampere characteristic of the ferroelectric diode, the features are stored in the TCAM array in the states of binary signals 1 and 0. When the signal is 1, the ferroelectric diode is turned on, and when the signal is 0, the ferroelectric diode is turned off. The ferroelectric diode has another X state. In the X state, regardless of whether the state on the search line is 1 or 0, it is regarded as a match.

[0009] A single-sample learning similarity calculation method includes the following steps:

[0010] Step 1: Set a training set, a support set, and a test set through a publicly available data set. The number of categories in the support set is K. Train a network model through the training set, then input the support set and the test set into the trained network model to obtain feature vectors, and then quantize the feature vectors and map them to the integer range of [0, N].

[0011] Step 2: Process the quantized support set feature vectors and test set feature vectors using the thermometer coding method, convert the decimal numbers in the range of [0, N] into M-bit binary signal features composed of 0 and 1. The encoded support set feature vectors are input and stored row by row in the TCAM unit circuit sub-module in the diode storage and matching module, and the encoded test set feature vectors are input through the search line control module to prepare for the start of search and matching;

[0012] Step 3: Match the binary signal features input in the search line control module with the binary signal features stored in the TCAM unit circuit sub-module bit by bit and dimension by dimension in parallel, and store the matching results in the register in sequence;

[0013] Step 4: In the register calculation module, the counting and calculation unit reads the matching results in the register unit, calculates the similarity between each stored feature and the test set feature using the Hamming distance, obtains the category most similar to the test sample, and outputs the result.

[0014] Further, the thermometer coding method is specifically as follows: for the feature vectors in the integer range of [0, N], convert them into M-bit binary numbers. For the numbers of size L in the range of [0, N], their 0 to M-L bits are represented by 0, and the M-L to M bits are represented by 1.

[0015] Further, the parallel bit-by-bit and dimension-by-dimension matching of the binary signal features input in the search line control module with the binary signal features stored in the TCAM unit circuit sub-module specifically includes the following steps:

[0016] Step 3.1, first, through the matching line control module, pre-charge the matching line voltage to GND, and input the encoded test set feature vectors through the search line control module;

[0017] Step 3.2, process each row of the TCAM unit circuit sub-module in a layer in parallel, and the matching of each row is synchronized. Perform the matching in units of P bits in sequence until the M-bit matching of this row is completed; if the stored information in the TCAM unit circuit sub-module matches the level information on the search line, that is, both are 1 or both are 0, or the ferroelectric diode is in the X state, the matching line will remain in the GND state; if the stored information in the TCAM unit circuit sub-module does not match the level information on the search line, that is, one is 1 and the other is 0, the matching line will be pulled up to the Vdd voltage;

[0018] Step 3.3, after the matching of each TCAM unit circuit sub-module is completed, the matching line voltage will be output through the matching line sense amplifier MLSA and stored in the register.

[0019] Step 3.4, after the processing of the current layer is completed, the next layer is processed in sequence until all layers are completed.

[0020] Further, the fourth step specifically includes:

[0021] Step 4.1, use d(x, y) to represent the Hamming distance between the stored feature x and the test set feature y. For two binary features x and y of the same length, compare each bit one by one. If the corresponding digits of the current bit are different, then d(x, y) is incremented by one. The final result of d(x, y) is the Hamming distance, representing the similarity difference between the two features;

[0022] Step 4.2, in the circuit, the matching results of K M-bit C-dimensional features are all stored in the register one by one. Use a counting unit to count the high level in each feature matching result, that is, the number of unmatched ones d(x, y) = count1(register), to obtain the Hamming distance d(x, y) between the current feature and the test feature;

[0023] Step 4.3, in the circuit, for the K stored features, a total of K d(x, y) values are obtained. Use a calculation unit to compare these K values. The x corresponding to the minimum Hamming distance Min(d(x, y)) is the category of y;

[0024] Step 4.4, output the category of y to obtain the category result of the test sample.

[0025] The advantages and beneficial effects of the present invention are as follows:

[0026] The present invention can be effectively applied to the feature storage and similarity calculation process in one-shot learning, reducing the energy consumption loss caused by the repeated transmission of data between the memory and the calculation unit. Compared with other TCAM circuits applied to one-shot learning, the circuit of the present invention only uses two diodes, has a small storage unit area, a simple structure, and the design of the diode 3D array greatly improves the storage density. The ferroelectric diode realizes low read / write power consumption, high durability and stability, and the 3D stacking process is conducive to large-scale integration and more meets the scenario requirements of one-shot learning. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 is a schematic structural diagram of the circuit module of the present invention;

[0028] Figure 2 is a schematic structural diagram of the TCAM unit circuit sub-module of the present invention;

[0029] Figure 3 is a schematic internal structure diagram of the ferroelectric diode of the present invention;

[0030] Figure 4is a graph showing the volt-ampere characteristic of a ferroelectric diode of the present invention;

[0031] Figure 5 It is a schematic diagram of the single sample learning similarity calculation process of the present invention. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical scheme and technical effect of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.

[0033] The present invention proposes a circuit for single sample learning similarity calculation, such as Figure 1 As shown in the figure, it consists of a TCAM (Ternary Content Addressable Memory) peripheral circuit complete module and a diode storage and matching module. Its specific structure includes:

[0034] A match line control module, used for driving the match line and performing voltage control on the match line;

[0035] A search line control module, used for driving the search line and performing voltage control on the search line;

[0036] The diode storage and matching module is used to realize storage and search functions. It is a multi-layer 3D structured ferroelectric diode array, specifically a TCAM array composed of multi-layer M rows * N columns of TCAM unit circuit sub-modules, search lines, match lines, match line sensing amplifiers, etc. In this example, 8 layers * 4 rows * 8 columns are used as an example; each layer of the TCAM array can reuse other modules to control the match lines and search lines and store and calculate the matching results. Figure 1 The middle is a floor plan of one of the floors;

[0037] The storage calculation module includes a register for storing the matching result of the search, a counting and calculation unit for performing similarity calculation and outputting the final result.

[0038] Wherein, the diode storage and matching module is composed of TCAM unit circuit submodules, such as Figure 2 As shown, two ferroelectric diodes are used, through a matching line ML and two search lines SL, The array and driver are the basic units of the TCAM unit circuit submodule. This example matches in units of 1 bit, that is, each basic unit constitutes a TCAM unit circuit submodule, and each TCAM unit circuit submodule implements a 1-bit matching task. 4*8 TCAM unit circuit submodules constitute a complete TCAM array to implement the complete feature storage or search function of the diode storage and matching module.

[0039] Specifically, the core devices in the TCAM cell circuit sub-module are two ferroelectric diodes. The ferroelectric diode is a stackable 8-layer 3D hafnium-based ferroelectric diode highly compatible with CMOS. The specific internal structure is as Figure 3 shown. Using TIN as the substrate, silicon dioxide SiO 2 is stacked on the HZO layer, and a TIN top is deposited thereon by atomic layer deposition (ALD). Using this internal structure, an 8-layer 3D vertical ferroelectric diode array is arranged. In this TIN / HZO / TIN device, Schottky-Ohmic contacts are formed, resulting in diode-like conduction. The ferroelectric diode is a non-linear diode, and the potential energy will change accordingly in different polarization directions. After scanning a positive voltage, the current changes from low to high, and the state changes from a negative diode to a positive diode; after scanning a negative voltage, its state changes from a positive diode to a negative diode.

[0040] The volt-ampere characteristics of the ferroelectric diode are as Figure 4 shown. Using its volt-ampere characteristics in different voltage changes, it is possible to store tristate content of 0, 1, and X, realizing the storage function of feature vectors. The specific implementation method of the storage function is as follows: Using the volt-ampere characteristics of the ferroelectric diode, the features are stored in the TCAM array through the ferroelectric diode in the states of binary signals 1 and 0. When the signal is 1, the diode conducts; when the signal is 0, the ferroelectric diode turns off. In addition, this ferroelectric diode has an X state. In the X state, regardless of whether the state on the search line is 1 or 0, it is regarded as a match.

[0041] The single-sample learning similarity calculation method based on the above circuit, its specific implementation process is as Figure 5 shown, including the following steps:

[0042] Step 1: Set the training set, support set, and test set through a publicly available dataset. Train the memory-augmented neural network (MANN) with the training set, then input the support set and test set into the trained network model to obtain feature vectors, and then quantize the feature vectors and map them to the integer range of [0, N], where N is an integer.

[0043] Assume that the number of categories in the support set is K. Among them, the images obtain K feature vectors with the number of channels C through the trained single-sample learning network model. C represents the dimension. Perform the same operation on the test set and map the feature vectors to the integer range of [0, N].

[0044] Specifically, the publicly available Omniglot dataset is selected. This dataset contains 1,623 characters, with 20 image samples for each character. 1,300 characters are used as the training set, and the remaining characters are used as the support set and the test set. First, the neural network is preliminarily trained using the training set to obtain a network model. Then, a support set with images of K categories is used. For the sake of illustration, in this example, 4 categories are used for introduction. After the support set is input into the network model, 4 three-dimensional feature vectors are obtained; similarly, after the test set is input into the network model, 1 three-dimensional feature vector is obtained; the feature vectors are quantized to nine values, mapping them from the original 32-bit floating-point numbers to the integer range of [0, 8].

[0045] Step 2: The quantized support set feature vectors and test set feature vectors are processed using the thermometer coding method to convert the decimal numbers in the range of [0, N] into binary signals M-bit C-dimensional features composed of 0 and 1. The encoded support set feature vectors are stored by being input row by row into the diode storage and matching module, and the encoded test set feature vectors are input through the search line control module to prepare for starting the search and matching.

[0046] Specifically, the quantized support set feature vectors and test set feature vectors are processed using the thermometer coding method to be converted into 8-bit binary signals composed of 0 and 1. The encoded support set feature vectors are stored by being input row by row into the diode storage and matching module, and the encoded test set feature vectors are input through the search line control module to prepare for starting the search and matching.

[0047] The specific thermometer coding method is as follows: For the feature vectors in the integer range of [0, 8], they are converted into 8-bit binary numbers; for the numbers of size L in the range of [0, 8], their 0 to M - L bits are represented by 0, and the M - L to M bits are represented by 1. For example, the number 6 is represented as 00111111.

[0048] Step 3: The M-bit C-dimensional binary signals input in the search line are matched bit by bit and dimension by dimension in parallel with the K M-bit C-dimensional binary signals stored in the TCAM unit circuit sub-module of the diode storage and matching module, and the matching results are sequentially stored in the register.

[0049] Specifically, 1 three-dimensional 8-bit binary signal input in the search line is matched bit by bit with the 4 three-dimensional (each dimension of the feature has one layer, that is, 3 layers out of 8 layers are used) 8-bit binary signals stored in the TCAM unit circuit sub-module, and the matching results are sequentially stored in the register.

[0050] More specifically, the matching operation between the search line and the stored signals in Step 3 includes the following steps:

[0051] Step 3.1: First, through the match line control module, the match line voltage is pre-charged to GND, and the encoded test set feature vector is input through the search line control module.

[0052] Step 3.2: Process the TCAM cell circuit sub-modules in each row of one layer in parallel. The matching of each row is carried out synchronously, and the matching is performed bit by bit in sequence until the 8-bit matching of the row is completed; if the stored information of the TCAM cell circuit sub-module matches the level information on the search line, that is, both are 1 or both are 0, or the ferroelectric diode is in the X state, the match line will remain in the GND state; if the stored information of the TCAM cell circuit sub-module does not match the level information on the search line, that is, one is 1 and the other is 0, the match line will be pulled up to the Vdd voltage.

[0053] The change of the match line voltage state during matching is achieved by the following method: when the signal stored on the ferroelectric diode is 0 and the ferroelectric diode is in the off state, if the signal on the search line is 0 at this time and the two match, the voltage on the match line remains in the GND state; if the signal on the search line is 1 and the two do not match, the voltage on the match line will be charged to VDD. Similarly, when the signal stored on the ferroelectric diode is 1, if the signal on the search line is 1 and the two match, the voltage on the match line remains in the GND state; if the signal on the search line is 0 and the two do not match, the voltage on the match line will be charged to VDD.

[0054] Step 3.3: After the matching of each TCAM cell circuit sub-module is completed, the match line voltage will be output through the match line sense amplifier MLSA and stored in the input register.

[0055] Step 3.4: After the processing of the current layer is completed, the next layer is processed in sequence until all 3 layers are completed. The completion of the matching of all 4 rows and 8 TCAM cell circuit sub-modules in the 3 layers represents the end of the matching task.

[0056] Step Four: In the register calculation module, the counting and calculation unit reads the matching results in the register unit, calculates the similarity between each stored feature and the test set feature using the Hamming distance, obtains the category most similar to the test sample, and outputs the result.

[0057] Specifically, the above Step Four is implemented through the following sub-steps:

[0058] Step 4.1: Let d(x, y) represent the Hamming distance between the stored feature x and the test set feature y. For two binary features x and y with the same length, each bit is compared one by one. If the corresponding digits of the current bit are different, d(x, y) is incremented by one. Finally, the result of d(x, y) is the Hamming distance, indicating the similarity difference between the two features.

[0059] Step 4.2: In the TCAM circuit, the 4 8-bit 3D feature matching results are stored in the registers one by one. The counting unit is used to count the high levels in each feature matching result, that is, the number of non-matched ones d(x, y) = count1(register), and the Hamming distance d(x, y) between the current feature and the test feature is obtained.

[0060] Step 4.3: In the TCAM circuit, for the 4 stored features, 4 d(x, y) values are obtained in total. These 4 values are compared using the computing unit, and the x corresponding to the minimum Hamming distance Min(d(x, y)) is the category of y.

[0061] Step 4.4: Output the category of y to obtain the category result of the test sample.

[0062] The present invention uses a ternary content-addressable memory (TCAM) circuit based on ferroelectric diodes to store the features extracted by the memory-augmented neural network (MANN) in one-shot learning and perform similarity calculation. The similarity is calculated inside the TCAM circuit and then returned to the processor, reducing the energy consumption and latency caused by data transmission between the computing unit and the memory in the traditional computer von Neumann architecture. In the TCAM circuit of the present invention, only two three-dimensional stackable ferroelectric diodes that are fully compatible with CMOS are used to form the basic unit structure, realizing fast similarity calculation and category prediction. Compared with other TCAM circuits, its circuit is compact and energy-saving, stable and reliable, with high storage density and long read / write lifespan, and can effectively reduce the hardware cost and power consumption of similarity calculation in one-shot learning.

[0063] The above is only the preferred embodiment of the present invention and does not impose any form of limitation on the present invention. Although the implementation process of the present invention has been described in detail above, for those familiar with the art, they can still modify the technical solutions recorded in the foregoing examples or make equivalent replacements for some of the technical features. Any modifications, equivalent replacements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A single-sample learning similarity calculation circuit consists of a complete TCAM peripheral circuit module and a diode storage and matching module. The basic unit structure of the diode storage and matching module uses two three-dimensional stackable ferroelectric diodes that are fully compatible with CMOS. The complete TCAM peripheral circuit module includes a match line control module, a search line control module, and a register calculation module. Characterized in that, The match line control module is used to drive the match line and control the voltage of the match line. The search line control module is used to drive the search line and control the voltage of the search line. The diode storage and matching module is a TCAM array composed of multiple layers of M rows * N columns of TCAM unit circuit sub-modules, search lines, match lines, and match line sense amplifiers. Each layer of the TCAM array can reuse the complete TCAM peripheral circuit module to control the match line and search line, and store and calculate the matching results. The register calculation module includes a register to store the searched matching results, and a counting and calculation unit for calculating the similarity and outputting the final result. The TCAM cell circuit sub-module uses two ferroelectric diodes, which are connected through a matching line ML and two search lines SL. The ferroelectric diode uses TIN as the substrate, and silicon dioxide SiO 2 is stacked on the HZO layer, and a TIN top is deposited thereon through atomic layer deposition technology (ALD).

2. A single-sample learning similarity calculation circuit according to claim 1, Characterized in that, The ferroelectric diode is a non-linear diode with a volt-ampere characteristic. After scanning a positive voltage, the current changes from low to high, and the state changes from a negative diode to a positive diode; after scanning a negative voltage, its state changes from a positive diode to a negative diode.

3. A single-sample learning similarity calculation circuit according to claim 2, Characterized in that, The ferroelectric diode can store tri-state content of 0, 1, and X using its volt-ampere characteristic. Specifically: using the volt-ampere characteristic of the ferroelectric diode, the features are stored in the TCAM array of the diode storage and matching module in the form of binary signals 1 and 0. When the signal is 1, the ferroelectric diode is turned on, and when the signal is 0, the ferroelectric diode is turned off. The ferroelectric diode has another X state. In the X state, regardless of whether the state on the search line is 1 or 0, it is regarded as a match.

4. A single-sample learning similarity calculation method using the single-sample learning similarity calculation circuit according to any one of claims 1-3, Characterized in that, It includes the following steps: Step 1: Set the training set, support set, and test set through a publicly available dataset. The number of categories in the support set is K. Train the network model through the training set, then input the support set and test set into the trained network model to obtain feature vectors, and then quantize the feature vectors and map them to the integer range of [0, N]. Step 2: Process the quantized support set feature vectors and test set feature vectors using the thermometer coding method, convert the decimal numbers in the range of [0, N] into M-bit binary signal features composed of 0 and 1. The encoded support set feature vectors are input row by row into the TCAM unit circuit sub-modules in the diode storage and matching module for storage, and the encoded test set feature vectors are input through the search line control module to prepare for the search and match. Step 3: Parallelly match the binary signal features input in the search line control module with the binary signal features stored in the TCAM cell circuit sub-module bit by bit and dimension by dimension in sequence, and store the matching results in the register in sequence; Step 4: In the register calculation module, the counting and calculation unit reads the matching results in the register unit, calculates the similarity between each stored feature and the test set feature using the Hamming distance, obtains the category most similar to the test sample, and outputs the result.

5. A single-sample learning similarity calculation method as described in claim 4, characterized in that, the thermometer coding method is specifically as follows: for the feature vector within the integer range of [0, N], it is converted into an M-bit binary number. For a number of size L within the range of [0, N], its 0 to M-L bits are represented by 0, and its M-L to M bits are represented by 1.

6. A single-sample learning similarity calculation method as described in claim 4, characterized in that, the parallel bit-by-bit and dimension-by-dimension matching of the binary signal features input in the search line control module with the binary signal features stored in the TCAM cell circuit sub-module specifically includes the following steps: Step 3.1, first, through the matching line control module, pre-charge the matching line voltage to GND, and input the encoded test set feature vector through the search line control module; Step 3.2, process the TCAM cell circuit sub-module of each row in a layer in parallel, and the matching of each row is synchronized. Match in sequence in units of Pbit until the M-bit matching of that row is completed; if the stored information in the TCAM cell circuit sub-module matches the level information on the search line, that is, both are 1 or both are 0, or the ferroelectric diode is in the X state, then the matching line will remain in the GND state; if the stored information in the TCAM cell circuit sub-module does not match the level information on the search line, that is, one is 1 and the other is 0, then the matching line will be pulled up to the Vdd voltage; Step 3.3, after the matching of each TCAM cell circuit sub-module is completed, the matching line voltage will be output through the matching line sense amplifier MLSA and stored in the input register; Step 3.4, after the processing of the current layer is completed, process the next layer in sequence until all layers are completed.

7. A single-sample learning similarity calculation method as described in claim 4, characterized in that, Step 4 specifically includes: Step 4.1, represent the Hamming distance between the stored feature x and the test set feature y as d(x, y). For two binary features x and y with the same length, compare each bit one by one. If the corresponding digits of the current bit are different, then add 1 to d(x, y). The final result of d(x, y) is the Hamming distance, indicating the similarity difference between the two features; Step 4.2, in the circuit, the matching results of K M-bit C-dimensional features all exist in the register one by one. Use the counting unit to count the high level in each feature matching result, that is, the number of unmatched ones d(x, y) = count1(register), and obtain the Hamming distance d(x, y) between the current feature and the test feature; Step 4.3, in the circuit, for the K stored features, a total of K d(x, y) values are obtained. These K values are compared using a computing unit, and the x corresponding to the minimum Hamming distance Min(d(x, y)) is the category of y; Step 4.4, output the category of y to obtain the category result of the test sample.

Citation Information

Patent Citations

  • Matching method and matching device of deterministic finite automation based on ternary content addressable memory (TCAM)

    CN102591958A

  • Deterministic finite automaton (DFA) matching method and device based on TCAM (ternary content addressable memory)

    CN103294735A