The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 16th, 2024, 8:37am
Pages: 1
Send Topic Print
AMS model for a CMOS switch (Read 4205 times)
k_arkal
New Member
*
Offline



Posts: 4

AMS model for a CMOS switch
Dec 16th, 2008, 7:43am
 
Hi,
What is the correct way of writing AMS code to model a cmos transmission gate switch?

Thanks,
Back to top
 
 
View Profile   IP Logged
rajdeep
Senior Member
****
Offline



Posts: 220
UK
Re: AMS model for a CMOS switch
Reply #1 - Dec 16th, 2008, 10:37am
 
I would say that depends on your requirement!
If you intend to write an ideal transmission switch model, just to get the functionality and use
it in another design for verifying the bigger design then it's pretty simple.
Use something like..

@(cross(V(en) -threshold,+1))
               ;
if(V(en) > threshold)
        V(in,out) <+ 0;                  ..... (1)
else
        I(in,out) <+ 0;                    ......(2)
for one of the switches. Similarly for the other switch of your transmission gate..write
a similar code. Well, this could be your  simple switch model!!
It;s better to use some finite on resistance in (1) and off resistance in (2). This makes
the model more realistic and might avoid all those nasty convergecne issues! If you
are using Verilog-AMS then you can treat the enable as a digital signal and write it
as if(en). Check   for the currect syntax.

But, if you want to model other features of transmission gate, such as input cap, output cap etc.
then you need to keep adding to this simple model. For example, you may like to use slew to model
the finite slew rate associated with any realistic switch. Also, your CMOS Tx will have some
drops across the switch due to finite threshold voltages of the mos!! There's a sea of things you might like to model!! Hope it helps!

Rajdeep
Back to top
 
 

Design is fun, verification is a requirement.
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: AMS model for a CMOS switch
Reply #2 - Dec 16th, 2008, 10:40pm
 
A small comment on Rajdeep's response:
In Verilog-AMS the enable line would normally be digital. In this case, you would use something like ...

@(posedge en or negedge en)
   ;
if (en)
   V(in,out) <+ 0;
else
   I(in,out) <+ 0;

-Ken
Back to top
 
 
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.