An efficient and flexible window function for a memristor model and its analog circuit application

The memristor is a novel nanostructured resistive tuning two-terminal electronic device that has been widely explored in the areas of neuromorphic computing systems, memory, digital circuits, analog circuits, and many more new applications. In this article, an efficient and flexible window function is presented for a linear drift memristor model. The proposed parametric cubic parabolic window function provides a unique feature (controllable window function discontinuity at the boundaries) to a linear drift memristor model by which the distorted pinched hysteresis loop problem is resolved and the number of programming resistance states of the memristor is improved. Five control parameters are introduced in the proposed window function in order to correct the existing problems (such as boundary effect, boundary lock and inflexibility) and are able to provide asymmetric nonlinearity at the boundaries of the device, making it feasible for tracking the resistive switching dynamic of a futuristic oxide-based memristive device with different inert electrodes. The proposed model is validated with a solution-processed ZnO-based fabricated memristive device. A programmable analog gain amplifier circuit is ultimately executed to simulate the utilization of the evolved memristor model, and the effect of memristance resolution is investigated.


Introduction
In recent decades, memristors have emerged as nanoscale electronic devices in the area of nanotechnology due to their unique features of resistive tuning, non-volatility, simple structure, high speed, low cost, and CMOS compatibility. In 1971, Chua first postulated the concept of a memristor by describing the relationship between the charge and flux of a device and discovered the fourth missing fundamental passive circuit component [1]. In 2008, a team at HP Labs fabricated a nanoscale metal-insulator-metal (MIM)structured device using titanium dioxide (TiO 2 ) sandwiched between two platinum (Pt) metal electrodes and discovered the resistive switching phenomena for the first time [2]. Since then, industry and academia have focused considerable attention on exploring the physics behind the resistive switching in memristive devices. Therefore, various mathematical concepts have been proposed to describe the resistive switching phenomena in nanoscale memristive devices, including the nonlinear model [3], linear drift model [2], exponential model [4], Simmons tunneling model [5], threshold adaptive model (TEAM) [6], variable threshold adaptive model (VTEAM) [7], conductive filament-based model [8], and some SPICE macro-models [9]- [10]. Although several models for resistive switching devices have been proposed in the literature, no exact model has appeared so far. Accordingly, the development of a memristor model is still an emerging research domain for the research society.
A research group from HP Labs was the first to propose a mathematical concept for describing the resistive switching phenomena in a memristive device, which is known as the linear drift model. In this model, a window function was included to introduce nonlinearity and physical limiting conditions in the device as well as tracking the actual resistive switching activity of the memristive device.
As of now, apart from mathematical analysis of the linear drift model, memristors have also been investigated in numerous applications, for example, as a memory cell in high-density nonvolatile random access memory [11], as an artificial synapse in neuromorphic systems [12], in spiking neural networks [13], in multilayer neural networks [14], and as a programmable resistive element in analog circuits, in which its resistance value can be tuned by applied electrical pulses [15][16][17]. In the linear drift memristor model, a window function is an essential component for capturing the resistive switching dynamics of the memristive device. In recent times, various materials and deposition techniques have been introduced by the research community for fabricating new memristive devices [18][19][20]. Hence, the development of an appropriate and efficient window function has become crucial for researchers.
Over the past few years, various window functions have been analyzed in the literature for the linear drift memristor model. The most common problems associated with reported window functions are the boundary effect, boundary lock, distorted pinched hysteresis loop (DPHL), and inflexibility of control parameters. Initially, different kinds of window functions were presented for the linear model by Strukov et al. [2], Joglekar et al. [21], Biolek et al. [22] and Prodromakis et al. [23]. Even though the boundary effect problem and nonlinearity effect were resolved by Strukov, Joglekar and Prodromakis, they failed to resolve the boundary lock problem. Accordingly, Biolek presented another window function to fix the boundary lock problem by including a device current parameter in the window function, but the model was inflexible.
In the recent past, for the advancement of the linear drift memristor model, numerous window functions have been proposed by the research community. For instance, Chen et al. [24] proposed a controllable window function to provide better nonlinearity, Maldenov et al. [25] proposed a window function with an activation threshold, Chowdhury et al. [26] presented a Prodromakis modified trigonometric window function to improve the flexibility of the memristor model, but these window functions do not consider the device current parameter, hence they failed to resolve the boundary lock problem. Further, Zha et al. [15,17] and Shi et al. [27] proposed some window functions by combining the feature of the Biolek and Prodromakis window function, which is able to resolve most problems related to window functions, although the DPHL problem has not been fixed.
Recently, a general window function was proposed by Li et al. [13] and Wen et al. [14] with more restricted and a larger number of control parameters, and it was also analyzed in spiking neural networks and multilayer neural networks. After rigorous study of all the reported window functions, we can conclude that window function discontinuity is responsible for resolving the boundary lock problem, and this also leads to the DPHL problem. Until now, the adverse effect of window function discontinuity at the boundary not has been discussed in the literature.
After considering the importance of the reported window function and its shortcomings, we have proposed an efficient and flexible window function for the linear drift memristor model with five control parameters which is able to fix the boundary lock, boundary effect, and inflexibility problems. Additionally, our proposed window function has a unique feature to control functional discontinuity by which the DPHL problem is resolved and the memristance resolution is also improved. To the best of the authors' knowledge, this has not been examined so far in the literature. Finally, an evolved window function is implemented in a programmable analog circuit application and its performance is analyzed.
This article is organized as follows. In Sect. 2, basic physics of the linear drift memristor model is described along with the importance of several reported window functions with their excellence and drawbacks. In Sect. 3, we evaluate the newly proposed window function and show its control parameter range and effects on device characteristics, and we then validate the model with the experimental result of a solution-processed ZnO-based memristor with Ag and fluorine-doped tin oxide (FTO) electrodes. In Sect. 4, the evolved memristor model is implemented in a gain amplifier analog circuit and its performance is examined with respect to window function control parameters. Finally, in Sect. 5, we conclude our proposed work.

