Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

NEED help for NAND simulation in spice

Status
Not open for further replies.

yzzrlzc

Newbie level 4
Joined
Dec 12, 2009
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,319
Xand 1 2 3 NAND2
V1 1 0 DC 5
V2 2 0 PULSE(0 5 0 0 0 5n 20n)
.tran 1ns 300ns

*NAND subcircuit
***********************************
.subckt NAND2 A B out
M1000 out A VDD VDD pfet w=10u l=1u
+ ad=30p pd=22u as=30p ps=32u
M1001 VDD B out VDD pfet w=10u l=1u
+ ad=0p pd=0u as=0p ps=0u
M1002 a_n52_6# A Gnd Gnd nfet w=10u l=1u
+ ad=30p pd=22u as=15p ps=16u
M1003 out B a_n52_6# Gnd nfet w=10u l=1u
+ ad=15p pd=16u as=0p ps=0u
C0 B gnd 3.4fF
C1 VDD gnd 49.4fF
******rail voltage***************
VDD VDD 0 DC 5V
Vgnd Gnd 0 DC 0
.ends NAND2
**********************************
.MODEL nfet NMOS ( .....)
.MODEL pfet NMOS ( .....)
.end

I cant get a correct output for node3(out in subcircuit)
can someone tell me what is wrong with it ?
do i need to make VDD and VGnd global?
 

yzzrlzc said:
do i need to make VDD and VGnd global?

Yes. Otherwise the ground & vdd within the subcircuit will not connect outside the subcircuit.

Keith
 

my problem is not the global command
my problem is that I typed " plot 1" to show the result, while the right way to do it is " plot v(1)" anyway, rly appreciate your help
 

I didn't spot that you had put the power source within the subcircuit. Normally the power source would be outside the subcircuit and the connections would have to be global.

Keith
 

i am sorry i am just a beginner
so using .global command should be as follows:

.global VDD
.global Vgnd
VDD VDD 0 DC 5
Vgnd Gnd 0 DC 0

.Xand 1 2 3 NAND2
.........
.subckt. nand2 A B out
(.......)
.ends
.model nfet/pfet NMOS/PMOS
(.......)

right???
 

I would normally expect something like this:

.GLOBAL VDD! GND!
Vsupply VDD! 0 DC 5

Xand 1 2 3 NAND2
...

.subckt. nand2 A B out
M1000 out A VDD! VDD! pfet w=10u l=1u
+ ad=30p pd=22u as=30p ps=32u
M1002 a_n52_6# A GND! GND! nfet w=10u l=1u
+ ad=30p pd=22u as=15p ps=16u
...
.ends

. model ...

.end

You don't need to connect GND! to node zero in Hspice - it is treated as node zero. Other simulators may need a zero volt source to node zero (such as my simulator!).

I don't think you need the exclamation mark in Hspice, but it is common. I am not sure why, but it may be due to the digital libraries really coming from Cadence. I am not sure if it means it is global in Cadence without needing the GLOBAL statement. Anyway try it without the ! and see what happens.

Keith.
 

rly rly rly appreciate your help

sorry for replying late:D
 

Re: VDD VDD 0 DC 5

I forgot to mention - it is best not to give a node and voltage source the same name. Even if the simulator doesn't get confused, you might!

Keith
 

ok

but actually, i always use it this way.:D
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top