SPICE Behaviors of Double Memristor Circuits Using Cosine Window Function

In this paper, a Hewlett-Packard (HP) memristor model with a new window function and its versatile characteristics are presented. SPICE behaviors of the linear and nonlinear memristor model are studied through PSpice simulation. High flexibility is demonstrated for emulating the behaviors of the practical HP memristors. Furthermore, the characteristics of the composite SPICE behaviors are both investigated when two memristors are connected in series and in parallel. The polarity of each memristor is also taken into consideration. The relationships among flux, charge, voltage, current, and memristance of the double memristor circuits are simulated and analyzed.


INTRODUCTION
There are three fundamental two-terminal passive circuit elements, i.e., resistors R, capacitors C and inductors L, which can be found and introduced from any basic circuit books. Chua first theoretically postulated the existence of the fourth passive electrical circuit element in 1971 [1], named as memristor, whose memristance (i.e., an acronym for memory resistance) M can be defined by the relation of magnetic flux φ and electrical charge q, namely, M dφ/dq. Together with the definitions of three commonly used basic circuit elements R, C and L, and definitions of the electric current and Faraday's law, memristance closes the loop among four variables v, i, φ and q with six equations. Under the linear situation of memristor, M is seen as a constant and memristance is the same as the resistance. In fact, the memristance depends on the amount of charge that passed through the memristor, resembling a resistor with timevarying resistance.
In order to emulate these memristor applications, various memristor nonlinear drift models using SPICE have been presented before fabricated realization [17][18][19][20][21][22][23][24]. Window functions need to be used to tackle the boundary conditions of the memristors [17][18][19][20][21][22]. In ref. 17, a switching window function was proposed, where the current i is involved, but it has limited scalability. Two different window functions were presented to mimic nonlinear effects in refs. 18 and 20. However, as the boundary between the doped and undoped layers approaches either end of the memristive device, it cannot be excited by external stimulus. In refs. 20 and 22, the piecewise functions were utilized to construct the window functions, which were relatively complicated when applying in the memristive devices.
In this paper, a memristor model using a new window function, called cosine window function, is proposed along with its versatile characteristics. To illustrate the significance of the proposed window function, main characteristics of state-of-the-art ones in recent years are listed in Table 1 for comparisons. Then, the SPICE behaviors of the linear and nonlinear memristor model are investigated through PSpice simulation. Furthermore, the characteristics of the composite SPICE behaviors are both studied when two memristors are connected in series and in parallel. The relationships among flux, charge, voltage, current, and memristance are simulated and analyzed using PSpice.

MEMRISTOR MODEL USING COSINE WINDOW FUNCTION
The concept of memristive devices or systems was generalized by Chua and Kang using the following equations [25], where v is the voltage, i is the current, and M(x(t), i(t)) is the instantaneous memristance that depends on the internal state variable x and current i of the memristor. The state variable x, ranging from 0 to 1, is the normalized width of the memristor doped region x(t) w(t)/D, with D being the whole switching bilayer thickness of the memristor, as seen in Figure 1.
At time t, the width of the doped region w depends on the amount of charge that passed through the memristor. Thus, the time derivative of w is proportional to the current i, which can be expressed by where μ v is the average dopant mobility, R ON denotes the low resistance at high dopant concentration region. If we set k μ v R ON /D 2 , Eq. 3 can be changed as follows, The Eqs. 3, 4 is actually an expression of a linear drift model of memristor, but it does not take the boundary effects of the memristor into account. Nonlinear dopant drift phenomena exist at the boundaries of the physically realized nanoscale memristor, therefore, an appropriate window function f(x) need to be introduced in ref. 4, i.e., where f(x) ensures zero drift at the boundaries, i.e., f (0) f (1) 0. On the other hand, the memristance can be expressed by where R OFF denotes the high resistance at low dopant concentration region. In this paper, a new cosine window function is proposed as follows, where p is the control parameter. This new and simple cosine window function is demonstrated in Figure 2 for various values of p. As the parameter p rises, a unity window function f(x) will occur, and thus the model tends to a linear model. Here, the parameter p is set with a large range of variation, because the cosine window function is not changed significantly near the region of boundary. Using this new cosine window function, the behaviors of the memristor can be observed in Figures 3-6 with versatile characteristics. Here, we set R ON 100 Ω, R OFF 16 kΩ, w 0 5 nm, D 10 nm, and μ v 10 -14 m2 /Vs, thus the initial state variable x 0 is equal to 0.5 at t 0. When the voltage biased at two sides of memristor is set as v(t) sin(2πt), i.e., the frequency of the AC voltage f 1 Hz, the calculated dynamical properties of the normalized doped state variable x(t) with different values of p are illustrated in Figure 3A. For instance, when p 16, the state variable periodically saturates between the normalized boundary "1" from 0.295 + N to 0.705 + N s, where N is a natural number starting from 0. On the other hand, according to (6), the curves of the corresponding memristances can be obtained as seen in Figure 3B. When the memristor biased voltage is set as v(t) −sin(2πt), the calculated dynamical properties of the normalized doped state variable x(t) with different values of p is shown in Figure 3C, and the corresponding memristance curves are plotted in Figure 3D.
Actually, the minimum state variable x(t) corresponding to maximum memristance is dependent on the frequency of the biased AC voltage. From Figure 3C, we can see that the state variable does not arrive the normalized boundary "0". Through decreasing the frequency of the biased voltage, two edge states, i.e., saturation (w D) and depletion (w 0), can be reached    Frontiers in Physics | www.frontiersin.org March 2021 | Volume 9 | Article 648737 4 variable x will approach 0 and the corresponding maximum memristance will be 16 kΩ, under the condition of p 8. Figure 5 illustrates a nonlinear calculated current-voltage (i-v) curve with p set as 8, where a periodic pinched hysteresis loop with hard switching emerges. This memristive model has zerocrossing property in a form of i-v Lissajous figure, which represents no current through the system when the voltage value is zero. Figure 6 shows the versatility of our model, where the i-v characteristic curves are plotted for eight different values of p. This model demonstrates high flexibility for emulating the behaviors of the practical HP memristors, which can be beneficial in characterizing memristive devices before fabrication.