Physics of the linear drift model with window function
In 2008, a research group from HP Labs manufactured a nanoscale memristive device as well as proposed a mathematical model for describing its resistive switching dynamics. This model assumes that the insulating layer is separated into two regions, an undoped region and an oxygen vacancy-doped region (more conductive than undoped region), and the total resistance of the device is calculated as the summation of resistance of these two regions. In Fig. 1, a schematic of the linear drift memristor model is given, where the total device length is D, width of the oxygen vacancy-doped region is w(t), R 1 is the resistance of the oxygen vacancy-doped region, R 2 is the resistance of the undoped region, and R eq is the total instantaneous resistance of the device. Moreover, R ON and R OFF are the limiting resistance of the device for fully doped [w(t) = D] and fully undoped [w(t) = 0] cases, and x = w(t)/D is the normalized width of the device that is called the internal state parameter which is restricted between 0 and 1 due to the physical boundary limitation of the device. The total instantaneous resistance of the nanoscale memristive device can be calculated from Eq. 1, as mentioned in [2].
In this model, when we exert electrical stimuli across the device, interface drift between doped and undoped regions occurs. The drifting of the interface is formulated as Eq. 2 by considering the basic physics of drift velocity. From this equation, we can see that the internal state parameter x is the linear function of charge flow through the device, which is why this model is known as the linear drift model.
where v is the average mobility of the oxygen vacancy (dopant) in the proposed memristive device. In this linear drift model, if applying high voltage or low frequency, then its doping region goes beyond its physical limit (i.e. boundary effect problem), which is practically impossible. Furthermore, even after a small voltage is exerted across a nanoscale device, it experiences high electric fields, which leads to nonlinearity in the device characteristics [2]. Accordingly, researchers incorporate a window function in this linear drift model to overcome the boundary effect problem and introduce nonlinearity into this model. After that, the dynamic expression for the interface is modified as Eq. 3.
To understand the advantages of the proposed window function, firstly, we discuss several reported window functions with their properties and drawbacks. The first parabolic window function was proposed by Strukov et al. [2], which is given in Eq. 4.
This window function is capable of resolving the boundary effect problem, because at the boundary of the device (i.e. x = 1 or x = 0), the interface drift becomes zero, with f(x) = 0. However, it provides only fixed nonlinearity to the device. Therefore, Joglekar et al. [21] proposed another window function with one control parameter to tune the nonlinearity of the device, which is shown in Eq. 5.
where p should be a positive integer only. Even then, it suffers from a boundary lock issue, meaning that if an interface hits any boundary of the device (x = 0 or 1), it is not able to tune the resistance of the memristive device from its terminal resistance (R ON or R OFF ). Thereafter, Biolek et al. [22] proposed a new window function to resolve the boundary lock issue by including a device current parameter in the window function. This window function is represented by Eq. 6, which has one control parameter.
where p is a positive integer only and stp(.) is a step function which has discontinuity at one point. Additionally, it has restricted flexibility in the window function due to utilizing only one control parameter. By considering the above limitations, Prodromakis et al. [23] recommended a parabolic window function with two control parameters which is given in Eq. 7.
where p and j are positive real numbers, which provides better flexibility to the window function. But there is no device current parameter involved in the window, so it cannot handle the boundary lock issue. After taking these constraints into account, an appropriate window function was provided by Zha et al. [15] with two control parameters including device current, which is formulated as Eq. 8.
where p and j are positive real numbers. This is able to resolve the boundary lock issue and also provides good flexibility. However, this window function model has fixed discontinuity at its boundary, which results in the DPHL problem for low-frequency or high-amplitude exerted external stimuli. To improve the flexibility in Zha et al.'s [15] window function, Shi et al. [27] proposed another window function model with one additional control parameter ( a s ), which is responsible for controlling the maximum value of the window [f(x) max ] only up to 1, as mentioned in Eq. 9. Fig. 1 Schematic of the linear drift memristor model where p and j are positive real numbers, and a s is restricted between 0 and 1. Further, Zha et al. [17] again reported another window function with three control parameters, where some of the existing window functions are special cases of this window function, as given in Eq. 10.
where p and j are positive real numbers but q should be a positive integer only, and a is bounded between 0 and 1. This window function has resolved most of the problems associated with previous window functions, but it is not able to resolve window function discontinuity problem, which creates the DPHL problem (after applying high-voltage or low-frequency input, state variable x reaches its limit very quickly, which results in distortion in the current-voltage response of the device). In addition, this window model has only symmetric nonlinearity at both ends of the device, which is practically not always possible. For addressing the DPHL problem, Anusudha et al. [16] defined a cubic parabolic window function in Eq. 11.
where j ∈ R + , and p is a positive integer only. However, this window function has failed to resolve the boundary effect problem because at the boundary of the device, interface drifting is not zero (i.e. at x = 0 or 1; f(x) ≠ 0) and it does not address the boundary lock issue.

