The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Modeling >> Behavioral Models >> Equation in verilogA
https://designers-guide.org/forum/YaBB.pl?num=1271697718

Message started by princemahmmod on Apr 19th, 2010, 10:21am

Title: Equation in verilogA
Post by princemahmmod on Apr 19th, 2010, 10:21am

Hi,
Can anyone help me how to write in verilogA following equation???
y= x/ (a*exp(-0.5*((x-b)/c)^2)) +d

Your help would be greatly appreciated
Thanks

Title: Re: Equation in verilogA
Post by Andrew Beckett on Apr 20th, 2010, 1:30am

I didn't check whether this equation made any sense, and I didn't set the parameter values to anything meaningful - I just wrote it to illustrate the syntax:


Code:
`include "disciplines.vams"

module equation(y,x);
output y;
input x;
electrical x,y;

parameter real a=1.0;
parameter real b=1.0;
parameter real c=1.0;
parameter real d=1.0;

analog begin
 V(y) <+ V(x)/(a*exp(-0.5*pow((V(x)-b)/c,2)))+d;
end

endmodule


Regards,

Andrew.

Title: Re: Equation in verilogA
Post by princemahmmod on Apr 20th, 2010, 8:57am

Thank you so much....Its work...fine...Though I am changing the parameters...but I got your syntax...!!

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.