The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Mar 28th, 2024, 5:46pm
Pages: 1
Send Topic Print
VerilogA code for Ideal MOS switch (Read 4478 times)
ashrafSazid
New Member
*
Offline



Posts: 5
Germany
VerilogA code for Ideal MOS switch
Apr 03rd, 2017, 8:57am
 
Hi, Does anyone have a code for Ideal Switch ( MOS Switch) in VerilogA? I tried one but that is not working at all. Please have a look at my code. suggest me how I can do it or Please provide me a code if you have.

module simple_switch(in, out, tp);

input            in, tp;

output            out;

electricl      in, out, tp;

parameter      real      vth =0.4;

real      vout
analog begin

if (V(tp) >= vth) begin
     vout = V(in);
     end else vout = 0;
     
     V(out) <+ vout;
end
endmodule
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: VerilogA code for Ideal MOS switch
Reply #1 - Apr 5th, 2017, 12:10am
 
Check out http://www.designers-guide.org/VerilogAMS/ -- basic models -- relays
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.