The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 17th, 2024, 12:20am
Pages: 1
Send Topic Print
Turning on white_noise in a switch (Read 3421 times)
DaffyDuck
New Member
*
Offline



Posts: 6

Turning on white_noise in a switch
Apr 16th, 2008, 2:23am
 
Hi All,

I am trying to model the white noise due to the switch resistance with the following statements:

if ( V(ps,ns) > thresh )
     V(p,n) <+ ron * I(p,n) + white_noise(4*`P_K*$temperature*ron, "thermal");  // (A)
else
     I(p,n) <+ 0;

Got the "error" message - analog operator embedded in conditionally executed statement or expression.

I tried to do an assignment to a real var, eg.   noise = white_noise(4*.....  ), and then add "noise" to the contribution statement (A) in place of the lengthy white_noise expression. But I got the error message to the effect that small-signal functions cannot be assigned.

What's the way to do it? Shocked
Back to top
 
 
View Profile   IP Logged
Stefan
Senior Member
****
Offline



Posts: 124

Re: Turning on white_noise in a switch
Reply #1 - Apr 16th, 2008, 2:40am
 
Add white noise to an isolated electrical node.
Take the voltage from that node and add it to your desired variable/statement/whatsoever.
Back to top
 
 
View Profile 16731287   IP Logged
DaffyDuck
New Member
*
Offline



Posts: 6

Re: Turning on white_noise in a switch
Reply #2 - Apr 17th, 2008, 1:22am
 
Hi Stefan,

Thank you! That works.  :D
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: Turning on white_noise in a switch
Reply #3 - Apr 17th, 2008, 11:09am
 
Another approach would be this:

V(p,n) <+ white_noise(4*`P_K*$temperature*ron, "thermal");  // (A)
if ( V(ps,ns) > thresh )
     V(p,n) <+ ron * I(p,n);  // (A)
else
     I(p,n) <+ 0;

Verilog-A's value-retention rules say that, if you contribute to the flow (I), then all potential contributions are discarded.  Now your white_noise call is not inside the if() statement.

BTW: I personally believe the error from your simulator is incorrect.  white_noise is *not* an analog operator along the lines of idt() or absdelay(); it appears in "4.5 Analysis dependent funtions" rather than "4.4 Analog operators" in the Verilog-AMS language reference manual (2.2).
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.