This application claims priorities under the Paris Convention to Chinese Patent Applications No. 202210826639.X and 202210826653.X, filed on Jul. 14, 2022, the entirety of which is hereby incorporated by reference for all purposes as if fully set forth herein.
The present invention relates to the field of memristor simulator, more particularly to a circuit and method for simulating real-time reconfigurable general-purpose memristor.
In 1971, Professor Leon O. Chua firstly proposed a theoretical model of memristor according to circuit complete theorem, and considered that the memristor was the fourth basic two-terminal circuit element besides resistor, capacitor and inductor, which described a nonlinear relationship between charge and magnetic flux. Meanwhile, Professor Leon O. Chua also gave out three basic characteristics for memristor: {circle around (1)} when a memristor is excited by a bipolar periodic electric signal, its curve in V-I plane is a pinched hysteresis loop, {circle around (2)} when the scanning frequency of the electric signal increases, the area of the lobe of the pinched hysteresis loop will decrease, {circle around (3)} when the scanning frequency of the electric signal approaches infinity, the pinched hysteresis loop will shrink to a single-valued function.
In a nano film based on titanium dioxide, a physical memristor was firstly realized in by Stan William's team at Hewlett-Packard Laboratories in 2008, it was not until then that the research of memristor's characteristics and application was paid close attention by a great many researchers. From then on, the memristor proposed by Professor Leon O. Chua has not been a theoretical model, but a real component. And now, the model of memristor has been wildly applied to various technical fields, such as neural network, machine learning, chaos theory, secure communication, image encryption, non-volatile memory and filter circuit. Unfortunately, on the one hand, the different material used to make a memristor corresponds to the different physical mechanism, which makes the characteristics of a memristor different from that of other and limits the large scale application of memristor. For example, researchers have found the characteristic of pinched hysteresis loop in various materials such as binary oxide, complex perovskite oxide, solid electrolyte materials, amorphous carbon materials, organic polymeric materials, and proposed various physical mechanisms such as the conductive channel's formation and break caused by vacancy migration of oxygen, contact barrier modulation, the metal conductive channel's formation and break caused by active electrode's metallization, the capture and release of injected carrier and metal-insulator transition to explain their memristor characteristics. On the other hand, at present there isn't any commercial memristor in the market. For example, memristor Knowm is seen as a commercial component, but for the reason that its structure is quite complex and its cost is very high, it is difficult to be applied in large scale. Facing various complex physical mechanisms and high manufacture cost, it is very urgent and important to design a circuit for simulating real-time reconfigurable general-purpose memristor, which can be applicable to multiple physical models, to analyze the relevant characteristics of memristor by experiment.
The relevant scholars have done a lot of researches on the bandwidth (frequency) enhancement of the circuit for simulating memristor. Analog method, digital-analog hybrid method and application specific integrated circuit method have been used to build memristor simulator circuits to verify the characteristics and measure the bandwidths of various memristors.
In analog method, a lot of passive components (such as resistors, capacitors and inductors) and active components (such as operational amplifier, operational transconductance amplifier (OTA), current-feedback operational amplifier (CFOA), Differential Difference Current Conveyor (DDCC) and analog multiplier) are used to build a memristor simulator circuit, which is a breadboard or a circuit board. The experimental bandwidth of the memristor simulator circuit has been enhanced from 500 Hz of the early period to 1.3 MHz of the present. Meanwhile, positive and negative power supply is used in the memristor simulator circuit. In analog method, for different model and bandwidth of memristor, we need to redesign a memristor simulator circuit and spend a lot of time on circuit debugging. Furthermore, to the input signal of MHz, the experimental result can't be verified by using a breadboard, because the parasitic parameters of signal transmission line, impedance match and signal crosstalk can't be solved. Only circuit board can output signals which can be displayed as a pinched hysteresis loop by using the oscilloscope's function of Lissajous figure. Notably, a great error exists in the analog method, and the sources of the error are mainly as follows: the errors of 5%, 20% and 20% respectively of most commercial resistors, capacitors and inductors, the errors occurred from the input voltage offset (Vos) and the input bias current, and the errors occurred from the different effects of the non-linearity of active component's analog bandwidth on different signals' amplitude-frequency curves. As so far, the memristor simulator circuit of bandwidth of 10 MHz and above has not been realized in analog method.
For the reason that very professional knowledge of electronic circuit is needed in circuit design and debugging, it is very difficult for most of scholars who are engaged in basic study. So the relevant scholars further proposed digital-analog hybrid method, which usually adopts ADC, programmable general-purpose processor and DAC to realize a memristor simulator circuit, where ADC and DAC are respectively used to the analogy-digital quantization of an input signal and the digital-analogy conversion of the output signal, programmable general-purpose processor is used to realize the real-time calculation of the value of memristance or memductance. Comparing to analog method, digital-analog hybrid method is more simple and efficient to realize a memristor simulator circuit, but it also has the following limits: can't simulate a memristor of high frequency due to the computation speed of programmable general-purpose processor, operating frequency of ADC, operating frequency of DAC and analog bandwidth, can't simulate a memristor of high-precision hardware due to the resolutions of ADC, DAC and digital oscilloscope and the amplitude range of output signal.
To the known memristor model, the relevant scholars also proposed application specific integrated circuit method. In the paper of “Memristor emulator circuits using single CBTA” (U. E. Ayten, S. Minaei and M. Sa{hacek over (g)}baş, AEU—International Journal of Electronics and Communications, volume 82, pages 109-118, December, 2017), a memristor simulator circuit with ±0.9V power supply has been realized by using 23 CMOS transistors. In the paper of “A new grounded memristor emulator based on MOSFET-C,” (Abdullah Yesil, AEU—International Journal of Electronics and Communications, volume 91, pages 143-149, July, 2018), a memristor emulator circuit consisting of only seven MOS transistors and one grounded capacitor was presented. The memristor circuit was laid by using Cadence Environment with TSMC 0.18 μm process parameters and its layout dimensions are only 12 μm×38 μm excluding the area of the capacitor. All post-layout simulations agree well with theoretical analyses. Obviously, application specific integrated circuit method can dramatically reduces the size of memristor simulator circuit and enhance the precision of implementation. But the complicated design process and high implementation cost is a major hindrance to wide application. Meanwhile, application specific integrated circuit method is only applicable to a known memristor model, and not applicable to the study of multiple memristor models.
Generally speaking, firstly, most of memristor simulator circuits in prior art can only simulate the dynamic behavior of a memristor at relative lower frequency, in other words, the memristor simulator circuits can only exhibit a pinched hysteresis loop at the frequency less than the critical frequency, and a liner resistor at the frequency beyond the critical frequency, which limits their the application in high speed, high bandwidth fields, such as generation of high-frequency random signal, transmission of high-speed data and storage of high-speed data. Secondly, all of memristor simulator circuits in prior art are fixed model oriented designs, so the researchers will spend a lot of time and effort on the work from the theoretic model to the actual output of memristor simulator circuit, and in most cases, the engineers having professional circuit background are needed to be involved in hardware debugging Meanwhile, all of the three methods in prior art can't realize the real-time reconfigurable memristor according to memristor model. So the hardware realization of memristor simulator circuit is a time consuming, inefficient and complicated process. Finally, the inherent error of component, transmission loss in circuit and the error of measurement instrument in memristor simulator circuit are very important to the high-precision hardware realization of a memristor's theoretical model, but as so far, the experimental accuracy of memristor simulator circuit has not been highly concerned by relevant scholars.
The present invention aims to overcome the deficiencies of the prior art, and provides a circuit and method for simulating real-time reconfigurable general-purpose memristor, which can be applicable to different models of memristor, simulate high-frequency memristor and enhance the experimental accuracy of memristor simulator circuit.
To achieve these objectives, in accordance with the present invention, a circuit for simulating real-time reconfigurable general-purpose memristor, which is built based on a FPGA is provided, comprising:
In addition, in accordance with the present invention, a method for simulating real-time reconfigurable general-purpose memristor is provided, comprising:
y[n]=f(h[n])·f_dly_x[n]
The objectives of the present invention are realized as follows:
In the present invention of a circuit and method for simulating real-time reconfigurable general-purpose memristor, nonlinear m-order polynomial fitting of mathematical model of a memristor is performed by using McLaughlin formula, wherein m is related to the amplitude and frequency of an input signal and the fitting accuracy, thus the mathematical model of a memristor can be easily and quickly adapted by updating the polynomial order, the polynomial coefficients and the FPGA system clock cycle. On this basis, based on the FPGA, a circuit for simulating real-time reconfigurable general-purpose memristor is provided, in which, a system state variable generation module is built to generate a system state variable, i.e. charge or magnetic flux variable, a calculation module is built for the m-stage reconfigurable calculation of polynomial coefficients and the system state variable to obtain a memristance or memductance, a FIFO is used to make the input signal, a voltage signal or a current signal aligned with the memristance or memductance f(h[n]) along the time, a output module is used to multiply the delayed input signal and the memristance or memductance f(h[n]) to obtain an output signal y[n], which is a current signal or a voltage signal. Meanwhile, method for simulating real-time reconfigurable general-purpose memristor is provided, in which, the detailed steps of signal processing and displaying are given to obtain a display of Lissajous figure, i.e. a pinched hysteresis loop and a waveform display of time-domain. In addition, the present invention can simulate high frequency memristor by setting polynomial coefficients, i.e. using lower frequency signal to realize the equivalent verification of the memristor's characteristics of high frequency signal, which is a prominent advantage that makes the research of memristor's characteristics less concerned about the analog bandwidth of memristor simulator circuit and is very convenient to most of researchers who has not very professional knowledge of electronic circuit design and debugging. Meanwhile, the present invention is built based on FPGA, adopt digital circuit to simulates a reconfigurable general-purpose memristor, the experimental accuracy is enhanced.
The above and other objectives, features and advantages of the present invention will be more apparent from the following detailed description taken in conjunction with the accompanying drawings, in which:
Hereinafter, preferred embodiments of the present invention will be described with reference to the accompanying drawings. It should be noted that the similar modules are designated by similar reference numerals although they are illustrated in different drawings. Also, in the following description, a detailed description of known functions and configurations incorporated herein will be omitted when it may obscure the subject matter of the present invention.
1. The General Mathematic Model of Memristor of the Present Invention
Since the constitutive relation (theoretical model) of memristor is derived according to circuit complete theorem by Professor Leon O. Chua in 1971, many researchers have studied the theoretical model of memristor. In 2008, Stan William's team at Hewlett-Packard Laboratories observed the phenomenon of memristance in lab, the finding made the memristor advanced from the theoretical model to physical implementation.
Memristor in nature is a nonlinear dynamical system, and general mathematic model of memristor defined as follows:
When f(x(t),h) can be approximated uniformly by m-order polynomial function sequence fm(x(t),h), the general mathematic model of memristor expressed by formula (1) can be further expressed as follows:
The general mathematical model of memristor expressed by formula (2) is a continuous expression, however, the continuous model can be processed in general-purpose digital processing circuit. Formula (2) is quantified by time interval Ts, a discrete model of memristor is obtained as follows:
In present invention, time interval Ts is the FPGA system clock cycle. To simplify the expression, h(x[n]) is simplified as h[n], fm(x[n],h) is simplified as f(h[n]), then the general mathematical model of memristor in present invention is obtained:
2. The Generality of the General Mathematic Model of Memristor of the Present Invention
In the general mathematic model of memristor proposed by the present invention, the amplitude a and frequency co of the input signal x(t) are known, so the range of system state variable h(t) is fixed and bounded. With Weierstrass first theorem, general mathematic model f(h(t)) can be fitted by using a m-order polynomial. The Taylor formula and McLaughlin formula have given a concrete method for realizing the m-order polynomial. The greater the order m is chosen, the higher the approximation accuracy of f(h(t)), accordingly, the higher the calculation complexity of f(h(t)). Thus the accuracy, speed and logic resource must be balanced when the general mathematic model f(h(t)) is implemented in general-purposed processor such as FPGA. To discrete general mathematic model f(h[n]), we can use formula (4) to approximate. Table 1 shows multiple mathematic models of memristor obtained by configuring coefficient matrix K and polynomial order m.
As shown in Tablet, the discrete general mathematic model of memristor of the present invention has compatibility to the models of memristor in prior art.
3. The Generality of the General Mathematic Model of Memristor of the Present Invention to Active or Passive Memristor
The polarity of the general mathematic model f(h(t)) of memristor is related to coefficient matrix K and system state variable h(t). To illustrate the effects of the two parameters, we choose magnetic flux variable q as system state variable h(t) and a mathematical model of charge (voltage) controlled memristor with 2-order. Then the general mathematic model f(q) of memristor can be expressed as:
where polynomial coefficient k1 and k2 can't be 0 simultaneously, otherwise the memristor will become a linear time-invariance resistor. The curves of q-f(q) have 24 kinds of figures as shown in
If the pinched hysteresis loop of a memristor is distributed only on the first quadrant and/or the third quadrant under the excitation of any one zero-DC component AC periodical signal, the memristor is passive, otherwise, is active. The pinched hysteresis of active memristor may not cross the zero point, because when the pinched hysteresis loop is distributed on the second quadrant or the forth quadrant, x(t)y(t)≤0, the behavior of active memristor is similar to a energy source. In formula (1), the independent invariables f(x(t),h) and x(t) to the right of the equal sign determine the polarity of the dependent invariable y(t) to the left of the equal sign. When a zero-DC bipolar signal x(t) is inputted to a memristor, the pinched hysteresis loop on U-I plane has three cases as shown in Table 2.
As shown in Table 2, case1: if independent invariables f(x(t),h) is positive, the pinched hysteresis loop on U-I plane is distributed on the first quadrant and the third quadrant, the memristor is a passive memristor, case 2: if independent invariables f(x(t),h) is negative, the pinched hysteresis loop on U-I plane is distributed on the second quadrant and the forth quadrant, the memristor is an active memristor, case 3: if independent invariables f(x(t),h) is bipolar, the pinched hysteresis loop on the U-I plane is distributed on all quadrants, the memristor is partly active memristor. The models corresponding to curves (1), (2), (11) and curves (3), (4), (14) are respectively passive memristors and active memristors, the models corresponding to the rest curves are partly active memristors.
4. The Non-Linear Characteristic Analysis of the General Mathematic Model of Memristor of the Present Invention
To verify the input signal's bandwidth of the general mathematical model of memristor in formula (4), here we use cosine signal as input to perform theoretical bandwidth analysis. The input signal is x(t)=a cos(ωt), where a is the amplitude of the input signal, ω is the angular frequency of the input signal. The starting time of excitation is t0, letting x(t0)=0, h(t0)=0, the mathematical model h(t) is as follows:
where
for
we can easily calculate out:
Then the mathematical model f(h(t)) can be expressed as follows:
Finally, we can obtain the input-output signal expression as follows:
From the expression shown in formula (9), the output y(t) is composed of linear term y1(t) and nonlinear term y2(t).
When k0≠0, in formula (9), as the angular frequency co decreases, the nonlinear term y2(t) will increase, under this circumstance, the output y(t) is mainly determined by the nonlinear term y2(t). On the contrary, as the angular frequency co decreases, the nonlinear term y2(t) will decrease, under this circumstance, the output y(t) is mainly determined by the linear term y1(t), and the linear term y1(t) can be explained as a standard linear component, for example, when the input is a voltage signal, the output y(t) is a standard admittance component.
Letting
there is:
The approximate curve of ω-l is shown in
As shown in
From the above constraint, the memory characteristics of the general mathematical model of memristor in present invention comprise: firstly, when the absolute value of polynomial coefficient k0 decreases, the absolute value of polynomial coefficient ki increases, the order m of the polynomial increases, and the amplitude a of the input sine signal increases or the angular frequency ω decreases the formula (2) will satisfy the non-linear characteristic of memristor more easily. Secondly, when the angular frequency ω is known, in order to make the general mathematical model of memristor given in formula (2) to show memory characteristics, we can increase the amplitude a of the input sine signal, increase the absolute value of polynomial coefficient ki or decrease the absolute value of polynomial coefficient k0.
5. The Generality of the General Mathematic Model of Memristor of the Present Invention to Wideband Signal
According to digital sampling theory, there is:
where fi is the signal frequency, fsap is the sampling frequency. When the low frequency signal of fiL and high frequency signal of fiH, which have the same amplitude are respectively quantified by ADCs of sampling frequencies fsL, and fsH, and satisfy the following constraint:
Then the low sampling rate quantified sequence xL[n] and the high sampling rate quantified sequence xH[n] meet the following relation:
x
L
[n]=x
H
[n] (14)
If the corresponding coefficient matrices KL and KH under the two circumstances satisfy the formula: kiL=ri·kiH, i∈[0,m] the pinched hysteresis loops of the low sampling rate quantified sequence xL[n] and the high sampling rate quantified sequence xH[n] are identical, which is proved as follows:
If r·fiL=fiH, then r−1·TsL=TsH, where TsL and TsL are respectively the sampling periods corresponding to sampling frequencies fsL, and fsH. Then according to the formula (4), hL[n]=r·hH[n], where hL[n] and hH[n] are respectively the magnetic flux variables corresponding to the sampling frequencies fsL and fsH.
According to formula (4), the general mathematic model of memristor under the input of the low frequency signal of fiL or the input of the high frequency signal of fiH will be expanded respectively as follows:
f
L(h[n])=k0L+k1L·hL[n]+ . . . +kiL·(hL[n])i+kmL(hL[n])m (15)
f
H(h[n])=k0H+k1H·hH[n]+ . . . +kiH·(hH[n])i+kmH(hH[n])m (16)
Taking kiL=ri·kiH and hL[n]=r·hH[n] into formula (15), then the following formula are obtained:
Comparing formula (16) and formula (17), then we can obtain:
f
L(hL[n])=fH(hH[n])
According to formula (4), then we can obtain:
y
L
[n]=y
H
[n]
where yL[n] and yH[n] are respectively the output signals corresponding to the low sampling rate quantified sequence xL[n] and the high sampling rate quantified sequence xH[n]. i.e. the pinched hysteresis loops of the low sampling rate quantified sequence xL[n] and the high sampling rate quantified sequence xH[n] are identical.
According to the above conclusion, letting OSR=20, the pinched hysteresis loop of input signal with signal frequency fiH=10 GHz and sampling signal with sampling frequency fsH=200 GSPS is identical with that of input signal with signal frequency fiL=5 MHz and sampling signal with sampling frequency fsL=100 MSPS. It has great significance for the engineering spread and application of memristor model that mathematical model of memristor is transferred from high signal frequency and high sampling frequency to low signal frequency and low sampling frequency by configuring the polynomial coefficients of the purposed general mathematic model of memristor. The main reasons are as follows: firstly, the analog signal of GHz belongs to the high frequency signal of microwave band. Under this circumstance, the parasitic parameters in a analog signal circuit have significant impact on the analog bandwidth and the transmission of the analog signal circuit, and the design and debugging of the analog signal circuit is very difficult, thus the implementation of hardware platform can't be realized, but by a specialized company with very profound analog knowledge. To most of researchers on theory, the implementation of hardware platform in laboratory can't be realized, secondly, there is no commercial single chip ADC with the sampling frequency of several hundred GHz at current time, thirdly, the sharp rise of data bandwidth brought by high sampling frequency make the real-time calculation of back-end data processing FPGA impossible, for example, the bandwidth of 8 bit real-time data of sampling frequency 200 GSPS will reach 200 GSa/s, the real-time calculation can't realized by current commercial FPGA.
6. The Numerical Simulation of the General Mathematic Model of Memristor of the Present Invention
Matlab is used to perform the numerical simulation of the general mathematic model of memristor of the present invention to prove its correctness, and 6 the numerical simulations have been designed respectively, the parameters and results of which are shown as follows:
Numerical Simulation 1
Setting coefficient matrix K1=(−0.4,4e6,−1500,−1.25e-6,−3.125e-9), m=5 and Ts=10 ns, and setting a cosine input signal with amplitude a=1V and frequency fi=2 MHz, the time-domain waveform curves are obtained as shown in
Respectively resetting the cosine input signal's amplitude (a=1V and 2V) and frequency (f i=1 MHz, 2 MHz, 2.5 MHz, 5 MHz and 10 MHz), when the sampling frequency is fixed at 100 Msa/s, the simulation results are shown in
In conclusion, the general mathematical model of memristor described in formula (2) can show the basic characteristic that can be used to identify a memristor.
Numerical Simulation 2
According to formula (11), polynomial coefficients ki in formula (4) are related to the pinched hysteresis loop of the general mathematic model of memristor of the present invention and the frequency of the input signal. Firstly, setting a sine input signal with amplitude a=1V and frequency fi=5 MHz, when coefficient matrix K2=(1,5e6, 5e6, 5e6,7,100,500,0,−10,0,1), the pinched hysteresis loop on U-I plane is shown in
Numerical Simulation 3
Firstly, setting coefficient matrix K3.0=(−0.4, 4*10{circumflex over ( )}6, −1500, −1.26*10{circumflex over ( )}−6, −20, 0, 0,0, 0, 0, 0) and sampling frequency to 100 Msa/s, when the amplitude of input signal is 0.1V, the pinched hysteresis loops of the input signals of 1 MHz, 2 MHz, 2.5 MHz, 50 MHz and 10 MHz are shown in
Setting coefficient matrix K3.1=(−0.40,8.0*10{circumflex over ( )}9,−6*10{circumflex over ( )}9,−10{circumflex over ( )}4,−5*10{circumflex over ( )}4,508,−1.25*10{circumflex over ( )}5,−6*10{circumflex over ( )}7,10{circumflex over ( )}4,0,−200) and sampling frequency to 200 Gsa/s, when the amplitude of input signal is 0.1V, the pinched hysteresis loops of the input signals of 2 GHz, 4 GHz, 5 GHz, 10 GHz and 20 GHz are shown in
Setting coefficient matrix K3.0=(−0.4, 4*10{circumflex over ( )}6, −1500, −1.26*10{circumflex over ( )}−6, −20, 0, 0,0, 0, 0, 0), when the frequency of input signal is 500 KHz, the pinched hysteresis loops under the sampling frequencies of 10 MSa/s, 20 MSa/s and 50 MSa/s are shown in
Numerical Simulation 4
the aim of this simulation is to make the partly active characteristics of the general mathematic model of memristor be shown by setting appropriate parameters. The input signal is a sine voltage signal with amplitude of 1V and frequency of 10 Hz. The parameters of coefficient matrix K are respectively set to K4.0=(0.9,−25,50), K4.1=(0.9,−35,50), K4.2=(−0.9,25,50) and K4.3=(−0.9,35,50). The corresponding pinched hysteresis loops are respectively shown in
Numerical Simulation 5
The simulation parameters are as follows: m=10, Ts=1 us, the amplitude and the frequency of input signal are respectively 0.1V and 20 KHz. The parameters of coefficient matrix K are respectively set to:
Comparing to coefficient matrix K5.0, in coefficient matrices K5.1, K5.2, K5.3, polynomial coefficient k1 in coefficient matrix K5.1, k2 in coefficient matrix K5.2 and k3 in coefficient matrix K5.3 are respectively increased 10 times. The pinched hysteresis loops corresponding to the four coefficient matrices are shown in
Numerical Simulation 6
Setting m=10.
Setting the parameters of high sampling as follows: fsH=200 Ga/s, TsH=5 ps, fiH=20 GHz, a=1V, KH=(−0.4,8.0*10{circumflex over ( )}9,−6*10{circumflex over ( )}9,−10{circumflex over ( )}4,−5*10{circumflex over ( )}4,508,−1.25*10{circumflex over ( )}5,−6*10{circumflex over ( )}7,10{circumflex over ( )}4,0,−200).
Setting the parameters of low sampling as follows: fsL=100 Ma/s, TsH=10 ns, fiL=1 MHz, a=1V, KL=(−0.4,8,−6*10{circumflex over ( )}−9,−10{circumflex over ( )}−23,−4*10{circumflex over ( )}−5,5.08*10{circumflex over ( )}−43,−1.25*10{circumflex over ( )}−49,−6*10{circumflex over ( )}−56,10{circumflex over ( )}−68,0,−2*10{circumflex over ( )}−88).
The input voltage signal (Voltage(V)), the flux (flux(Φ)), the memductance (W(Φ)), the output current signal (Current(A)) and the pinched hysteresis loop (Voltage(V)−Current(A)) of high sampling (fsH) and low sampling (fsL) are respectively shown in
Through the above numerical simulations, we can find that the general mathematical model of memristor purposed by present invention can show a excellent pinched hysteresis loop. It is worth noting that the pinched hysteresis loop can be shown at higher frequency of input signal and located on any places of U-I plane by changing coefficient matrix K.
In the embodiment, as shown in
The system state variable generation module 1 comprises a multiplier 101, an accumulator 102 and an adder 103, wherein the multiplier 101 is used to multiply an input signal x[n] and a FPGA system clock cycle Ts together to obtain a result Ts·x[n], which is outputted to the accumulator 102 for accumulation to obtain an accumulated value, which is denoted by:
The accumulated value is outputted to the adder 103 to add a system state variable's initial value h[0], then a system state variable h[n] is obtained:
where the input signal x[n] is a voltage signal or current signal, the system state variable h[n] is a charge or magnetic flux variable.
In the embodiment, a 48 bit adder is used to build the accumulator 102 to realize the accumulation of input signal x[n].
The calculation module 2, which comprises m reconfigurable calculating units operating in m grades cascaded pipeline mode is used to implement m polynomial multiply-accumulate operations. As shown in
As shown in
where the first multiplier 2011 is used to multiply inputs H[i] and d[i] together to obtain the output H[i+1], the second multiplier 2012 is used to multiply the first multiplier 2011's output H[i+1] and polynomial coefficient k[i+1] together to obtain an output k[i+1]·H[i+1], the adder 202 is used to add the input s[i] and the output k[i+1]·H[i+1] together to obtain the output s[i+1], the D flip-flop 203 is used to delay the input did one clock period to obtain the delay signal d[i+1].
To the 1st reconfigurable calculating unit, its input d[0] is the system state variable h[n] outputted by system state variable generation module, its input H[0] is 1, its input s[0] is the polynomial coefficient k(0).
Wherein the number m of the polynomials is determined as follows:
Determining the maximum amplitude amax and the minimum frequency ωmax in respectively according to the amplitude and the frequency of the zero-DC component AC signal in the input signal x[n], then determining the range of the system state variable h[n] as follows:
In the range of the system state variable h[n], using McLaughlin formula to perform a m-order polynomial fitting of memristance or memductance f(h[n]) about the system state variable h[n] to obtain a fitting function g(h[n]), where the maximum fitting error εM is:
The value of the polynomial order m should satisfy εM≤ε0, where ε0 is the acceptable maximum fitting error.
Wherein the polynomial coefficient k[i] of the ith order, i=0, 1, 2, . . . , m is obtained by expanding the mathematical model of memristor to be simulated, i.e. the memristance or memductance f(h[n]) at time n into a polynomial according to McLaughlin formula:
The output s[m] of the mth reconfigurable calculating unit is taken as the memristance or memductance f(h[n]).
FIFO 3 is used to delay the input signal x[n] m+39 clock periods to obtain a delayed input signal f_dly_x[n].
Output module 4 comprises a multiplier, where the multiplier is used to multiply the delayed input signal f_dly_x[n] and the memristance or memductance f(h[n]) outputted by the mth reconfigurable calculating unit to obtain an output signal y[n], the output signal y[n] is a current signal or a voltage signal. In the embodiment, as shown in
In one embodiment of present invention, As shown in
Step S1: Establishing a Mathematical Model f(h[n]) and Judging Whether it is a Polynomial
Establishing a mathematical model f(h[n]) for a memristor, and judging whether it is a polynomial about a system state variable h[n], if not, going to step S2, if it is, then determining an m-order of the mathematical model/(h [n]) about the system state variable h[n] and going to step S5.
Step S2: Determining the Range of the System State Variable h[n]
Determining the maximum amplitude amax and the minimum frequency ωmin respectively according to the amplitude and the frequency of the zero-DC component AC signal in the input signal x[n], then determining the range of the system state variable h[n] as follows:
Step S3: Determining the Value of the Polynomial Order m
In the range of the system state variable h[n], using McLaughlin formula to perform a m-order polynomial fitting of memristance or memductance f(h[n]) about the system state variable h[n] to obtain a fitting function g(h[n]), where the maximum fitting error εM is:
The value of the polynomial order m should satisfy εM≤ε0, where ε0 is the acceptable maximum fitting error.
Step S4: Determining the Values of Coefficients ki, i=0, 1, 2, . . . , m
m+1 polynomial coefficients ki, i=0, 1, 2, . . . , m of the mathematical model f(h[n]) are determined according to McLaughlin formula.
Step S5: Simulating the Memristor in Real Time Based on a FPGA
In the FPGA, the following calculations are performed:
Step S5.1: Calculating the System State Variable h[n]
As shown in
where Ts is the system clock cycle of the FPGA, f_x[j] is the jth sampling point of the single precision floating-point data f_x[n], h[0] is the initial value of the system state variable h[n];
Step S5.2: Calculating the Mathematical Model f(h[n]), i.e. the Memristance or Memductance f(h[n]) of the Memristor:
Step S5.3: Outputting the Output Signal y[n]
As shown in
y[n]=f(h[n])·f_dly_x[n]
where the input signal x[n] is a voltage signal or current signal, the output signal y[n] is a current signal or voltage signal;
Step S6: Storing the Delayed Input Signal and the Output Signal into Another FIFO
Storing the delayed data f_dly_x[n] and the output signal y[n] into another FIFO, i.e. the second FIFO, when the second FIFO is written full, reading out the delayed data f_dly_x[n] and the output signal y[n] from the second FIFO and send them to a signal processing and displaying module.
Step S7: Processing the Delayed Input Signal and the Output Signal for Displaying
In the signal processing and displaying module, multiplying the vertical sensitivity of input signal displaying and the half of the number of the vertical divisions in waveform display area to obtain a display range R1, multiplying the vertical sensitivity of memristor output displaying and the half of the number of the vertical divisions in waveform display area to obtain a display range R2.
Then processing the delayed data f_dly_x[n] as follows:
where max(|dx(n)|) represents choosing the data which absolute value is maximum from the sequence of data dx(n), data dx_HL(n)∈[−1, 1].
Processing the output data y[n] as follows:
where max(|dy(n)|) represents choosing the data which absolute value is maximum from the sequence of data dy(n), data dy_HL(n)∈[−1, 1].
Step S8: Displaying a Pinched Hysteresis Loop
Taking the center of the waveform display area of the X-Y view of a digital oscilloscope as a coordinate origin (0, 0), respectively taking the data dx_HL(n) as a x-coordinate and the data dy_HL(n) as a y-coordinate, then sending the pixel (dx_HL(n), dy_HL(n)) as the pixel to be highlighted into the digital oscilloscope's LCD to perform a display of Lissajous figure, i.e. display a pinched hysteresis loop; meanwhile, sending the data dx(n) and the data dy(n) into the digital oscilloscope for caching and then performing a waveform display of time-domain.
In the embodiment, step S7 and step S8 are realized in an industrial controlling computer, and a monitor is taken as the LCD of the digital oscilloscope.
Step S9: Resetting the Second FIFO and Returning According to Judgments
Resetting the second FIFO, then judging according to the following rules: if both of the polynomial coefficient k(i) and the range of the system state variable h[n] have not been changed, then going to step S6, if the polynomial coefficient k(i) has been changed and the range of the system state variable h[n] has not been changed, then going to step S5, otherwise, going to step S1.
Functional Hardware Simulation
In order to evaluate the performance of the FPGA based circuit for simulating real-time reconfigurable general-purpose memristor, i.e. the performance of the present invention, we performed a functional simulation, and compared it with the relevant prior arts.
In the embodiment, hardware programming language Verilog, software development environment Vivado 2020.1 and functional simulation software Xsim are used to the hardware functional simulation of the present invention.
Firstly, a 14 bits signed digital discrete sine signal of 4096 points is generated by Matlab software, and a waveform generating module is built base on DDS (Direct Digital Frequency Synthesis) in a FPGA. The 14 bits signed digital discrete sine signal is stored in a waveform ROM of the FPGA. Reading the 14 bits signed digital discrete sine signal stored in the waveform ROM, a sine signal with adjustable frequency is outputted through adjusting the frequency control word (step value of waveform ROM's read address). DDS technology belongs to the prior art, the details of DDS are not described here.
The coefficient matrix K is (0.4,−3.0*10{circumflex over ( )}6,4.5*10{circumflex over ( )}8,−10{circumflex over ( )}2,1.5*10{circumflex over ( )}6,50.8,−125,6,100,10,−200), clock cycle Ts=10 ns. For the convenience of comparative analysis of results of hardware and software simulations, the output data of the circuit for simulating real-time reconfigurable general-purpose memristor is double precision float-point data. The timing diagram of hardware simulation is shown in
The double precision float-point data outputted by the circuit for simulating real-time reconfigurable general-purpose are imported into Matlab software and compared with the pinched hysteresis loop obtained by using Matlab software to simulate the general mathematic model of memristor, which are shown in
Then, we build a circuit for simulating real-time reconfigurable general-purpose with 10-order nonlinear polynomial in the FPGA to perform rapid configurable experiments for 6 memristor models of the prior art. The input parameters of the 6 memristor models, the frequencies and amplitudes (fixed at 1V) of the corresponding bipolar input sine signals, sampling frequency, the amplitudes of output signals, calculation times of Matlab software simulation and calculation times of hardware simulation are respectively shown in Table 4.
From table 4, we can see that the amplitudes of the output signals of the circuit for simulating real-time reconfigurable general-purpose are related to input parameters.
In table 4, the one cycle's calculation times of the input signals with different signal frequencies for different memristor model are given (The fixed delay time 390 ns has been neglected for FPGA, i.e. hardware simulation). From table 4, we can see that the circuit for simulating real-time reconfigurable general-purpose in accordance with present invention can simulate various memristor model in prior art, and comparing with Matlab software, its calculation time are greatly reduced.
While illustrative embodiments of the invention have been described above, it is, of course, understand that various modifications will be apparent to those of ordinary skill in the art. Such modifications are within the spirit and scope of the invention, which is limited and defined only by the appended claims
Number | Date | Country | Kind |
---|---|---|---|
202210826639.X | Jul 2022 | CN | national |
202210826653.X | Jul 2022 | CN | national |