The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Apr 19th, 2024, 4:15pm
Pages: 1
Send Topic Print
Output for a pulse is just a DC voltage. Help! (Read 2126 times)
Rosh
Junior Member
**
Offline



Posts: 21

Output for a pulse is just a DC voltage. Help!
Jan 28th, 2016, 7:02pm
 
Hello everyone,


Here is my code :


Code:
`include "disciplines.vams"

module allo(out);
parameter real td = 10n;    
parameter real tt = 10n;
parameter real t1 = 0n;

   output out;
   voltage  out;
   real Vout, tend;

analog begin

	@ (initial_step) begin
		 Vout = 0;

		 tend = $abstime + td; //return simulation time + td;
	  end

	  @(timer(tend))
		 Vout = 1.8;
		 V(out) <+ transition(Vout,0, td, tt);
	   end


endmodule
 





I expect to get a pulse with a finite rise and fall time. Instead i get this:
Back to top
 

Screen.JPG
View Profile   IP Logged
deltasigmaADC
Junior Member
**
Offline



Posts: 10

Re: Output for a pulse is just a DC voltage. Help!
Reply #1 - Jan 29th, 2016, 2:58am
 
Your variable Vout is always assigned to 1.8. So you should be getting a DC at output, which is what you are seeing. Probably you wanted to update the variable to 0 at some point in time as well.

Cheers
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1998
Massachusetts, USA
Re: Output for a pulse is just a DC voltage. Help!
Reply #2 - Jan 29th, 2016, 10:55am
 
Your indentation is confusing; it looks like the V(out) <+ transition is inside the @timer block.

Code:
analog begin
    @ (initial_step) begin
	  Vout = 0;
	  tend = $abstime + td; //return simulation time + td;
    end

    @(timer(tend)) begin
	  Vout = 1.8;
    end

    V(out) <+ transition(Vout,0, td, tt);

end
 

Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   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.