Control method of approximate adder circuit based on memristor and approximate adder device
By dividing the n-bit approximate addition process into n-wheel approximate addition subprocess, and using 2n+1 memristor and one resistor, an approximate adder circuit based on memristor is designed, which solves the problem of many devices and operating steps in the prior art, and realizes approximate addition operations with high calculation accuracy and low circuit complexity.
Patent Information
- Application Number
- CN202510361286.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-03-26
AI Technical Summary
While the existing memristor-based approximate adders achieve high calculation accuracy, there are many devices and operating steps, making it difficult to achieve efficient calculations under less resource conditions.
An approximate adder circuit based on memristors was designed. By dividing the n-bit approximate addition process into n-wheel approximate addition subprocesses, each operation only takes 3 steps, and an approximate addition operation is achieved using 2n+1 memristor and one resistor.
While reducing the number of devices and operating steps, the calculation accuracy of approximate addition operations is significantly improved and the circuit layout is optimized, suitable for high-density integrated applications.
Smart Images

Figure CN119883183A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of microelectronic devices, and more specifically, relates to a control method of an approximate adder circuit based on a memristor and an approximate adder device. Background Art
[0002] With the rapid development of artificial intelligence and big data technologies, high-performance computing has put forward higher energy efficiency and performance requirements for hardware systems. Due to the separation of storage and computing units in the traditional von Neumann architecture, frequent data movement causes the system to face problems such as "storage wall" and "power consumption wall", which seriously limits the improvement of computing efficiency. In-memory computing technology greatly reduces the delay and energy consumption caused by data transmission by directly performing computing operations in the storage unit, and has become an important research direction to break through the bottleneck of traditional computing architecture. As a new type of non-volatile memory, memristor has great application potential due to its high density, low power consumption and compatibility with CMOS process. Memristor can not only be used to store data, but also realize logical computing functions through its resistive switching characteristics.
[0003] Approximate adders are widely used in image processing, artificial intelligence, signal processing and other fields as a design that can optimize performance while tolerating certain computational errors. The core idea is to reduce power consumption, shorten computational delays and reduce chip area by simplifying the circuit structure at the expense of some accuracy. In particular, image processing tasks such as edge detection, image compression and filtering operations require relatively low computational accuracy, so approximate adders can achieve efficient data processing with low resource consumption.
[0004] The design of the approximate adder based on memristors provides a new hardware solution by combining the advantages of in-memory computing and the flexibility of approximate computing. However, the existing memristor-based approximate adder is implemented based on the Essential Implied Logic (IMPLY) logic. Although the approximate Boolean logic expression is relatively simple, it sacrifices high calculation accuracy. Therefore, the calculation accuracy of the proposed approximate algorithm needs to be further improved. At the same time, it is limited by the inefficient logic synthesis capability of IMPLY logic, and the number of devices and operation steps required are relatively large. Summary of the invention
[0005] In view of the above defects or improvement needs of the prior art, the present invention provides a control method and an approximate adder device of an approximate adder circuit based on a memristor, which are used to solve the technical problem that the prior art cannot realize approximate addition operations with higher calculation accuracy under the condition of using fewer devices and operation steps.
[0006] In order to achieve the above-mentioned object, in a first aspect, the present invention provides a control method of an approximate adder circuit based on a memristor, for realizing an n-bit number an ......a2a1 and b n ......approximate addition of b2b1; wherein the approximate adder circuit comprises: a resistor and 2n+1 identical memristors; the negative electrode of each memristor is connected to the same source line SL; one end of the source line SL is suspended, and the other end is connected to one end of the resistor; n≥1; The above control method includes: Select n memristors from 2n+1 memristors and write logic values a1~ a respectively. n ; Select a memristor from the remaining memristors and write the input carry c1; the remaining memristors that have not been set are all set to high impedance state; Execute n rounds of approximate addition sub-processes in sequence; In the i-th round of approximate addition subprocess, the following operations are performed: In the first time period, the logic value a will be written i The memristor is used as the first memristor, and a voltage -V is applied to its positive terminal; the stored carry c i The memristor with a value set is used as the second memristor, and its positive electrode is left floating; a memristor is selected from the unset memristors as the third memristor, and a voltage V is applied to its positive electrode. P ; Apply a voltage with an amplitude of 0 to the other end of the resistor; At this time, a carry is obtained in the third memristor ; In a second time period after the first time period, a voltage VV is applied to the positive electrode of the first memristor. P ; Apply voltage V to the positive electrode of the second memristor P ; Float the positive electrode of the third memristor; Apply a voltage of -V to the other end of the resistor; At this time, the summation result is obtained in the second memristor ; Where i=1,2,...,n; when the logical value b i When the logic value is 0, V is 0; when the logic value is b i When it is 1, V is V P ; V P Meet V set / 2 <V P <V set , and V P <2|V reset |;V set V is the threshold value of the memristor changing from high resistance state to low resistance state; reset is the threshold value of the memristor changing from a low resistance state to a high resistance state; s n ...s2s1 and c n+1 This is the desired n-bit number a n ......a2a1 and bn ......The approximate addition result of b2b1.
[0007] In a second aspect, the present invention provides an approximate adder device for implementing an n-bit number a n ......a2a1 and b n ...approximate addition of b2b1, comprising: an approximate adder circuit and a control module; The approximate adder circuit includes: a resistor and 2n+1 identical memristors; the negative electrodes of each memristor are connected to the same source line SL; one end of the source line SL is suspended, and the other end is connected to one end of the resistor; n≥1; The control module is used to execute the control method provided by the first aspect of the present invention.
[0008] Further preferably, the resistance value of the resistor is between the high resistance state resistance value and the low resistance state resistance value of the memristor.
[0009] Further preferably, the resistance value of the resistor ; Among them, R H is the high-resistance resistance of the memristor, R L is the low-resistance resistance value of the memristor.
[0010] Further preferably, the above memristors include a high resistance state and a low resistance state, the high resistance state corresponds to a logic value "0", and the low resistance state corresponds to a logic value "1".
[0011] In a third aspect, the present invention provides a control system, comprising: a memory and a processor, wherein the memory stores a computer program, and the processor executes the control method provided in the first aspect of the present invention when executing the computer program.
[0012] In a fourth aspect, the present invention further provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is executed by a processor, the device where the storage medium is located is controlled to execute the control method provided in the first aspect of the present invention.
[0013] In a fifth aspect, the invention further provides a computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the control method provided in the first aspect of the invention.
[0014] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects: 1. The first aspect of the present invention provides a control method for an approximate adder circuit based on a memristor, for realizing two n-bit numbers a n ......a2a1 and b n...approximate addition of b2b1, resulting in the sum s n ......s2s1 and carry out c n+1 The controlled approximate adder circuit includes only 2n+1 memristors and one resistor, and the n-bit approximate addition process is divided into initialization and n rounds of approximate addition sub-processes, and each round of approximate addition sub-process performs a 1-bit approximate addition operation; wherein, in each round of approximate addition sub-process, the first memristor, the second memristor and the third memristor are selected, and the logic value a i Defined as the resistance state of the first memristor, the logic value c i Defined as the resistance state of the second memristor, logic value b i The voltage input terminal of the first memristor and the source line SL is defined in the form of voltage, and the resistance states of the second memristor and the third memristor are used as outputs. Only three operations are required, namely, setting the states of the first memristor and the second memristor and applying voltage to the memristor and the resistor, to realize the 1-bit approximate addition operation, so that the actual operation steps required for the entire approximate adder circuit are only 2n+1 steps; and for the 1-bit approximate addition operation, calculation errors occur only in two input cases, and the approximate error is small; compared with the existing n-bit approximate adder, the present invention can realize the approximate addition operation with higher calculation accuracy under the condition of using fewer devices and operation steps.
[0015] 2. The second aspect of the present invention provides an approximate adder device, comprising: an approximate adder circuit and a control module; wherein the approximate adder circuit only comprises 2n+1 memristors and one resistor, and the control module controls the approximate adder circuit through the control method provided by the first aspect of the present invention to realize two n-bit numbers a n ......a2a1 and b n ...The approximate addition of b2b1 can significantly improve the calculation accuracy of the approximate addition operation while reducing the number of devices and operation steps. At the same time, the present invention also realizes a circuit layout with low complexity and small area with a simple structure, which has significant advantages in high-density integrated applications.
[0016] 3. The approximate adder device provided by the present invention makes full use of the non-volatile characteristics of the memristor. After the approximate addition operation is completed, the result is directly stored in the memristor, eliminating additional data transmission and storage steps, significantly optimizing energy consumption performance and shortening operation delay.
[0017] 4. Furthermore, in the approximate adder device provided by the present invention, the resistance value of the resistor is , in order to better distinguish the low-resistance state, high-resistance state and resistance value of the memristor, further improving the reliability of the calculation. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A schematic diagram of the structure of a 1-bit approximate adder device provided in Embodiment 1 of the present invention.
[0019] Figure 2 A schematic diagram of the structure of an n-bit approximate adder device provided in Embodiment 2 of the present invention.
[0020] Figure 3 This is a schematic diagram of the structure of a 4-bit serial approximate adder device provided in Embodiment 2 of the present invention. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0022] In order to achieve the above-mentioned object, in a first aspect, the present invention provides a control method of an approximate adder circuit based on a memristor, for realizing an n-bit number a n ......a2a1 and b n ......approximate addition of b2b1; wherein the approximate adder circuit comprises: a resistor and 2n+1 identical memristors; the negative electrode of each memristor is connected to the same source line SL; one end of the source line SL is suspended, and the other end is connected to one end of the resistor; n≥1; The above control method includes: Select n memristors from 2n+1 memristors and write logic values a1~ a respectively. n ; Select a memristor from the remaining memristors and write the input carry c1; the remaining memristors that have not been set are all set to high impedance state; Execute n rounds of approximate addition sub-processes in sequence; In the i-th round of approximate addition subprocess, the following operations are performed: In the first time period, the logic value a will be written i The memristor is used as the first memristor, and a voltage -V is applied to its positive terminal; the stored carry c i The memristor with a value set is used as the second memristor, and its positive electrode is left floating; a memristor is selected from the unset memristors as the third memristor, and a voltage V is applied to its positive electrode. P ; Apply a voltage with an amplitude of 0 to the other end of the resistor; At this time, a carry is obtained in the third memristor ; In a second time period after the first time period, a voltage VV is applied to the positive electrode of the first memristor. P ; Apply voltage V to the positive electrode of the second memristor P ; Float the positive electrode of the third memristor; Apply a voltage of -V to the other end of the resistor; At this time, the summation result is obtained in the second memristor ; Where i=1,2,...,n; when the logical value b i When the logic value is 0, V is 0; when the logic value is b i When it is 1, V is V P ; V P Meet V set / 2 <V P <V set , and V P <2|V reset |;V set V is the threshold value of the memristor changing from high resistance state to low resistance state; reset is the threshold value of the memristor changing from a low resistance state to a high resistance state; s n ...s2s1 and c n+1 This is the desired n-bit number a n ......a2a1 and b n ......The approximate addition result of b2b1.
[0023] In a second aspect, the present invention provides an approximate adder device for implementing an n-bit number a n ......a2a1 and b n ...approximate addition of b2b1, comprising: an approximate adder circuit and a control module; The approximate adder circuit includes: a resistor and 2n+1 identical memristors; the negative electrodes of each memristor are connected to the same source line SL; one end of the source line SL is suspended, and the other end is connected to one end of the resistor; n≥1; The control module is used to execute the control method provided by the first aspect of the present invention.
[0024] In an optional implementation manner, the resistance value of the resistor is between the high resistance state resistance value and the low resistance state resistance value of the memristor. ; Among them, R H is the high-resistance resistance of the memristor, R L is the low-resistance resistance value of the memristor.
[0025] In an optional implementation manner, the above-mentioned memristors all include a high resistance state and a low resistance state, the high resistance state corresponds to a logic value "0", and the low resistance state corresponds to a logic value "1".
[0026] The related technical solution is the same as the control method provided in the first aspect of the present invention, and will not be described in detail here.
[0027] In a third aspect, the present invention provides a control system, comprising: a memory and a processor, wherein the memory stores a computer program, and the processor executes the control method provided in the first aspect of the present invention when executing the computer program.
[0028] The related technical solution is the same as the control method provided in the first aspect of the present invention, and will not be described in detail here.
[0029] In a fourth aspect, the present invention further provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is executed by a processor, the device where the storage medium is located is controlled to execute the control method provided in the first aspect of the present invention.
[0030] The related technical solution is the same as the control method provided in the first aspect of the present invention, and will not be described in detail here.
[0031] In a fifth aspect, the invention further provides a computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the control method provided in the first aspect of the invention.
[0032] The related technical solution is the same as the control method provided in the first aspect of the present invention, and will not be described in detail here.
[0033] In order to further illustrate the control method of the memristor-based approximate adder circuit and the corresponding approximate adder device provided by the present invention, the following is a detailed description in conjunction with specific embodiments: Example 1 In this embodiment, n is set to 1, and a 1-bit approximate adder device is provided for calculating the value of the input logic value c. i 、a i 、b i Perform approximate addition (to achieve logical value a i , Logic b i and input carry c i approximate addition of Figure 1 As shown, it includes: an approximate adder circuit and a control module; wherein the approximate adder circuit includes: a memristor M1, a memristor M2, a memristor M3 and a resistor (a fixed value resistor is used in this embodiment); the initial state of the memristor M3 is a high impedance state; the control module includes: a controller 1 and a controller 2.
[0034] Controller 1 is connected to the positive electrodes of memristor M1, memristor M2 and memristor M3 respectively; the negative electrodes of memristor M1, memristor M2 and memristor M3 are all connected to the same source line SL; one end of the source line SL is suspended, and the other end is connected to controller 2; a resistor is connected to the source line SL, one end of which is connected to the control end of the source line SL, and the other end is connected to the negative electrode of the memristor closest to the control end of the source line.
[0035] The controller 1 includes a control terminal BL1, a control terminal BL2 and a control terminal BL3. The control terminal BL1 is connected to the positive electrode of the memristor M1, the control terminal BL2 is connected to the positive electrode of the memristor M2, and the control terminal BL3 is connected to the positive electrode of the memristor M3. When the controller 1 performs a similar addition operation, a voltage V that varies with time is applied to the memristor M1, the memristor M2 and the memristor M3 through the control terminal BL1, the control terminal BL2 and the control terminal BL3. BL1 , voltage V BL2 and voltage V BL3 When the controller 2 performs similar addition operation, it applies a voltage V that changes with time to the source line SL. SL It should be noted that the above memristors M1, M2 and M3 are completely identical, and all include a high resistance state and a low resistance state, the high resistance state corresponds to a logic value "0", and the low resistance state corresponds to a logic value "1".
[0036] The controller 1 is used to set the memristor M1 to a logic value a before performing the approximate addition operation. i The corresponding resistance state, memristor M2 is set to logic value c i The corresponding resistance state, memristor M3 is set to a high resistance state; when performing similar addition operations, a voltage V that varies with time is applied to memristor M1, memristor M2, and memristor M3 respectively. BL1 , voltage V BL2 and voltage V BL3 .
[0037] The controller 2 is used to keep the grounding before performing the approximate addition operation; when performing the approximate addition operation, a voltage V that varies with time is applied to the source line SL. SL .
[0038] Among them, the value of each control terminal input voltage is determined by the logic b i Specifically, the approximate addition calculation process includes a first time period and a second time period after the first time period; the voltage that changes with time is reflected in different values in the first time period and the second time period. In the first time period, the voltage V BL1 The value is -V, the control terminal BL2 is floating, and the voltage V BL3 The value is V P , voltage V SLThe value is 0. In the second time period, the voltage V BL1 The value is VV P , voltage V BL2 The value is V P , the control terminal BL3 is floating, the voltage V SL The value is -V; when the logical value b i When the logic value is 0, V is 0; when the logic value is b i When it is 1, V is V P ; Since the electrical signals used in the approximate addition process are all voltage pulse signals, in order to prevent the memristor in the high-resistance state from changing to the low-resistance state when no operation is performed, at the same time, when 2V is added to both ends of the memristor P When the voltage drops, the memristor is guaranteed to change its resistance state, and the voltage V P The amplitude should be between V set / 2 and V set In addition, in order to prevent the memristor in the low-resistance state from changing to the high-resistance state when no operation is performed, V P <2|V reset |. Based on this, V P Need to meet V set / 2 <V P <V set , and V P <2|V reset |. V set V is the threshold value of the memristor changing from high resistance state to low resistance state; reset is the threshold value at which the memristor changes from a low-resistance state to a high-resistance state.
[0039] Furthermore, in order to clearly distinguish the low resistance state, high resistance state and resistance value of the memristor, a memristor with a switching ratio greater than or equal to a preset switching threshold is used. In this embodiment, the preset switching threshold value is 100. The resistance value of the resistor is between the high resistance state and the low resistance state of the memristor. Since the high resistance state and the low resistance state of the memristor are at different orders of magnitude, in order to further clearly distinguish the low resistance state, high resistance state and resistance value of the memristor, preferably, the resistance value of the resistor is , where R H is the high-resistance resistance of the memristor, R L is the resistance value of the low resistance state of the memristor. The fixed value resistor mainly plays the role of current limiting in this logic circuit; further, considering that the high resistance state and low resistance state of the memristor have a certain fluctuation range, the resistance value R can be selected to be slightly larger than The result provides better guarantee for the reliability of the circuit.
[0040] Specifically, the control method of the approximate adder circuit in the above-mentioned 1-bit approximate adder device is used to realize the logic value a i , Logic b i and input carry c i The approximate addition of the summation result s i and carry output c i+1 , including the following steps: S1, set the memristor M1 to logic value a i The corresponding resistance state, memristor M2 is set to logic value c i The corresponding resistance state, the memristor M3 is set to its initial state high resistance state; S2: When performing approximate addition, in the first time period, a voltage V is applied to the memristor M1. BL1_1 = -V, control terminal BL2 is floating, and voltage V is applied to memristor M3 BL3_1 = V P , apply voltage V to the source line SL_1 = 0; at this time, a carry is obtained in the third memristor ; S3: In the second time period, a voltage V is applied to the memristor M1. BL1_2 = VV P , apply voltage V to memristor M2 BL2_2 = V P , the control terminal BL3 is floating, and the voltage V is applied to the source line SL_2 = -V; at this time, the summation result is obtained in the second memristor ; Among them, when the logical value b i When the logic value is 0, V is 0; when the logic value is b i When it is 1, V is V P ; V P Meet V set / 2 <V P <V set , and V P <2|V reset |;V set V is the threshold value of the memristor changing from high resistance state to low resistance state; reset is the threshold value at which the memristor changes from a low-resistance state to a high-resistance state.
[0041] It should be noted that the control method in the 1-bit approximate adder device provided in this embodiment only includes 3 actual operation steps. Table 1 shows the voltage configuration in each actual operation step under different logic inputs. Specifically, since the initial state of the memristor is a high impedance state when it is initially used, there is no need to set the memristor M3 to a high impedance state. Therefore, S1 only includes setting the memristor M1 to a logic value a.i The corresponding resistance state and the memristor M2 are set to the logic value c i The corresponding resistance state operation corresponds to step 1 in Table 1; S2 and S3 implement a 1-bit approximate addition function by applying corresponding voltages, corresponding to steps 2 and 3 in Table 1.
[0042] In order to make the technical solution and advantages of this embodiment more clear, this embodiment provides eight input conditions of a 1-bit approximate adder and the resistance changes measured in an actual circuit. In this embodiment, the resistance R is 10 kΩ, and the switching ratio of the memristor is greater than or equal to 100, so that the resistance values of the low resistance state, high resistance state and fixed resistance R of the memristor can be clearly distinguished.
[0043] It should be noted that the two outputs of the precise full adder are expressed as and ; The present invention improves the calculation speed of approximate addition by simplifying the carry generation process while maintaining a certain accuracy. The proposed approximate addition scheme can be expressed as and .
[0044] Table 2 shows the operation truth table of a 1-bit approximate adder. It can be seen from the table that compared with the precise adder, the present invention only has calculation errors in two input conditions. The specific operation and memristor state are as follows: The initialization state of memristor M3 is high impedance state; When inputting a i = 0, b i = 0, c i = 0, V = 0, memristor M1 is set to high impedance, memristor M2 is set to high impedance, and during step 2, the voltage V across memristor M1 is M1 is approximately 0, the voltage V across the memristor M2 M2 is approximately 0, the voltage V across the memristor M3 M3 About V P ; Memristor M2 remains in high impedance state, and memristor M3 remains in high impedance state; During step 3, the voltage V across memristor M1 M1 About -V P , the voltage V across the memristor M2 M2 About V P , the voltage V across the memristor M3 M3 is approximately 0; memristor M2 remains in a high impedance state, and memristor M3 remains in a high impedance state, that is, the result of the 1-bit addition is s i = 0, c i+1 = 0; When inputting a i = 0, b i = 0, c i = 1, V = 0, memristor M1 is set to high impedance, memristor M2 is set to low impedance, and during step 2, the voltage V across memristor M1 is M1 is approximately 0, the voltage V across the memristor M2 M2 is approximately 0, the voltage V across the memristor M3 M3 About V P ; Memristor M2 remains in a low resistance state, and memristor M3 remains in a high resistance state; During step 3, the voltage V across memristor M1 M1 About -2V P , the voltage V across the memristor M2 M2 About V P , the voltage V across the memristor M3 M3 is approximately 0; memristor M2 remains in a low resistance state, and memristor M3 remains in a high resistance state, that is, the result of the 1-bit addition is s i = 1, c i+1 = 0; When inputting a i = 0, b i = 1, c i = 0, V = V P , memristor M1 is set to high impedance state, memristor M2 is set to high impedance state, during step 2, the voltage V across memristor M1 M1 About -V P , the voltage V across the memristor M2 M2 is approximately 0, the voltage V across the memristor M3 M3 About V P ; Memristor M2 remains in high impedance state, and memristor M3 remains in high impedance state; During step 3, the voltage V across memristor M1 M1 About V P , the voltage V across the memristor M2 M2 About 2V P , the voltage V across the memristor M3 M3 is approximately 0; memristor M2 is converted to a low-resistance state, and memristor M3 remains in a high-resistance state, that is, the 1-bit addition result is s i = 1, c i+1 = 0; When inputting a i = 0, b i = 1, c i = 1, V = V P , memristor M1 is set to high impedance state, memristor M2 is set to low impedance state, during step 2, the voltage V across memristor M1 M1About -V P , the voltage V across the memristor M2 M2 is approximately 0, the voltage V across the memristor M3 M3 About V P ; Memristor M2 remains in a low resistance state, and memristor M3 remains in a high resistance state; During step 3, the voltage V across memristor M1 M1 About V P , the voltage V across the memristor M2 M2 About 2V P , the voltage V across the memristor M3 M3 is approximately 0; memristor M2 remains in a low resistance state, and memristor M3 remains in a high resistance state, that is, the result of the 1-bit addition is s i = 1, c i+1 = 0; When inputting a i = 1, b i = 0, c i = 0, V = 0, memristor M1 is set to low impedance, memristor M2 is set to high impedance, and during step 2, the voltage V across memristor M1 is M1 is approximately 0, the voltage V across the memristor M2 M2 is approximately 0, the voltage V across the memristor M3 M3 About V P ; Memristor M2 remains in high impedance state, and memristor M3 remains in high impedance state; During step 3, the voltage V across memristor M1 M1 About -V P , the voltage V across the memristor M2 M2 About 2V P , the voltage V across the memristor M3 M3 is approximately 0; memristor M2 is converted to a low-resistance state, and memristor M3 remains in a high-resistance state, that is, the 1-bit addition result is s i = 1, c i+1 = 0; When inputting a i = 1, b i = 0, c i = 1, V = 0, memristor M1 is set to low impedance, memristor M2 is set to high impedance, and during step 2, the voltage V across memristor M1 is M1 is approximately 0, the voltage V across the memristor M2 M2 is approximately 0, the voltage V across the memristor M3 M3 About V P ; Memristor M2 remains in a low resistance state, and memristor M3 remains in a high resistance state; During step 3, the voltage V across memristor M1 M1 About -V P, the voltage V across the memristor M2 M2 About 2V P , the voltage V across the memristor M3 M3 is approximately 0; memristor M2 remains in a low resistance state, and memristor M3 remains in a high resistance state, that is, the result of the 1-bit addition is s i = 1, c i+1 = 0; When inputting a i = 1, b i = 1, c i = 1, V = 0, memristor M1 is set to low impedance, memristor M2 is set to high impedance, and during step 2, the voltage V across memristor M1 is M1 About -V P , the voltage V across the memristor M2 M2 is approximately 0, the voltage V across the memristor M3 M3 About 2V P ; Memristor M2 remains in high resistance state, and memristor M3 is converted to low resistance state; During step 3, the voltage V across memristor M1 M1 About V P , the voltage V across the memristor M2 M2 About V P , the voltage V across the memristor M3 M3 is approximately 0; memristor M2 remains in a high-resistance state, and memristor M3 remains in a low-resistance state, that is, the result of the 1-bit addition is s i = 0, c i+1 = 1; When inputting a i = 1, b i = 1, c i = 1, V = V P , memristor M1 is set to low resistance state, memristor M2 is set to low resistance state, during step 2, the voltage V across memristor M1 M1 About -V P , the voltage V across the memristor M2 M2 is approximately 0, the voltage V across the memristor M3 M3 About 2V P ; Memristor M2 remains in low resistance state, and memristor M3 is converted to low resistance state; During step 3, the voltage V across memristor M1 M1 About V P , the voltage V across the memristor M2 M2 About V P , the voltage V across the memristor M3 M3 is approximately 0; memristor M2 remains in a low resistance state, and memristor M3 remains in a low resistance state, that is, the 1-bit addition result is s i= 1, c i+1 = 1; Based on the above operations, the 1-bit approximate adder operation method provided in this embodiment can effectively control the logic output according to the 1-bit approximate adder operation truth table shown in Table 2; wherein, , .
[0045] In summary, this embodiment operates an approximate adder composed of a memristor and a fixed resistor. By setting the memristor and configuring different operating voltages at the control end, a 1-bit approximate adder circuit operation can be realized in three steps. The present invention has the characteristics of a small number of devices, simple operating steps, and a compact structure, and provides reliable support for the implementation of complex logical operations. Specifically, this embodiment discloses a 1-bit approximate adder device based on a memristor, including three identical memristors and a fixed resistor. By setting the memristor and configuring the three control ends (BL1, BL2, BL3) and the source line (SL) of the circuit, the approximate adder logic function can be realized in three steps. Among them, the positive electrodes of memristors M1, M2 and M3 are connected to different bit lines (BL1, BL2, BL3), and the negative electrodes of memristors M1, M2 and M3 are connected to the same source line SL; one end of the fixed resistor is connected to the control end of the source line SL, and the other end is connected to the negative electrode of the memristor closest to the control end of the source line. In the logic calculation, an input logic value a i Defined as the resistance state of memristor M1, the other input logic value b i Defined in the form of voltage at the control terminals BL1 and SL, input logic value c i It is defined as the resistance state of memristor M2, and the resistance states of memristor M2 and memristor M3 are used as outputs. While improving computing efficiency, it effectively saves circuit area and helps support the realization of more complex logic functions.
[0046] Example 2 In this embodiment, n is an integer greater than 1, and an n-bit approximate adder device is provided to implement two n-bit numbers a n ......a2a1 and b n ...approximate addition of b2b1, resulting in the sum s n ......s2s1 and carry out c n+1 ,like Figure 2 As shown, it includes: an approximate adder circuit and a control module; wherein the approximate adder circuit includes: 2n+1 identical memristors and a resistor (a fixed value resistor is used in this embodiment); the control module includes: controller 1 and controller 2.
[0047] Similarly, in this embodiment, the memristor includes a high resistance state and a low resistance state; the high resistance state corresponds to a logic value "0", and the low resistance state corresponds to a logic value "1". The resistance value of the resistor is between the high resistance state and the low resistance state of the memristor, preferably , where R H is the high-resistance resistance of the memristor, R L is the low-resistance resistance value of the memristor.
[0048] Specifically, the controller 1 is connected to the positive electrode of each memristor respectively; the negative electrode of each memristor is connected to the same source line SL; one end of the source line SL is suspended, and the other end is connected to the controller 2; the resistor is connected to the source line SL, one end of which is connected to the control end of the source line SL, and the other end is connected to the negative electrode of the memristor closest to the control end of the source line; The controller 1 is used to divide the n-bit approximate addition process into initialization and n rounds of approximate addition sub-processes; each round of approximate addition sub-process performs a 1-bit approximate addition operation; specifically, the following operations are performed: Initialization: Select n memristors from 2n+1 memristors and write logic values a1~ a respectively. n ; Select a memristor from the remaining memristors and write the input carry c1; the remaining memristors that have not been set are all set to high impedance state. For ease of operation, this embodiment will addends a1~ a n Write the first n memristors, write the input carry c1 into the n+1th memristor, and initialize the remaining n memristors to a high impedance state; the input carry c1 can be 0 or 1; in this embodiment, c1 = 0; The first round of approximate addition sub-process: the memristor storing a1 among the first n memristors is used as the first memristor, the n+1th memristor storing c1 is used as the second memristor, and the n+2th memristor without a value is selected as the third memristor to perform 1-bit approximate addition; specifically, the following steps are performed: in the first time period, a voltage V is applied to the positive electrode of the first memristor. BL1_1 = -V, making the positive electrode of the second memristor float; applying voltage V to the positive electrode of the third memristor BL3_1 = V P ; Apply a voltage V with an amplitude of 0 to the other end of the resistor SL_1 ; At this time, a carry is obtained in the third memristor ; In a second time period after the first time period, a voltage V is applied to the positive electrode of the first memristor BL1_2 = VV P ; Apply voltage V to the positive electrode of the second memristor BL2_2 = V P ; Make the positive electrode of the third memristor float; Apply voltage V to the other end of the resistorSL_2 = -V; at this time, the summation result is obtained in the second memristor ; The i-th round of approximate addition sub-process: store a in the first n memristors i The memristor is used as the first memristor, and the n+ith memory c i The memristor is used as the second memristor to store c i+1 The n+i+1th memristor is used as the third memristor to perform 1-bit approximate addition. The specific operation is the same as the first round of approximate addition sub-process, which will not be described here; i=1,2,...,n; After the nth to 1th round of approximate addition sub-process operation, the resistance state of the second memristor is the approximate sum of the two n-bit numbers s. n ......s2s1; After the nth round of approximate addition sub-process operation, the resistance state of the third memristor is the carry output c of the approximate addition of two n-bit numbers n+1 ;s n ...s2s1 and c n+1 This is the desired n-bit number a n ......a2a1 and b n ......The approximate addition result of b2b1.
[0049] As in Example 1, when the logic value b i When the logic value is 0, V is 0; when the logic value is b i When it is 1, V is V P ; V P Meet V set / 2 <V P <V set , and V P <2|V reset |;V set V is the threshold value of the memristor changing from high resistance state to low resistance state; reset is the threshold value at which the memristor changes from a low-resistance state to a high-resistance state.
[0050] It should be noted that the n-bit serial approximate adder is obtained by expanding the 1-bit approximate adder described in Example 1, but it is only an expansion of the memristor part. The entire n-bit serial approximate adder includes only one resistor. The specific operating principle is the same as that of Example 1 and is not repeated here. The actual operation steps required for the entire n-bit serial approximate adder are 2n+1 steps. This solution is not only compact in area and easy to expand, but also can maintain low circuit complexity and short delay after expansion.
[0051] In order to make the technical solution of this embodiment clearer, specifically, taking a 4-bit serial approximate addition circuit as an example, the following description is given: like Figure 3 The 4-bit serial approximate adder device provided by the present invention requires a resistor, 9 memristors and 9 steps to implement 4-bit serial approximate addition. , , , , ; Wherein, BL1-BL9 are connected to memristors M1-M9 respectively; Based on the expanded serial approximate adder circuit, the present invention also provides a control method for a 4-bit serial approximate adder circuit, which is used to implement the approximate addition of two 4-bit numbers a4a3a2a1 and b4b3b2b1, and obtain the sum result s4s3s2s1 and the carry output c5; Specifically, the above serial approximate addition method includes the following 9 practical operation steps; Step 1, write the addends a1, a2, a3, and a4 into the first four memristors M1, M2, M3, and M5 respectively, write c1 into the fifth memristor M5, and initialize the remaining four memristors to a high impedance state; Step 2: Select the memristor M1 storing a1 as the first memristor, select the memristor M5 storing c1 as the second memristor, and select the memristor M6 to store the c2 to be generated as the third memristor; apply V to the first memristor. BL1_1 = -V, float the BL control terminal of the second memristor, and apply V to the third memristor BL3_1 = V P , voltage V SL_1 The value is 0; after the operation is completed, the resistance of the third memristor is The logical value of Step 3: Apply V to the first memristor BL1_2 = VV P , apply V to the second memristor BL2_2 = V P , making the BL control terminal of the third memristor float, the voltage V SL_2 The value is -V; after the operation is completed, the resistance of the second memristor is The logical value of b i When the logic value is 0, V is 0; when the logic value is b i When it is 1, V is V P ; Step 4: Select the memristor M2 storing a2 as the first memristor, select the memristor M6 storing c2 as the second memristor, and select the memristor M7 to store the c3 to be generated as the third memristor; apply V to the first memristor.BL1_1 = -V, float the BL control terminal of the second memristor, and apply V to the third memristor BL3_1 = V P , voltage V SL_1 The value is 0; after the operation is completed, the resistance of the third memristor is The logical value of Step 5: Apply V to the first memristor BL1_2 = VV P , apply V to the second memristor BL2_2 = V P , the BL control terminal of the third memristor is floating, and the voltage V SL_2 The value is -V; after the operation is completed, the resistance of the second memristor is When the logic value b2 is 0, V is 0; when the logic value b2 is 1, V is V P ; Step 6: Select the memristor M3 storing a3 as the first memristor, select the memristor M7 storing c3 as the second memristor, and select the memristor M8 to store the c4 to be generated as the third memristor; apply V to the first memristor. BL1_1 = -V, float the BL control terminal of the second memristor, and apply V to the third memristor BL3_1 = V P , voltage V SL_1 The value is 0; after the operation is completed, the resistance of the third memristor is The logical value of Step 7: Apply V to the first memristor BL1_2 = VV P , apply V to the second memristor BL2_2 = V P , the BL control terminal of the third memristor is floating, and the voltage V SL_2 The value is -V; after the operation is completed, the resistance of the second memristor is When the logic value b3 is 0, V is 0; when the logic value b3 is 1, V is V P ; Step 8: Select the memristor M4 storing a4 as the first memristor, select the memristor M8 storing c4 as the second memristor, and select the memristor M9 to store the c4 to be generated as the third memristor; apply V to the first memristor. BL1_1 = -V, float the BL control terminal of the second memristor, and apply V to the third memristor BL3_1 = V P , voltage V SL_1 The value is 0; after the operation is completed, the resistance of the third memristor is The logical value of Step 9: Apply V to the first memristor BL1_2 = VV P , apply V to the second memristor BL2_2 = V P , the BL control terminal of the third memristor is floating, and the voltage V SL_2 The value is -V; after the operation is completed, the resistance of the second memristor is When the logic value b4 is 0, V is 0; when the logic value b4 is 1, V is V P ; It should be noted that the above four steps 2-3, 4-5, 6-7 and 8-9 are similar approximate addition sub-processes, the difference being that different three memristors are selected to perform approximate addition calculations of different bits; It should be further explained that the circuit structure and operation process of other n-bit approximate adders based on the present invention are similar to the logical operation process of the 4-bit serial approximate adder, which will not be described in detail here.
[0052] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A control method for an approximate adder circuit based on a memristor, characterized in that: Used to implement n-bit number a n ......a2a1 and b n ...approximate addition of b2b1; the approximate adder circuit comprises: a resistor and 2n+1 identical memristors; the negative electrodes of each memristor are connected to the same source line SL; one end of the source line SL is suspended, and the other end is connected to one end of the resistor; n≥1; The control method comprises: Select n memristors from 2n+1 memristors and write logic values a1~ a respectively. n ; Select a memristor from the remaining memristors and write the input carry c1; the remaining memristors that have not been set are all set to high impedance state; Execute n rounds of approximate addition subprocesses in sequence; wherein, in the i-th round of approximate addition subprocess, perform the following operations: In the first time period, the logic value a will be written i The memristor is used as the first memristor, and a voltage -V is applied to its positive terminal; the stored carry c i The memristor with a value set is used as the second memristor, and its positive electrode is left floating; a memristor is selected from the unset memristors as the third memristor, and a voltage V is applied to its positive electrode. P ; Apply a voltage with an amplitude of 0 to the other end of the resistor; At this time, a carry is obtained in the third memristor ; In a second time period after the first time period, a voltage VV is applied to the positive electrode of the first memristor. P ; Apply voltage V to the positive electrode of the second memristor P ; Float the positive electrode of the third memristor; Apply a voltage of -V to the other end of the resistor; At this time, the summation result is obtained in the second memristor ; Where i=1,2,...,n; when the logical value b i When the logic value is 0, V is 0; when the logic value is b i When it is 1, V is V P ; V P Meet V set / 2 < V P < V set , and V P < 2|V reset |;V set V is the threshold value of the memristor changing from high resistance state to low resistance state; reset is the threshold value of the memristor changing from a low resistance state to a high resistance state; s n ...s2s1 and c n+1 This is the desired n-bit number a n ......a2a1 and b n ......The approximate addition result of b2b1.
2. An approximate adder device, characterized in that: Used to implement n-bit number a n ......a2a1 and b n ...approximate addition of b2b1, comprising: an approximate adder circuit and a control module; The approximate adder circuit comprises: a resistor and 2n+1 identical memristors; the negative electrodes of each memristor are connected to the same source line SL; one end of the source line SL is suspended, and the other end is connected to one end of the resistor; n≥1; The control module is used to execute the control method described in claim 1.
3. The approximate adder device according to claim 2, characterized in that: The resistance value of the resistor is between the high resistance value and the low resistance value of the memristor.
4. The approximate adder device according to claim 3, characterized in that: The resistance value of the resistor ; Among them, R H is the high-resistance resistance of the memristor, R L is the low-resistance state resistance value of the memristor.
5. The approximate adder device according to any one of claims 2 to 4, characterized in that: The memristors include a high resistance state and a low resistance state, the high resistance state corresponds to a logic value "0", and the low resistance state corresponds to a logic value "1".
6. A control system, characterized in that: include: A memory and a processor, wherein the memory stores a computer program, and the processor executes the control method according to claim 1 when executing the computer program.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed by a processor, the device where the storage medium is located is controlled to execute the control method of claim 1.
8. A computer program product, characterized in that The invention comprises a computer program / instruction, which implements the control method of claim 1 when executed by a processor.
Citation Information
Patent Citations
Multi-system additive operation circuit based on memristors and operation method thereof
CN105739944A
Accuracy configurable adders and methods
US20140059105A1
Approximate computing based tensor processing unit (APTPU)
US20250045240A1
Cited By
4-2 approximate compressor based on memristor, control method, device and application
CN120601893A