SPICE BEHAVIORS OF DOUBLE MEMRISTOR CIRCUITS
The HP memristor model using cosine window function and its characteristics have been addressed in the above section. To further investigate the relationships among charge, flux, and memristance of composite memristors connected in different topologies, simulated SPICE behaviors of single and double memristor circuits will be presented in details in this section.

SPICE Behaviors of Single Memristor
The single memristor circuit using the above-mentioned cosine window function has been proposed, and the corresponding SPICE code was written for use in PSpice [26], as seen in Figure 7. The single memristor's SPICE behaviors can be seen in Figures 8, 9, 10, where the initial state of the linear and nonlinear memristor models are both M(0) 15.9 kΩ with a sinusoidal input signal of v(t) Vm sin(2πt). The behaviors in Figures 9, 10 are plotted together with those of two serial memristor circuits for comparisons, which will be introduced in subsection B.
As shown in Figure 8A, when the value of p increases, the curves of the nonlinear models will be toward that of linear model, which means that the nonlinearity will be weakened. At the middle area of the whole charging process, the slopes of all the curves with various p are identical including that of the linear model. In Figure 8B, as the value of p increases for a fixed electrical charge, the magnetic flux will decrease, i.e., the nonlinearity will be weakened.

SPICE Behaviors of Two Serial Memristor Circuits
Then, we construct a circuit with two nonlinear memristors   Figure 11A. The initial states of these two memristors are both M(0) 11.25 kΩ. Due to the movement of the doping ions caused by the bias voltage, the memristance associated with the doping boundary in the HP model definition will be changed accordingly. Therefore, when the magnitude V m of the sinusoidal input signal v(t) Vm sin(2πt) is positive, the memristance will keep decreasing, and vice versa. Simultaneously, the value of V m will influence the migration rate of doping ions. Figure 9A shows the relationships between voltage and current of the single memristor (M 1 or M 2 ) and two serial  Figure 11A, where the magnitude of the sinusoidal input signal V m 2.3V. Due to the two memristors connected in series, equal current flows through both memristors. Therefore, the behaviors of each single memristor are identical. Moreover, the applied voltage is distributed across each memristor identically at any instant of time due to same polarities of these two memristors M 1 and M 2 . Consequently, the slope of pinched hysteresis loop of the composite memristor circuit is half of that of the single memristor.
Figures 9B,C illustrate the curves of memristance versus charge (M-q) and flux versus charge (φ-q), respectively. In Figure 9B, the stored charge q in the memristor will be gradually increased as the memristance M decreases. The slope of the M-q curve of the single memristor is half of that of the composite memristor circuit. Meanwhile, the memristance M of the single memristor is always half of that of the composite memristor circuit at any time. When the memristance M decreases to the value of R ON , namely, approaching the doping boundary of the memristor at high dopant concentration region, it will keep "ON" of this memristor even if the charge increases. Similarly, the slope of the φ-q curve of the single memristor is also half of that of the composite memristor circuit, as shown in Figure 9C.
For a two-serial-memristor circuit with opposite polarities in PSpice shown in Figure 11B, the current versus voltage curves of the individual memristors and two serial memristors are plotted in Figure 10A. The initial states of the two memristances are both set as M(0) 11.25 kΩ in PSpice software. In contrast to the case of the same polarities in Figures 9A, 10A has three separate hysteresis loops, denoting the individual memristor M 1 , M 2 and composite M of the two memristors. Due to the two memristors connected with opposite polarities, they have the opposite variations. The specific expression is that when the memristance M 1 decreases, the other memristance M 2 will increase, and vice versa. Figure 10B shows the relationship between memristance and charge. The initial memristances of M 1 and M 2 are both M(0) 11.25 kΩ. Therefore, the memristance of composite M is 22.5 kΩ at first. In the linear region, the amplitude changes of the two memristors are identical, but the trends are opposite. Therefore, the memristance of composite M remains unchanged. When the shift is close to the boundary, memristors are in the nonlinear region. Thus, the memristance of composite M will decrease accordingly. This phenomenon is caused from the boundary effects in physical memristor model. At this time, the two memristors reach the minimum and maximum memristances, respectively, resulting in the composite memristance of approximately 16 kΩ. For the relationship between flux and charge in Figure 10C, it is also different from that of Figure 9C. The magnetic fluxes of M 1 and M 2 are not the same any more due to the two memristors connected with opposite polarities. In Figure 10C, the slope of composite flux in black is always equal to the arithmetic sum of the two slopes of individual memristor fluxes. Moreover, the composite flux is varied more linearly as a function of charge, compared with those of the individual memristor fluxes.