Newly proposed window function
After rigorous analysis of several reported window functions, in this section, we come up with an efficient and flexible window function model and also discuss its superior features over existing window functions. This window function has five control parameters considering the device current, which helps to resolve boundary effect, boundary lock and inflexibility. The proposed window function has a unique property of controlling its discontinuity, by which it is able to resolve the DPHL problem without removing the device current parameter from the window function and also improves the programming resistance state of the memristor. It fulfills all the necessary criteria of a window function as mentioned in [17]. Our proposed window function is formulated as Eq. 12.
where p and j are any positive real numbers but q should be only a positive integer. Other two control parameters are restricted as a ∈ (0, 1] and b ∈ [−a, 0] to fulfill the necessary criteria of a window function. The proposed window function is able to overcome the DPHL problem by controlling the discontinuity at its boundary and also improves programming resistance resolution of the memristor, which can enhance the performance of a programmable analog circuit in practical implementation.
From Table 1, we can conclude that our proposed window function is able to produce some of the reported window functions [15,17,22,27] by adjusting its control parameter values. Hence, properties of these reported window functions are inbuilt in our proposed window function model. The impact of control parameter a, j and p of the memristive model characteristics have already been discussed in the literature [15,17]. Then, from Fig. 2 we can observe that the control parameter q only modulates the nonlinearity of the  device without affecting the maximum value of the window function by considering other window control parameters as fixed. When we increase the value of q then the nonlinearity of the window is confined to the boundary. Further, we can see from Fig. 3 that the control parameter b is able to control the functional discontinuity at the boundary of the window function, which helps to resolve the DPHL problem. In the next section, we will see that by adjusting window function discontinuity at the boundary, the DPHL issue is resolved.

