The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
May 18th, 2024, 3:04am
Pages: 1
Send Topic Print
Equation in verilogA (Read 2745 times)
princemahmmod
New Member
*
Offline



Posts: 2

Equation in verilogA
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
Back to top
 
 
View Profile   IP Logged
Andrew Beckett
Senior Fellow
******
Offline

Life, don't talk to
me about Life...

Posts: 1742
Bracknell, UK
Re: Equation in verilogA
Reply #1 - 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.
Back to top
 
 
View Profile WWW   IP Logged
princemahmmod
New Member
*
Offline



Posts: 2

Re: Equation in verilogA
Reply #2 - Apr 20th, 2010, 8:57am
 
Thank you so much....Its work...fine...Though I am changing the parameters...but I got your syntax...!!
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.