promach
Advanced Member level 4
Cross posting from https://sourceforge.net/p/ngspice/discussion/133842/thread/f1d04424/?limit=25#6896
Why am I getting negative output impedance using the following test circuit ?
Why am I getting negative output impedance using the following test circuit ?
Code:
*CMOS inverter
.PARAM V_SUPPLY = 3.3
.PARAM V_OUT = 2
*.PARAM INP_FREQ = '#INP_FREQ#'
*.PARAM INP_PERIOD = '1/INP_FREQ'
*.PARAM NO_PERIODS = '4'
*.PARAM TMEAS_START = '(NO_PERIODS-1)*INP_PERIOD'
*.PARAM TMEAS_STOP = '(NO_PERIODS)*INP_PERIOD'
.PARAM AC_POINTS = 10
.PARAM AC_START = 1000
.PARAM AC_STOP = 1E6
*** *** SUPPLY VOLTAGES *** ***
VDD VDD 0 'V_SUPPLY'
VSS VSS 0 0
*** *** INPUT SIGNAL *** ***
VSIG IN VSS AC 1 DC 1
*** *** CIRCUIT UNDER TEST *** ***
MP OUT IN VDD VDD P1 W=0.07963 L=0.001
MN OUT IN VSS VSS N1 W=0.03982 L=0.001
** CL OUT VSS 3p
RIN IN VSS 1G
Rf OUT IN 0.01
** The input can be either biased with a DC source, or a DC feedback circuit. Using a DC feedback circuit (RC, inductor, whatsoever) makes only sense if there's no DC voltage source, see https://www.edaboard.com/showthread.php?377214-Noise-in-CMOS-Inverter&p=1617292&viewfull=1#post1617292
*** *** ROUT TEST SIGNAL WITH FIXED 1A CURRENT AND VARIABLE TEST VOLTAGE (VOUT) *** ***
*VOUT VOUT 0 'V_OUT'
IOUT OUT VSS AC 1 DC 1
*** *** ANALYSIS *** ***
*.AC dec 'AC_POINTS' 'AC_START' 'AC_STOP'
*.TRAN 'INP_PERIOD/1000' 'NO_PERIODS*INP_PERIOD'
*
*.PROBE TRAN V(IN)
*.PROBE TRAN V(OUT)
.OPTION POST PROBE ACCURATE
.include modelcard.nmos
.include modelcard.pmos
.control
*AC dec 'AC_POINTS' 'AC_START' 'AC_STOP'
AC dec 10 1000 1E6
let ROUT=OUT/(i(Vss))
plot ROUT
print ROUT > ROUT.log
.endc
.END