Evaluation of proposed window function model
To evaluate the newly proposed window function, we study the boundary effect issue, boundary lock issue, nonlinearity and DPHL issue in the device by taking parameter values as R ON = 100 Ω, R OFF = 16 kΩ, R initial = 0.5 kΩ, D = 10 nm, µ v = 10 -14 m 2 s −1 V −1 , a = 0.8, p = 5, q = 1, b = −0.6, to simulate in SPICE. Here, R initial represents the initial resistance of the memristive device.

Study of the boundary effect issue
In Fig. 4, we can observe that, after applying sufficiently high amplitude voltage [i.e., V m = 10 sin (2πf × t)] to the memristive device, it operates in its terminal resistance range (R ON and R OFF ) and never goes beyond its physical limits (meaning that x is restricted between 0 and 1). Hence, now we can conclude that our proposed window function is free from a boundary effect.

Study of the boundary lock issue
After applying positive and negative sinusoidal voltage to the memristive device, the response of the normalized width is reported in Fig. 5. Here, we can observe that when polarity of the applied voltage changes, then its normalized width (state value) is modulated from its boundary. Therefore, we can say that our proposed window model has successfully resolved the boundary lock issue.

Study of the DPHL issue
When applied electrical stimuli have low frequency or when voltage amplitude is high, then the interface reaches the boundary of the device very quickly, meaning that x suddenly achieves its limiting value (0 or 1). Hence, the memristive device current voltage response is distorted, which is known as a distorted pinched hysteresis loop (DPHL) and is undesirable for any application. From Fig. 6, we can see the I-V response of the proposed model with b = 0, which is distorted in nature, for 1 V and 0.5 Hz applied stimuli and 2 V and 1 Hz applied stimuli. Further, we can see from

Study of memristance resolution
The idea of memristance resolution was proposed in [28], where the value of memristance can be tuned by periodic pulses. However, in the process of memristance tuning by periodic pulses, some error exists because the number of applied pulses should be an integer. Accordingly, designing a memristor model with high precision is very important. As mentioned in [17], control parameter a is able to tune the resolution of the memristance. From Fig. 8 we can see that the additional control parameter b is able to improve the memristance resolution with a constant value of a. In our proposed model, memristance tuning is analyzed by using five unbalanced sinusoidal periodic signals v(t) = +v o sin 2 (2πf × t) for the first three pulses and v(t) = −v o sin 2 (2πf × t) for the next two pulses with a = 0.8, v o = 0.05 and f = 1 Hz for different values of control parameter b, as demonstrated in Fig. 8. Thus, it is clear that if the resolution is high, then it is able to obtain more programmable resistance states of the memristor.
The existing window functions have issues with boundary lock, boundary effect, and inflexibility, but the presented window function is free from these problems and also provides very good flexibility with five control parameters. The DPHL problem was firstly addressed by Anusudha in 2018 [16]. To resolve this problem, Anusudha presented a cubic parabolic window function, but this window function failed to fix the boundary effect and also did not address the boundary lock problem. Hence, our proposed window function is able to fix the DPHL problem by controlling window function discontinuity at the boundary and also improves the resolution of the proposed memristor model. In addition, all the reported window functions have only symmetric nonlinearity at both ends of the device, which is not possible, but the proposed window function has the ability to provide asymmetric nonlinearity at the boundaries of the device by adjusting its control parameters.
A comparative report of the proposed window model with respect to published window function models is shown in Table 2. We can see that all the issues related to the window function have been resolved by our proposed memristor window function model.