SPICE Behaviors of Two Parallel Memristor Circuits
Similarly, the parallel circuits of two nonlinear memristors (p 8) are constructed in PSpice, where the initial states of the memristiors are M 1 (0) M 2 (0) 11.25 kΩ. Since the two memristors are connected in parallel with same and opposite polarities as shown in Figures 12A,B, respectively, equal voltage passes through the two memristors, where the magnitude V m of the sinusoidal input signal is set as 1.15V.
The relationships between voltage and current of the single memristor (M 1 or M 2 ) and two memristors in parallel with same polarities are shown in Figure 13A. Since the initial states of the two memristors are identical, the applied voltage is distributed across each memristor equally at any instant of time. Hence, the behaviors of each single memristor are identical. In addition, the slope of pinched hysteresis loop of the composite memristor circuit is twice as big as that of the single memristor. Figure 13B exhibits the variations of memristance versus flux (M-φ). In contrast to composite memristor circuit in series, the memristance of composite memristor circuit in parallel is half of that of the individual memristor at any instant of flux. As the memristance decreases, the magnetic flux will rise accordingly and its variations (i.e., slopes) for single memristor and composite memristor circuit are both increasingly large until the memristance reaches the minimum value. Figure 13C plots the charge versus flux (q-φ) curves of the single memristor and two memristors in parallel with same polarities. Seen from Figure 13C, the slope of the q-φ curve of the single memristor is also half of that of the composite memristor circuit.
For a double memristor circuit connected in parallel with opposite polarities shown in Figure 12B, the curves of current versus voltage are plotted in Figure 14A. It has three different hysteresis loops in contrast to the case of the same polarities in Frontiers in Physics | www.frontiersin.org March 2021 | Volume 9 | Article 648737 8 Figure 13A. The inset of Figure 14A shows that the curve of M 2 has a relatively linear hysteresis loop compared with those of the other two. However, the composite current is always equal to the sum of the individual branch currents of the two memristors at any time whatever the applied voltage is.
The curves of memristance versus flux (M-φ) and charge versus flux (q-φ) are plotted in Figures 14B,C, respectively. As seen in Figure 14B, the variation trends of the two individual memristors M 1 and M 2 are opposite, due to opposite polarities of these two memristors. Additionally, the composite memristance is always lower than the memristance of each single memristor at any time. Seen from Figure 14C, it can be found that the q-φ curves of the two individual memristors with opposite polarities are symmetrical about the initial origin point. Moreover, the slope of composite charge is always equal to the arithmetic sum of the two slopes of individual memristor charges.

CONCLUSION
A new window function has been created and applied into the HP memristor model in this paper. To validate its advantages, versatile characteristics and SPICE behaviors of the memristor have been demonstrated. Moreover, we also investigate the composite SPICE behaviors when two memristors are connected in series and in parallel with same or opposite polarities, and make comparisons with those of the individual memristors. Their relationships among flux, charge, voltage, current, and memristance are analyzed using PSpice simulation.

DATA AVAILABILITY STATEMENT
The raw data supporting the conclusions of this article will be made available by the authors, without undue reservation.