The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 16th, 2024, 1:55pm
Pages: 1
Send Topic Print
Help Required for Veriloga Code of NAND gate (Read 8223 times)
junaidgill
New Member
*
Offline



Posts: 2

Help Required for Veriloga Code of NAND gate
Nov 24th, 2006, 11:35am
 
hello,
i am new to verilog-a and i am trying to write code for NAND gate. can anyone please help me to complete the behvior:

module NAND(in1, in2, out)

inout in1, in2;
output out;
electrical in1, in2, out;

parameter real vlogic_high = 3.5;

      //behvior of NAND GATE (i need help in this part)

endmodule

i know that i should make use of @(cross(V(in1) - thresh, +1)) but i don't know the correct way.
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: Help Required for Veriloga Code of NAND gate
Reply #1 - Nov 24th, 2006, 11:28pm
 
I just added some examples to the Verilog-AMS page. Take a look at http://www.designers-guide.org/VerilogAMS/functional-blocks/gates/gates.va.

-Ken
Back to top
 
 
View Profile WWW   IP Logged
junaidgill
New Member
*
Offline



Posts: 2

Re: Help Required for Veriloga Code of NAND gate
Reply #2 - Nov 25th, 2006, 2:01am
 
thankyou very much Ken... those are really very helpful examples.....
Back to top
 
 
View Profile   IP Logged
Q8i
New Member
*
Offline



Posts: 1

Re: Help Required for Veriloga Code of NAND gate
Reply #3 - Nov 28th, 2006, 6:28pm
 
Could you please add the same thing for Verilog AMS
i mean the and , or ,xor code for Verilog AMS If you don't mind
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: Help Required for Veriloga Code of NAND gate
Reply #4 - Nov 29th, 2006, 12:13am
 
You can use the gates built-in to verilog when using Verilog-AMS.

But here is a behavioral model for a nand gate in verilog.
Code:
module mynand(in1, in2, out);
    input in1, in2;
    output out;
    assign out = ~(in1 & in2);
endmodule 



-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.