Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Memristor simulation in HSPICE

Status
Not open for further replies.

manish1468

Newbie level 4
Joined
May 14, 2014
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
59
hi everyone, I have used the code given below but i am getting opposite hysteresis curve. please help me with this.

Code:
* MEMRISTOR
* Ron, Roff - Resistance in ON / OFF States
* Rinit - Resistance at T=0
* D - Width of the thin film
* uv - Migration coefficient
* p - Parameter of the WINDOW-function
* for modeling nonlinear boundary conditions
* x - W/D Ratio, W is the actual width
* of the doped area (from 0 to D)
*

.SUBCKT memristor Plus Minus
+ Ron=100 Roff=16K Rinit=11K D=10N uv=10F p=10

* DIFFERENTIAL EQUATION MODELING *

.PARAM f(x,p)= '1-pow((2*x-1),(2*p))'
Gx 0 x value='I(Emem)*uv*Ron/pow(D,2)*f(V(x),p)'
Cx x 0 1 IC='(Roff-Rinit)/(Roff-Ron)'
Raux x 0 1T

* RESISTIVE PORT OF THE MEMRISTOR *
Emem plus aux value='-I(Emem)*V(x)*(Roff-Ron)'
Roff aux minus Roff

*Flux computation*

*Eflux flux 0 value={SDT(V(plus,minus))}

*Charge computation*

*Echarge charge 0 value={SDT(I(Emem))}

* WINDOW FUNCTIONS
* FOR NONLINEAR DRIFT MODELING *

*window function, according to Joglekar
*.func f(x,p)={1-(2*x-1)^(2*p)}
*proposed window function
*;.func f(x,i,p)={1-(x-stp(-i))^(2*p)}
.ENDS memristor

Xmemrist aa 0 memristor Ron=100 Roff=16K Rinit=11K D=10N uv=10F p=10
Vtest aa 0 SIN(0 1.2V 1 0 0 0)
.tran 100U 5
.plot tran V(aa) I(Vtest)
.option list node post=2 ingold=2 runlvl=0
.end

Thank you
 
Last edited by a moderator:

replace i and v in plot command
 

replace i and v in plot command

dear ahmd1954

I got the correct curve for sine wave input but i am not getting correct hysteresis curve. But i am not getting correct hysteresis curve for square pulse input. Also, please help mewith how to plot the resistance of the memristor which should keep changing between Ron and Roff for +veand -ve polarity.

Thanking you in anticipation.

Manish
 

that hysteresis curve is for sin wave. what is your plot for square wave and what do you expect from that?
I didn't plot resistance of memristor but I think you should perform dc sweep.
 

that hysteresis curve is for sin wave. what is your plot for square wave and what do you expect from that?
I didn't plot resistance of memristor but I think you should perform dc sweep.

Dear ahmd1954
I am applying square pulse input as given in the HSPICE code given below. With the polarity of square pulse the resistance of memristor should switch between Ron and Roff. I am unable to plot the mermristance state of memristor. Please help me with this.

Thanking you in anticipation.

Manish

HSPICE code for memristor
* MEMRISTOR
* Ron, Roff - Resistance in ON / OFF States
* Rinit - Resistance at T=0
* D - Width of the thin film
* uv - Migration coefficient
* p - Parameter of the WINDOW-function
* for modeling nonlinear boundary conditions
* x - W/D Ratio, W is the actual width
* of the doped area (from 0 to D)
*

.SUBCKT memristor Plus Minus
+ Ron=100 Roff=16k Rinit=11k D=10N uv=10F p=10

* DIFFERENTIAL EQUATION MODELING *

.PARAM f(x,p)= '1-pow((2*x-1),(2*p))'
Gx 0 x value='I(Emem)*uv*Ron/pow(D,2)*f(V(x),p)'
Cx x 0 1 IC='(Roff-Rinit)/(Roff-Ron)'
Raux x 0 1T

* RESISTIVE PORT OF THE MEMRISTOR *
Emem plus aux value='-I(Emem)*V(x)*(Roff-Ron)'
Roff aux minus Roff

*Flux computation*
*Eflux flux 0 value={SDT(V(plus,minus))}
*Charge computation*
*Echarge charge 0 value={SDT(I(Emem))}
*.meas TRAN charge INTEG I(Emem) FROM = 100u TO = 5s
* WINDOW FUNCTIONS
* FOR NONLINEAR DRIFT MODELING *
*window function, according to Joglekar
*.func f(x,p)={1-(2*x-1)^(2*p)}
*proposed window function
*;.func f(x,i,p)={1-(x-stp(-i))^(2*p)}
.ENDS memristor

*.param Vmin=-1V Vmax=1V
*.PARAM Vinitial=Vmin Vpulsed=Vmax td=0
*+ tr=1ns tf=1ns PW=100us per='tr+tf+2*pw'

Xmemrist aa 0 memristor
Vtest aax 0 pulse (Vinitial Vpulsed td tr tf PW per)
Vaux aax aa 0
.tran 100u 1m
.plot tran V(aa) I(Vaux)
.probe rmem=par('(v(aa))/I(Vaux)')
.option list node post=2 ingold=2 runlvl=0
.end
 
Last edited:


can you put your output here?

Untitled.jpgUntitled1.png

Please help me to plot the resistance of memristor.

The second image is for the HSPICE code of HP memristor given below:
* HP mem model
* TE: top electrode
* BE: bottom electrode
* XSV: external connection to plot state variable (that is not used otherwise)
* V(f):f(x)
* V(f1):f1(Vin)
.SUBCKT memristor TE BE XSV mre
+ Ron=1k Roff=20k x0=0.5 D=10N uv=10F p=2

* window function
*biolek window
*.Param f(V1,I1,p)='1-pow((V1-stp(-I1)),2*p)'
* joglekar window
.PARAM f(V,p)='1-pow((2*V-1),2*p)'

* mem I-V relationship
.PARAM IVRel(V1,V2)='V1/(Ron*V2+Roff*(1-V2))'

* circuit to determine state variable

Gx 0 XSV value='I(Gmem)*uv*Ron*f(V(XSV,0),p)*V(out)/pow(D,2)'
Cx XSV 0 5u
* see value of window func
Ga 0 mre value='(Ron*x0+Roff*(1-x0))'
r mre 0 1

* Threshold 1V
G1 gnd out VCCS PWL(1) TE BE
+ -1V,0 1V,0 1.00001V,1 IC=0
R_1 out gnd 1

.ic V(XSV)=x0

* Current source representing memristor
Gmem TE BE value='IVRel(V(TE,BE),V(XSV,0))'

.ENDS memristor

.param Vmin=-3.6V Vmax=3.6V
.PARAM Vinitial=Vmin Vpulsed=Vmax td=0
+ tr=1ns tf=1ns PW=100us per='tr+tf+2*pw'

Xmemrist TE BE XSV mre memristor
Vtest TE BE pulse (Vinitial Vpulsed td tr tf PW per)
.tran 100u 1m
.plot tran V(TE,BE) I(Vtest)
.probe rmem=par('(v(TE,BE))/I(Vtest)')
.option list node post=2 ingold=2 runlvl=0
.end
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top