The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 17th, 2024, 12:39am
Pages: 1
Send Topic Print
how to realize a time-varying signal in verilog-a (Read 2179 times)
wwm101
Junior Member
**
Offline



Posts: 20
china
how to realize a time-varying signal in verilog-a
Jun 23rd, 2008, 6:02am
 
i want to realize  a time-varying sine signal which amplitude  changes linearity  with time,expression as vamp=k×t+vamp0.where k is a coefficient and vamp0 is an initial value。
how to realize it inverilog-a?
thank you in advanced!
Back to top
 
 
View Profile wwm101 weiming022002@yahoo.com   IP Logged
Stefan
Senior Member
****
Offline



Posts: 124

Re: how to realize a time-varying signal in verilog-a
Reply #1 - Jun 23rd, 2008, 6:50am
 
Check the Language reference manual.
This would do it
V(out) <+ k0*$abstime + V0;

Depending on your circuit you should also include a $bound_step .
Back to top
 
 
View Profile 16731287   IP Logged
wwm101
Junior Member
**
Offline



Posts: 20
china
Re: how to realize a time-varying signal in verilog-a
Reply #2 - Jun 24th, 2008, 6:03am
 
first ,thank you for your attention.
i realize in follow code:
//a timing-vary
`include "disciplines.vams"
`include "constants.vams"

module linamp(n1,n2);
      electrical n1,n2;
      real vamp;
      parameter real freq = 1.25e9 from (0:inf);
      parameter real k=100000 from (0:inf);
      analog begin
            vamp =k*$abstime;
           V(n2,n1) <+ vamp * sin(2 * `M_PI * freq * $abstime);
      end
endmodule
Back to top
 
 
View Profile wwm101 weiming022002@yahoo.com   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.