Reproducing the response of a ZnO-based memristor
In this subsection, we have reproduced the I-V characteristics of a solution-processed ZnO-based memristive device by simulating the proposed model. In [29], Patil discussed  Fig. 9, the experimental and simulated I-V response of the ZnO memristive device with red and black curves is demonstrated. We can clearly see that the I-V loops for positive current and negative current are not symmetrical, meaning that oxygen vacancy drifting is not symmetrical with respect to device current direction, and also that our model is able to track the switching mechanism of the fabricated device but some short deviations are present near the peak of I-V response. We know that when a memristor is used for programmable resistance, then the resistance value is important at a certain voltage that is known as the read voltage; hence, deviations near the peaks are not very significant for programmable resistance application.
Further, in the next section, we will investigate the potency of our proposed model in an analog gain amplifier circuit.

Implementation in an analog gain amplifier circuit
According to previous discussion, an efficient and flexile window function was built for the linear drift memristor model to resolve DPHL by adjusting discontinuity at the window function boundary and improve the resolution of memristance. Now, in this section we will illustrate the efficacy of the proposed efficient window function linear drift memristor model in an analog differential gain amplifier circuit.
In ordinary analog circuits, after fabricating the circuit, it is very difficult to tune the value of resistance, which restricts its practical implementation. To resolve this issue, instead of a resistor, we introduce a memristor in the analog circuit, which is able to tune its own resistance by applying electrical pulses over it and making it programmable [30]. In Fig. 10, the memristor (programmable resistor) is placed instead of a resistor to control the emitter current of transistor Q 3 in the analog amplifier circuit, which is responsible for tuning the gain of the analog amplifier, and making it a programmable gain amplifier. This gain amplifier works in two modes: amplification and programming. In programming mode, the resistance of the memristor is tuned to a target value by applying an electrical pulse, and V SW is set to 1 between its terminal resistance range (R ON and R OFF ). In amplification mode, after achieving the target resistance, V SW is set to 0, and then the circuit goes into amplification mode and the memristor works as a resistor and makes a voltage divider circuit to the base of transistor Q 3 , which is the deciding factor for amplifier gain by tuning the emitter current of the transistor Q 3 . By analyzing the small signal  where R c = R c1 = R c2 = 3 kΩ, R E = 2 kΩ, R = 2 kΩ and I e3 is the emitter current in the transistor Q 3 which is expressed in Eq. 14. In addition, memristance programming electrical pulses is the same, as mentioned in Sect. 4.4. The analog voltage gain circuit is simulated in SPICE, where the parameter a = 0.5 and R initial = 100 Ω with b = 0.0 and b = −0.6. Moreover, differential mode input voltages are V s+ = V a sin(2πf×t) and V s− = − V a sin(2π f × t), where V a = 20 mV and f = 1 kHz. As Table 3 shows, the resistance of the memristor and the gain of the circuit are closely related to the number of applied electrical pulses, and for achieving the same memristance value, a different number of electrical pulses are required with different values of control parameter Since b = −0.6, the model requires more electrical pulses than with b = 0.0. Hence, it is clear that when b = −0.6, the model can adopt a greater number of discrete memristance states. Therefore, we can conclude that control parameter b improves the resolution of the memristor, which is desirable for any programmable application.

Conclusion
This article introduced a new flexible and efficient window function for a linear drift memristor model with the unique feature of controllable window function discontinuity at the boundaries. The proposed window function is able to reproduce some existing window functions and also resolve all the issues associated with reported window functions. By introducing a key parameter in this proposed model, the functional discontinuity of the window function becomes controllable, which resolves the DPHL issue without removing the device current parameter from the window function and also improves the resolution of the programming resistance of the memristor. This model has the potential to track resistive switching behavior of a solution-processed ZnObased fabricated memristive device with Ag and FTO electrodes and is also able to provide asymmetric nonlinearity in oxygen vacancy drifting with respect to the current direction of the memristive device. Ultimately, the proposed window function is equipped in an analog gain amplifier circuit and makes it programmable with an enhanced number of programming stages of a differential gain amplifier circuit; it has been validated by SPICE simulation.