Neuron simulation system and method based on ltspice
By using an LTspice-based neuron simulation system to simulate the electrical impulse behavior of LIF neurons with memristors, the problem of the lack of computer simulation methods in the existing technology is solved, the simulation of neuron models is realized, and research development is promoted.
Patent Information
- Application Number
- CN202311811630.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-26
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2043-12-26
AI Technical Summary
The lack of existing technologies for directly simulating LIF neuron circuits using computers hinders the development of neuron model research.
A neuron simulation system based on LTspice is adopted, including a comparison module, a state module, and a neuron module. Memristors are used to simulate the electrical impulse behavior of LIF neurons, and the simulation of neurons is achieved by cyclic changes in voltage and resistance.
This achievement enabled the simulation of LIF neuron circuits using computers, promoting the development of neuron model research.
Smart Images

Figure CN117787367B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electronic information technology, and more specifically, to a neuron simulation system and method based on LTspice. Background Technology
[0002] In neuron models, the LIF (Leaky Integrate-and-Fire) neuron model is a simplified and commonly used model, especially with significant advantages in large-scale neural network simulation and computation. Memristors are components capable of simulating neuronal behavior, with electrical behavior similar to the electrophysiological characteristics of neurons. Using memristors to implement LIF neurons offers higher simulation accuracy, lower energy consumption, flexibility, and scalability, making memristors an important component for realizing neuromorphic computing. However, current research lacks a memristor variable resistance model, hindering the development of neuron model research due to the absence of a direct computer simulation method for LIF neuron circuits. Summary of the Invention
[0003] To address the aforementioned problems in the prior art, this invention provides a neuron simulation system and method based on LTspice.
[0004] According to a first aspect of the present invention, a neuron simulation system based on LTspice is provided, the system comprising: a comparison module, a state module, and a neuron module; the neuron module comprising: a memristor R1;
[0005] The comparison module is used to obtain the third voltage at the current moment based on the first voltage at the previous moment and the second voltage at the previous moment;
[0006] The state module is used to obtain the first voltage at the current moment based on the third voltage at the current moment;
[0007] The neuron module is used to obtain the second voltage at the current moment based on the third voltage at the current moment, the on-state resistance, and the off-state resistance; wherein the on-state resistance and the off-state resistance are obtained based on the memristor R1;
[0008] The comparison module is also used to obtain the third voltage at the next moment based on the first voltage at the current moment and the second voltage at the current moment, so as to realize the simulation of the neuron.
[0009] Optionally, the neuron module further includes: a first power supply and a load resistor R. load And film capacitor C1; the positive terminal of the first power supply is connected to the first terminal of the memristor R1, the negative terminal of the first power supply is grounded, and the second terminal of the memristor R1 is connected to the load resistor R loadThe first terminal is connected to the load resistor R. load The second terminal is grounded, and the film capacitor C1 is connected in parallel with the memristor R1; the second voltage is the potential difference across the memristor R1.
[0010] The neuron module is also used to obtain the resistance value of memristor R1 at the current moment based on the third voltage, on-state resistance and off-state resistance at the current moment.
[0011] The neuron module is further configured to, based on the voltage of the first power supply and the load resistance R, load The second voltage at the current moment is obtained by combining the resistance value of the memristor R1 at the current moment with the resistance value of the current memristor R1.
[0012] Optionally, the formula for calculating the resistance value of memristor R1 at the current moment is as follows:
[0013] R1=1 / (((1-V3) / Ron)+(V3 / Roff))
[0014] Where R1 is the resistance value of memristor R1 at the current moment, V3 is the voltage value of the third voltage at the current moment, and R on R is the resistance value of the on-state resistor. off The resistance value of the off-state resistor.
[0015] Optionally, the comparison module includes: a second power supply, a third power supply, a comparison resistor R2, a first voltage divider resistor R3, a voltage transmission resistor R4, a second voltage divider resistor R5, and a capacitor C2; the positive terminal of the second power supply is connected to the first end of the first voltage divider resistor R3, and the negative terminal of the second power supply is grounded; the second end of the first voltage divider resistor R3 is connected to the first end of the comparison resistor R2, and the second end of the comparison resistor R2 is grounded; the voltage transmission resistor R4 is connected in parallel with the comparison resistor R2; the first end of the voltage transmission resistor R4 is connected to the first end of the second voltage divider resistor R5, and the second end of the voltage transmission resistor R4 is grounded; the second end of the second voltage divider resistor R5 is connected to the upper plate of the capacitor C2; the lower plate of the capacitor C2 is connected to the positive terminal of the third power supply, and the negative terminal of the third power supply is grounded;
[0016] The comparison module is also used to obtain the resistance value of the comparison resistor R2 at the current moment based on the first voltage at the previous moment and the second voltage at the previous moment;
[0017] The comparison module is also used to obtain the voltage value across the comparison resistor R2 at the current moment based on the second power supply and the first voltage divider resistor R3;
[0018] The comparison module is also used to obtain the voltage value across the voltage transmission resistor R4 at the current moment based on the voltage value across the comparison resistor R2 at the current moment.
[0019] The comparison module is also used to obtain the potential of the upper plate of the capacitor C2 based on the voltage value across the voltage transmission resistor R4 at the current moment and the second voltage divider resistor R5, thereby obtaining the third voltage at the current moment.
[0020] Optionally, the formula for calculating the resistance value of the comparison resistor R2 at the current moment is as follows:
[0021]
[0022] Wherein, R2 is the resistance value of the comparison resistor R2 at the current moment, V1 is the voltage value of the first voltage at the previous moment, and V2 is the voltage value of the second voltage at the previous moment.
[0023] Optionally, the status module includes: a fourth power supply, a fifth power supply, a status resistor R5, and a third voltage divider resistor R6; the positive terminal of the fourth power supply is connected to the first terminal of the third voltage divider resistor R6, the second terminal of the third voltage divider resistor R6 is connected to the first terminal of the status resistor R5, the second terminal of the status resistor R5 is connected to the positive terminal of the fifth power supply, the negative terminal of the fourth power supply is connected to the positive terminal of the fifth power supply, and the negative terminal of the fifth power supply is grounded;
[0024] The state module is also used to obtain the resistance value of the state resistor R5 at the current moment based on the third voltage at the current moment;
[0025] The status module is also used to obtain the first voltage at the current moment based on the resistance value of the current state resistor R5, the third voltage divider resistor R6, and the fifth power supply.
[0026] According to a second aspect of the present invention, a neuron simulation method based on LTspice is provided, applied to an LTspice-based neuron simulation system, the system comprising: a memristor R1; the method comprising:
[0027] The third voltage at the current moment is obtained based on the first voltage at the previous moment and the second voltage at the previous moment;
[0028] The first voltage at the current moment is obtained based on the third voltage at the current moment;
[0029] The second voltage at the current moment is obtained based on the third voltage at the current moment, the on-state resistance, and the off-state resistance; wherein, the on-state resistance and the off-state resistance are obtained based on the memristor R1;
[0030] The third voltage at the next moment is obtained based on the first voltage at the current moment and the second voltage at the current moment, so as to realize the simulation of the neuron.
[0031] Optionally, the system further includes: a first power supply and a load resistor R. load And film capacitor C1; the positive terminal of the first power supply is connected to the first terminal of the memristor R1, the negative terminal of the first power supply is grounded, and the second terminal of the memristor R1 is connected to the load resistor R load The first terminal is connected to the load resistor R. load The second terminal is grounded, and the film capacitor C1 is connected in parallel with the memristor R1; the second voltage is the potential difference across the memristor R1; obtaining the second voltage at the current moment based on the third voltage at the current moment, the on-state resistance, and the off-state resistance includes:
[0032] The resistance value of memristor R1 at the current moment is obtained based on the third voltage, the on-state resistance, and the off-state resistance at the current moment.
[0033] Based on the voltage of the first power supply and the load resistance R load The second voltage at the current moment is obtained by combining the resistance value of the memristor R1 at the current moment with the resistance value of the current memristor R1.
[0034] Optionally, the system further includes: a second power supply, a third power supply, a comparison resistor R2, a first voltage divider resistor R3, a voltage transmission resistor R4, a second voltage divider resistor R5, and a capacitor C2; the positive terminal of the second power supply is connected to the first end of the first voltage divider resistor R3, the negative terminal of the second power supply is grounded, the second end of the first voltage divider resistor R3 is connected to the first end of the comparison resistor R2, the second end of the comparison resistor R2 is grounded, the voltage transmission resistor R4 is connected in parallel with the comparison resistor R2, the first end of the voltage transmission resistor R4 is connected to the first end of the second voltage divider resistor R5, the second end of the voltage transmission resistor R4 is grounded, the second end of the second voltage divider resistor R5 is connected to the upper plate of the capacitor C2, the lower plate of the capacitor C2 is connected to the positive terminal of the third power supply, and the negative terminal of the third power supply is grounded; obtaining the third voltage at the current moment based on the first voltage and the second voltage at the previous moment includes:
[0035] The resistance value of the comparison resistor R2 at the current moment is obtained based on the first voltage and the second voltage at the previous moment.
[0036] The voltage value across the comparison resistor R2 at the current moment is obtained based on the second power supply and the first voltage divider resistor R3.
[0037] The voltage value across the voltage transmission resistor R4 at the current moment is obtained based on the voltage value across the comparison resistor R2 at the current moment;
[0038] The potential of the upper plate of capacitor C2 is obtained based on the voltage value across the voltage transmission resistor R4 at the current moment and the voltage divider resistor R5, thereby obtaining the third voltage at the current moment.
[0039] Optionally, the system further includes: a fourth power supply, a fifth power supply, a state resistor R5, and a third voltage divider resistor R6; the positive terminal of the fourth power supply is connected to the first terminal of the third voltage divider resistor R6, the second terminal of the third voltage divider resistor R6 is connected to the first terminal of the state resistor R5, the second terminal of the state resistor R5 is connected to the positive terminal of the fifth power supply, the negative terminal of the fourth power supply is connected to the positive terminal of the fifth power supply, and the negative terminal of the fifth power supply is grounded; obtaining the first voltage at the current moment based on the third voltage at the current moment includes:
[0040] The resistance value of the current state resistor R5 is obtained based on the third voltage at the current moment;
[0041] The first voltage at the current moment is obtained based on the resistance value of the current state resistor R5, the third voltage divider resistor R6, and the fifth power supply.
[0042] The technical solutions provided by the embodiments of the present invention may include the following beneficial effects:
[0043] The above technical solution proposes a neuron simulation system based on LTspice, which includes a comparison module, a state module, and a neuron module. The neuron module includes a memristor. The comparison module is used to obtain the current third voltage based on the first and second voltages of the previous time step. The state module is used to obtain the current first voltage based on the current third voltage. The neuron module is used to obtain the current second voltage based on the current third voltage, an on-state resistance, and an off-state resistance; wherein the on-state and off-state resistances are obtained from the memristor. The comparison module is also used to obtain the next third voltage based on the current first and second voltages, thus realizing neuron simulation. Through this technical solution, the current voltage is obtained from the previous voltage, and the next voltage is obtained based on the current voltage. The voltage of the previous time step influences the voltage of the current time step, and thus influences the voltage of the next time step, forming a loop, consistent with the characteristics of LIF neuron circuits. This enables computer simulation of LIF neuron circuits, promoting the development of neuron model research to a certain extent.
[0044] Other features and advantages of the present invention will be described in detail in the following detailed description section. Attached Figure Description
[0045] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the following detailed description to explain the invention, but do not constitute a limitation thereof. In the drawings:
[0046] Figure 1 This is a schematic diagram illustrating a neuron simulation system based on LTspice according to an exemplary embodiment.
[0047] Figure 2 This is a schematic diagram of a neuron module according to an exemplary embodiment.
[0048] Figure 3a This is a schematic diagram illustrating a second voltage output by a neuron module according to an exemplary embodiment.
[0049] Figure 3b This is a schematic diagram illustrating the output voltage of a neuron circuit according to an exemplary embodiment.
[0050] Figure 4 This is a schematic diagram illustrating a comparison module according to an exemplary embodiment.
[0051] Figure 5 This is a schematic diagram illustrating a comparison module according to an exemplary embodiment.
[0052] Figure 6 This is a flowchart illustrating a neuron simulation method based on LTspice according to an exemplary embodiment. Detailed Implementation
[0053] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.
[0054] To facilitate understanding of the present invention, a brief description of the prior art and the inventive concept of the present invention will be provided first.
[0055] Neuromorphic computing is a computational method that simulates the electrophysiological processes of interaction between neurons in the human brain. It can be applied to fields such as artificial intelligence, pattern recognition, and control. Unlike the traditional von Neumann architecture, neuromorphic computing does not require large amounts of data transmission and can process more complex information in a more flexible way. Neurons are an indispensable component of neuromorphic computing. Compared to traditional computers, cells in neural networks process vast amounts of information simultaneously, giving neuromorphic computing a significant advantage in simulating the human brain's information processing capabilities.
[0056] In code implementation, the dynamic behavior of LIF neurons is typically simulated using discretized (e.g., using the Euler method or a modified Euler method) continuous-time models. This transforms differential equations into iterative forms, facilitating computation on digital computers. In recent years, LIF neuron models and their variants have been widely applied in neuromorphic computing and spiking neural networks due to their relative simplicity and ability to capture certain important characteristics of biological neurons. For example, multi-compartment LIF neuron models and efficient neuromorphic learning systems are extensions and optimizations of traditional LIF models, aiming to improve network performance and energy efficiency. However, current research hinders the development of neuron model research due to the lack of memristor variable resistance models and the absence of methods for directly simulating LIF neuron circuits using computers.
[0057] Figure 1 This is a schematic diagram illustrating a neuron simulation system based on LTspice according to an exemplary embodiment, such as... Figure 1 As shown, the system 10 includes: a comparison module 101, a state module 102, and a neuron module 103; the neuron module 103 includes: a memristor R1;
[0058] The comparison module 101 is used to obtain the third voltage at the current moment based on the first voltage at the previous moment and the second voltage at the previous moment.
[0059] The state module 102 is used to obtain the first voltage at the current moment based on the third voltage at the current moment.
[0060] The neuron module 103 is used to obtain the second voltage at the current moment based on the third voltage at the current moment, the on-state resistance, and the off-state resistance; wherein the on-state resistance and the off-state resistance are obtained based on the memristor R1.
[0061] The comparison module 101 is also used to obtain the third voltage at the next moment based on the first voltage at the current moment and the second voltage at the current moment, so as to realize the simulation of the neuron.
[0062] Understandably, this invention uses a memristor to simulate the electrical impulse behavior of LIF neurons. A memristor is a passive electronic component. Similar to a resistor, it generates and maintains current through a device. However, unlike a resistor, a memristor can "remember" the amount of charge that previously passed through it after the power supply is disconnected. The resistance of a memristor is determined by the amount of charge flowing through it; therefore, by measuring the resistance of a memristor, the amount of charge flowing through it can be determined, thus enabling it to remember charge. It is worth noting that a memristor has two important parameters: the threshold voltage Vth and the holding voltage Vhold. The threshold voltage is the voltage required for the memristor to switch from one resistive state to another. When the applied voltage exceeds this threshold, the memristor undergoes a change in resistive state; for example, when the applied voltage exceeds the threshold voltage Vth, the memristor switches from a high-resistance state to a low-resistance state, and its resistance becomes lower. The holding voltage Vhold refers to the minimum voltage required to maintain a certain resistive state after the memristor has switched to it, or the condition where no additional voltage is needed. Once a memristor switches to a new resistive state via a signal exceeding the threshold voltage Vth, it should be able to maintain its resistive state at zero voltage or below the threshold voltage, as long as no reverse voltage or current is applied sufficient to trigger a state change.
[0063] Furthermore, in this invention, the input and output of the comparison module 101, the state module 102, and the neuron module 103 form a loop. The comparison module 101 is used to obtain the third voltage at the current moment based on the first voltage and the second voltage at the previous moment. The state module 102 is used to obtain the first voltage at the current moment based on the third voltage at the current moment. The neuron module 103 is used to obtain the second voltage at the current moment based on the third voltage at the current moment, the on-state resistance, and the off-state resistance. The on-state resistance and the off-state resistance are obtained based on a memristor. Finally, the first voltage and the second voltage at the current moment are used by the comparison module 101 to obtain the third voltage at the next moment, thus forming a loop. Correspondingly, due to the cyclical input and output of the comparison module 101, the state module 102, and the neuron module 103, the changes in the first voltage and the second voltage at the previous moment will affect the third voltage at the current moment, and the third voltage at the current moment will in turn affect the first voltage and the second voltage at the current moment. Therefore, the voltage in the entire neuron simulation system has a certain variation law, which is consistent with the characteristics of the LIF neuron circuit itself, and thus the simulation of the LIF neuron circuit can be realized.
[0064] The above technical solution proposes a neuron simulation system based on LTspice, which includes a comparison module, a state module, and a neuron module. The neuron module includes a memristor. The comparison module is used to obtain the current third voltage based on the first and second voltages of the previous time step. The state module is used to obtain the current first voltage based on the current third voltage. The neuron module is used to obtain the current second voltage based on the current third voltage, an on-state resistance, and an off-state resistance; wherein the on-state and off-state resistances are obtained from the memristor. The comparison module is also used to obtain the next third voltage based on the current first and second voltages, thus realizing neuron simulation. Through this technical solution, the current voltage is obtained from the previous voltage, and the next voltage is obtained based on the current voltage. The voltage of the previous time step influences the voltage of the current time step, and thus influences the voltage of the next time step, forming a loop, consistent with the characteristics of LIF neuron circuits. This enables computer simulation of LIF neuron circuits, promoting the development of neuron model research to a certain extent.
[0065] Optionally, Figure 2 This is a schematic diagram illustrating a neuron module according to an exemplary embodiment, such as... Figure 2 As shown, the neuron module 103 also includes: a first power supply and a load resistor R. load The membrane capacitor C1; the positive terminal of the first power supply is connected to the first terminal of the memristor R1, the negative terminal of the first power supply is grounded, and the second terminal of the memristor R1 is connected to the load resistor R. load The first terminal is connected to the load resistor R. load The second terminal is grounded, and the film capacitor C1 is connected in parallel with the memristor R1; the second voltage is the potential difference across the memristor R1.
[0066] The neuron module 103 is also used to obtain the resistance value of the memristor R1 at the current moment based on the third voltage, the on-state resistance, and the off-state resistance at the current moment.
[0067] The neuron module 103 is also used to determine the voltage of the first power supply and the load resistance R. load The second voltage at the current moment is obtained by combining the resistance value of the current resistor and the resistance value of the memristor R1 at the current moment.
[0068] It is understandable that this first power source is a voltage-adjustable power source; the load resistance R load The resistance value is typically between the on-state resistance and the off-state resistance, and the load resistance R... load The resistance value can be adjusted when the load resistance R load The larger the resistance value, the lower the second voltage. When the load resistance R loadThe smaller the resistance, the higher the second voltage. In neuron module 103, the capacitor used is a membrane capacitor C1. A membrane capacitor is an electronic component consisting of two conductive electrode plates with an insulating film material sandwiched in between. This insulating film material can be polyester, polypropylene, ceramic, or other suitable materials.
[0069] In one implementation, Figure 3a This is a schematic diagram illustrating a second voltage output by a neuron module according to an exemplary embodiment, such as... Figure 3a As shown, the red curve represents the first external power supply, and the blue curve represents the second voltage output by the LTspice-based neuron simulation system. The horizontal axis represents time, and the vertical axis represents voltage. Figure 3b This is a schematic diagram illustrating the output voltage of a neuron circuit according to an exemplary embodiment, such as... Figure 3b As shown, the blue curve represents the applied power source, and the red curve represents the voltage output by the LIF neuron. The horizontal axis represents time, and the vertical axis represents voltage.
[0070] Optionally, the formula for calculating the resistance value of memristor R1 at the current moment is as follows:
[0071] R1=1 / (((1-V3) / Ron)+(V3 / Roff))
[0072] Where R1 is the resistance value of memristor R1 at the current moment, V3 is the voltage value of the third voltage at the current moment, and R on R is the resistance value of the on-state resistor. off This is the resistance value of the resistor in the off state.
[0073] Understandably, according to the above formula, the resistance of memristor R1 changes continuously with the current value of the third voltage. The resistance of memristor R1 switches between its on-state and off-state values based on the current third voltage value, simulating the firing pulse behavior of LIF neurons. The on-state resistance can be 500 ohms, and the off-state resistance can be 50,000 ohms.
[0074] It is worth mentioning that once the resistance value of memristor R1 is determined, the neuron module 103 determines the load resistance R based on the value of the load resistor R. load The resistance values of C1 and R1 determine the potential difference across R1, which is the potential difference between the upper and lower plates of C1, i.e., the second voltage. Furthermore, a fixed-value resistor can be added between the positive terminal of the first power supply and the first terminal of R1 to prevent C1 and R1 from being directly connected to the first power supply.
[0075] Optionally, Figure 4This is a schematic diagram illustrating a comparison module according to an exemplary embodiment, such as... Figure 4 As shown, the comparison module 101 includes: a second power supply, a third power supply, a comparison resistor R2, a first voltage divider resistor R3, a voltage transmission resistor R4, a second voltage divider resistor R5, and a capacitor C2; the positive terminal of the second power supply is connected to the first end of the first voltage divider resistor R3, and the negative terminal of the second power supply is grounded; the second end of the first voltage divider resistor R3 is connected to the first end of the comparison resistor R2, and the second end of the comparison resistor R2 is grounded; the voltage transmission resistor R4 is connected in parallel with the comparison resistor R2; the first end of the voltage transmission resistor R4 is connected to the first end of the second voltage divider resistor R5, and the second end of the voltage transmission resistor R4 is grounded; the second end of the second voltage divider resistor R5 is connected to the upper plate of the capacitor C2; the lower plate of the capacitor C2 is connected to the positive terminal of the third power supply, and the negative terminal of the third power supply is grounded;
[0076] The comparison module 101 is also used to obtain the resistance value of the comparison resistor R2 at the current moment based on the first voltage at the previous moment and the second voltage at the previous moment.
[0077] The comparison module 101 is also used to obtain the voltage value across the comparison resistor R2 at the current moment based on the second power supply and the first voltage divider resistor R3.
[0078] The comparison module 101 is also used to obtain the voltage value across the voltage transmission resistor R4 at the current moment based on the voltage value across the comparison resistor R2 at the current moment.
[0079] The comparison module 101 is also used to obtain the potential of the upper plate of capacitor C2 based on the voltage value across the voltage transmission resistor R4 and the second voltage divider resistor R5 at the current moment, thereby obtaining the third voltage at the current moment.
[0080] Optionally, the formula for calculating the resistance value of the comparison resistor R2 at the current moment is as follows:
[0081]
[0082] Where R2 is the resistance value of the comparison resistor R2 at the current moment, V1 is the voltage value of the first voltage at the previous moment, and V2 is the voltage value of the second voltage at the previous moment.
[0083] Understandably, the values of the second and third power supplies are set according to actual conditions. The current resistance value of the comparison resistor R2 is related to the voltage values of the first and second voltages at the previous moment. That is, when the voltage value of the first voltage at the previous moment is greater than the voltage value of the second voltage at the previous moment, the resistance value of the comparison resistor R2 is 2 ohms; when the voltage value of the first voltage at the previous moment is less than the voltage value of the second voltage at the previous moment, the resistance value of the comparison resistor R2 is 0 ohms; when the voltage value of the first voltage at the previous moment is equal to the voltage value of the second voltage at the previous moment, the resistance value of the comparison resistor R2 is 1 ohm. Based on the current resistance value of the comparison resistor R2 and the resistance value of the first voltage divider resistor R3, the current voltage value across the voltage transmission resistor R4 connected in parallel with the comparison resistor R2 can be obtained. Then, based on the current voltage value across the voltage transmission resistor R4 and the second voltage divider resistor R5, the potential of the upper plate of capacitor C2 can be obtained. It is worth mentioning that the third power supply in the comparator module 101 serves to provide a bias voltage, causing the current third voltage obtained from the comparison voltage to be inverted, thereby changing the timing of the third voltage output. The voltage transmission resistor R4 typically has a large resistance value, while the first voltage divider resistor R4 and the second voltage divider resistor R5 typically have small resistance values, for example, they can be set to 1 ohm.
[0084] Optionally, Figure 5 This is a schematic diagram illustrating a comparison module according to an exemplary embodiment, such as... Figure 5 As shown, the state module 102 includes: a fourth power supply, a fifth power supply, a state resistor R5, and a third voltage divider resistor R6; the positive terminal of the fourth power supply is connected to the first terminal of the third voltage divider resistor R6, the second terminal of the third voltage divider resistor R6 is connected to the first terminal of the state resistor R5, the second terminal of the state resistor R5 is connected to the positive terminal of the fifth power supply, the negative terminal of the fourth power supply is connected to the positive terminal of the fifth power supply, and the negative terminal of the fifth power supply is grounded.
[0085] The state module 102 is also used to obtain the resistance value of the state resistor R5 at the current time based on the third voltage at the current time.
[0086] The status module 102 is also used to obtain the first voltage at the current moment based on the resistance value of the current status resistor R5, the third voltage divider resistor R6, and the fifth power supply.
[0087] Understandably, the voltage value of the fourth power supply is set based on the memristor's threshold voltage Vth and holding voltage Vhold. For example, the voltage value of the fourth power supply can be 2*(Vth-Vhold). The voltage value of the fifth power supply can be the same as the holding voltage Vhold. Since the resistance value of the current state resistor R5 is numerically the same as the third voltage at the current moment, the current in the state module 102 can be obtained after obtaining the resistance value of the current state resistor R5. The first voltage at the current moment can be obtained based on the voltages obtained from the fifth power supply and the current state resistor R5.
[0088] In one implementation, in the initial state of the LTspice-based neuron simulation system, memristor R1 is in a high-resistance state, with a resistance equal to its off-state resistance. At this time, the potential difference across memristor R1, i.e., the second voltage, is relatively high. When this second voltage is greater than the threshold voltage, the first voltage is less than the second voltage. Therefore, the comparator resistor R2 has a resistance of 0 ohms, and correspondingly, the voltage across the voltage transmission resistor R4 is 0V, resulting in a third voltage of 0V. Consequently, the state resistor R5 in the state module 101 has a resistance of 0 ohms. The change in the first voltage causes a change in the third voltage, which in turn causes a change in the resistance of memristor R1. When the memristor R1 changes to a low-resistance state, the voltage across the membrane capacitor C1 connected in parallel with the memristor R1 decreases, i.e., the second voltage decreases. When the second voltage is less than the first voltage, the resistance of the comparator resistor R2 becomes 1 ohm, and the voltage across the voltage transmission resistor R4 increases, resulting in an increase in the third voltage. This, in turn, affects the resistance of the state resistor R5 in the state module 102, as well as the value of the first voltage. The change in the value of the first voltage affects the third voltage, which in turn causes a change in the resistance of the memristor R1 (the memristor R1 switches to a high-resistance state or a low-resistance state), which in turn affects the voltage across the membrane capacitor C1, i.e., the second voltage.
[0089] The above technical solution utilizes the resistance change caused by the voltage change between the comparison module, state module, and neuron module. The voltage across the memristor in the neuron module is used to simulate the neuron's firing pulse behavior, which is consistent with the characteristics of the LIF neuron circuit. This enables computer simulation of the LIF neuron circuit and promotes the development of neuron model research to a certain extent.
[0090] Figure 6 This is a flowchart illustrating an LTspice-based neuron simulation method according to an exemplary embodiment. The method is applied to an LTspice-based neuron simulation system, which includes: a memristor R1; as shown... Figure 6 As shown, the method includes:
[0091] In S601, the third voltage at the current moment is obtained based on the first voltage at the previous moment and the second voltage at the previous moment.
[0092] In S602, the first voltage at the current moment is obtained based on the third voltage at the current moment.
[0093] In S603, the second voltage at the current moment is obtained based on the third voltage at the current moment, the on-state resistance, and the off-state resistance; wherein, the on-state resistance and the off-state resistance are obtained based on the memristor R1.
[0094] In S604, the third voltage at the next moment is obtained based on the first voltage at the current moment and the second voltage at the current moment, so as to realize the simulation of the neuron.
[0095] Optionally, the system also includes: a first power supply and a load resistor R. load The membrane capacitor C1; the positive terminal of the first power supply is connected to the first terminal of the memristor R1, the negative terminal of the first power supply is grounded, and the second terminal of the memristor R1 is connected to the load resistor R. load The first terminal is connected to the load resistor R. load The second terminal is grounded, and the film capacitor C1 is connected in parallel with the memristor R1; the second voltage is the potential difference across the memristor R1; S603 includes:
[0096] The resistance value of memristor R1 at the current moment is obtained based on the third voltage, the on-state resistance, and the off-state resistance at the current moment.
[0097] Based on the voltage of the first power supply and the load resistance R load The second voltage at the current moment is obtained by combining the resistance value of the current resistor and the resistance value of the memristor R1 at the current moment.
[0098] Optionally, the system further includes: a second power supply, a third power supply, a comparison resistor R2, a first voltage divider resistor R3, a voltage transmission resistor R4, a second voltage divider resistor R5, and a capacitor C2; the positive terminal of the second power supply is connected to the first end of the first voltage divider resistor R3, the negative terminal of the second power supply is grounded, the second end of the first voltage divider resistor R3 is connected to the first end of the comparison resistor R2, the second end of the comparison resistor R2 is grounded, the voltage transmission resistor R4 is connected in parallel with the comparison resistor R2, the first end of the voltage transmission resistor R4 is connected to the first end of the second voltage divider resistor R5, the second end of the voltage transmission resistor R4 is grounded, the second end of the second voltage divider resistor R5 is connected to the upper plate of the capacitor C2, the lower plate of the capacitor C2 is connected to the positive terminal of the third power supply, and the negative terminal of the third power supply is grounded; S603 includes:
[0099] The resistance value of the comparison resistor R2 at the current moment is obtained based on the first voltage and the second voltage at the previous moment.
[0100] The voltage value across the comparison resistor R2 at the current moment is obtained based on the second power supply and the first voltage divider resistor R3.
[0101] The voltage value across the voltage transmission resistor R4 at the current moment is obtained based on the voltage value across the comparison resistor R2 at the current moment;
[0102] The potential of the upper plate of capacitor C2 is obtained by using the voltage across the voltage-transfer resistor R4 and the second voltage-dividing resistor R5 at the current moment, thus obtaining the third voltage at the current moment.
[0103] Optionally, the system further includes: a fourth power supply, a fifth power supply, a state resistor R5, and a third voltage divider resistor R6; the positive terminal of the fourth power supply is connected to the first terminal of the third voltage divider resistor R6, the second terminal of the third voltage divider resistor R6 is connected to the first terminal of the state resistor R5, the second terminal of the state resistor R5 is connected to the positive terminal of the fifth power supply, the negative terminal of the fourth power supply is connected to the positive terminal of the fifth power supply, and the negative terminal of the fifth power supply is grounded; S602 includes:
[0104] The resistance value of the current state resistor R5 is obtained based on the third voltage at the current moment;
[0105] The first voltage at the current moment is obtained based on the resistance value of the current state resistor R5, the third voltage divider resistor R6, and the fifth power supply.
[0106] The above technical solution proposes a neuron simulation system based on LTspice, which includes a comparison module, a state module, and a neuron module. The neuron module includes a memristor. The comparison module is used to obtain the current third voltage based on the first and second voltages of the previous time step. The state module is used to obtain the current first voltage based on the current third voltage. The neuron module is used to obtain the current second voltage based on the current third voltage, an on-state resistance, and an off-state resistance; wherein the on-state and off-state resistances are obtained from the memristor. The comparison module is also used to obtain the next third voltage based on the current first and second voltages, thus realizing neuron simulation. Through this technical solution, the current voltage is obtained from the previous voltage, and the next voltage is obtained based on the current voltage. The voltage of the previous time step influences the voltage of the current time step, and thus influences the voltage of the next time step, forming a loop, consistent with the characteristics of LIF neuron circuits. This enables computer simulation of LIF neuron circuits, promoting the development of neuron model research to a certain extent.
[0107] The specific manner of each step in the methods described in the above embodiments has been described in detail in the embodiments of the system and will not be elaborated here.
[0108] The preferred embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the specific details of the above embodiments. Within the scope of the technical concept of the present invention, various simple modifications can be made to the technical solution of the present invention, and these simple modifications all fall within the protection scope of the present invention.
[0109] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present invention will not describe the various possible combinations separately.
[0110] Furthermore, various different embodiments of the present invention can be combined in any way, as long as they do not violate the spirit of the present invention, they should also be regarded as the content disclosed by the present invention.
Claims
1. A neuron simulation system based on LTspice, characterized in that, The system includes: a comparison module, a state module, and a neuron module; the neuron module includes: a memristor R1; The comparison module is used to obtain the third voltage at the current moment based on the first voltage at the previous moment and the second voltage at the previous moment; The state module is used to obtain the first voltage at the current moment based on the third voltage at the current moment; The neuron module is used to obtain the second voltage at the current moment based on the third voltage at the current moment, the on-state resistance, and the off-state resistance; wherein the on-state resistance and the off-state resistance are obtained based on the memristor R1; The comparison module is also used to obtain the third voltage at the next moment based on the first voltage at the current moment and the second voltage at the current moment, so as to realize the simulation of the neuron. The neuron module also includes: a first power supply and a load resistor R. load And film capacitor C1; the positive terminal of the first power supply is connected to the first terminal of the memristor R1, the negative terminal of the first power supply is grounded, and the second terminal of the memristor R1 is connected to the load resistor R load The first terminal is connected to the load resistor R. load The second terminal is grounded, and the film capacitor C1 is connected in parallel with the memristor R1; the second voltage is the potential difference across the memristor R1. The neuron module is also used to obtain the resistance value of memristor R1 at the current moment based on the third voltage, on-state resistance and off-state resistance at the current moment. The neuron module is further configured to adjust the voltage of the first power supply and the load resistance R according to the voltage of the first power supply. load The second voltage at the current moment is obtained by combining the resistance value of the memristor R1 with the resistance value of the current moment. The formula for calculating the resistance value of memristor R1 at the current moment is as follows: in, The resistance value of memristor R1 at the current moment. The voltage value of the third voltage at the current moment. The resistance value of the on-state resistor. The resistance value of the off-state resistor.
2. The neuron simulation system based on LTspice according to claim 1, characterized in that, The comparison module includes: a second power supply, a third power supply, a comparison resistor R2, a first voltage divider resistor R3, a voltage transmission resistor R4, a second voltage divider resistor R5, and a capacitor C2; the positive terminal of the second power supply is connected to the first end of the first voltage divider resistor R3, and the negative terminal of the second power supply is grounded; the second end of the first voltage divider resistor R3 is connected to the first end of the comparison resistor R2, and the second end of the comparison resistor R2 is grounded; the voltage transmission resistor R4 is connected in parallel with the comparison resistor R2; the first end of the voltage transmission resistor R4 is connected to the first end of the second voltage divider resistor R5, and the second end of the voltage transmission resistor R4 is grounded; the second end of the second voltage divider resistor R5 is connected to the upper plate of the capacitor C2; the lower plate of the capacitor C2 is connected to the positive terminal of the third power supply, and the negative terminal of the third power supply is grounded; The comparison module is also used to obtain the resistance value of the comparison resistor R2 at the current moment based on the first voltage at the previous moment and the second voltage at the previous moment; The comparison module is further configured to obtain the voltage value across the comparison resistor R2 at the current moment based on the second power supply and the first voltage divider resistor R3; The comparison module is also used to obtain the voltage value across the voltage transmission resistor R4 at the current moment based on the voltage value across the comparison resistor R2 at the current moment. The comparison module is also used to obtain the potential of the upper plate of the capacitor C2 based on the voltage value across the voltage transmission resistor R4 at the current moment and the second voltage divider resistor R5, thereby obtaining the third voltage at the current moment.
3. The LTspice-based neuron simulation system according to claim 2, characterized in that, The formula for calculating the resistance value of the comparison resistor R2 at the current moment is as follows: in, The resistance value of the comparison resistor R2 at the current moment. The voltage value of the first voltage at the previous moment. The voltage value of the second voltage at the previous moment.
4. The neuron simulation system based on LTspice according to claim 1, characterized in that, The status module includes: a fourth power supply, a fifth power supply, a status resistor R5, and a third voltage divider resistor R6; the positive terminal of the fourth power supply is connected to the first terminal of the third voltage divider resistor R6, the second terminal of the third voltage divider resistor R6 is connected to the first terminal of the status resistor R5, the second terminal of the status resistor R5 is connected to the positive terminal of the fifth power supply, the negative terminal of the fourth power supply is connected to the positive terminal of the fifth power supply, and the negative terminal of the fifth power supply is grounded; The state module is also used to obtain the resistance value of the state resistor R5 at the current moment based on the third voltage at the current moment; The status module is also used to obtain the first voltage at the current moment based on the resistance value of the current state resistor R5, the third voltage divider resistor R6, and the fifth power supply.
5. A neuron simulation method based on LTspice, characterized in that, An application to an LTspice-based neuron simulation system, the system comprising: a memristor R1; the method comprising: The third voltage at the current moment is obtained based on the first voltage at the previous moment and the second voltage at the previous moment; The first voltage at the current moment is obtained based on the third voltage at the current moment; The second voltage at the current moment is obtained based on the third voltage at the current moment, the on-state resistance, and the off-state resistance; wherein, the on-state resistance and the off-state resistance are obtained based on the memristor R1; The third voltage at the next moment is obtained based on the first voltage at the current moment and the second voltage at the current moment, so as to realize the simulation of the neuron; The system also includes: a first power supply and a load resistor R. load And film capacitor C1; the positive terminal of the first power supply is connected to the first terminal of the memristor R1, the negative terminal of the first power supply is grounded, and the second terminal of the memristor R1 is connected to the load resistor R load The first terminal is connected to the load resistor R. load The second terminal is grounded, and the film capacitor C1 is connected in parallel with the memristor R1; the second voltage is the potential difference across the memristor R1; obtaining the second voltage at the current moment based on the third voltage at the current moment, the on-state resistance, and the off-state resistance includes: The resistance value of memristor R1 at the current moment is obtained based on the third voltage, the on-state resistance, and the off-state resistance at the current moment. Based on the voltage of the first power supply and the load resistance R load The second voltage at the current moment is obtained by combining the resistance value of the memristor R1 with the resistance value of the current moment. The formula for calculating the resistance value of memristor R1 at the current moment is as follows: in, The resistance value of memristor R1 at the current moment. The voltage value of the third voltage at the current moment. The resistance value of the on-state resistor. The resistance value of the off-state resistor.
6. The neuron simulation method based on LTspice according to claim 5, characterized in that, The system further includes: a second power supply, a third power supply, a comparison resistor R2, a first voltage divider resistor R3, a voltage transmission resistor R4, a second voltage divider resistor R5, and a capacitor C2; the positive terminal of the second power supply is connected to the first end of the first voltage divider resistor R3, and the negative terminal of the second power supply is grounded; the second end of the first voltage divider resistor R3 is connected to the first end of the comparison resistor R2, and the second end of the comparison resistor R2 is grounded; the voltage transmission resistor R4 is connected in parallel with the comparison resistor R2; the first end of the voltage transmission resistor R4 is connected to the first end of the second voltage divider resistor R5, and the second end of the voltage transmission resistor R4 is grounded; the second end of the second voltage divider resistor R5 is connected to the upper plate of the capacitor C2; the lower plate of the capacitor C2 is connected to the positive terminal of the third power supply, and the negative terminal of the third power supply is grounded; obtaining the third voltage at the current moment based on the first voltage and the second voltage at the previous moment includes: The resistance value of the comparison resistor R2 at the current moment is obtained based on the first voltage and the second voltage at the previous moment. The voltage value across the comparison resistor R2 at the current moment is obtained based on the second power supply and the first voltage divider resistor R3. The voltage value across the voltage transmission resistor R4 at the current moment is obtained based on the voltage value across the comparison resistor R2 at the current moment; The potential of the upper plate of capacitor C2 is obtained based on the voltage value across the voltage transmission resistor R4 at the current moment and the voltage divider resistor R5, thereby obtaining the third voltage at the current moment.
7. The neuron simulation method based on LTspice according to claim 5, characterized in that, The system further includes: a fourth power supply, a fifth power supply, a state resistor R5, and a third voltage divider resistor R6; the positive terminal of the fourth power supply is connected to the first terminal of the third voltage divider resistor R6, the second terminal of the third voltage divider resistor R6 is connected to the first terminal of the state resistor R5, the second terminal of the state resistor R5 is connected to the positive terminal of the fifth power supply, the negative terminal of the fourth power supply is connected to the positive terminal of the fifth power supply, and the negative terminal of the fifth power supply is grounded; obtaining the first voltage at the current moment based on the third voltage at the current moment includes: The resistance value of the current state resistor R5 is obtained based on the third voltage at the current moment; The first voltage at the current moment is obtained based on the resistance value of the current state resistor R5, the third voltage divider resistor R6, and the fifth power supply.
Citation Information
Patent Citations
Irregular discharge bionic neuron circuit and discharge bionic method thereof
CN114970840A
Neuron simulation circuit and neural network apparatus
US20220207338A1