IIT Bombay Beginning of Presentation CDEEP EE – 705/707 NGSPICE - Demo Presented By: Sandeep Kasliwal (TA) Autumn 2009 Instructor : Prof. Maryam Shojaei Baghini
IIT Bombay Slide 1 Introduction NGSPICE is a general-purpose circuit simulation program for nonlinear dc, nonlinear transient, and linear ac analysis. Circuits may contain resistors, capacitors, inductors, mutual inductors, independent voltage and current sources, four types of dependent sources, lossless and lossy transmission lines, switches, uniform distributed RC lines, and the 5 most common semiconductor devices: diodes, BJTs, JFETs, MESFETs, and MOSFETs. Autumn 2009 Instructor : Prof. Maryam Shojaei Baghini
IIT Bombay Slide 2 Types Of Analysis DC AC Small Signal Transient Pole-Zero Small Signal Distortion Sensitivity Noise Autumn 2009 Instructor : Prof. Maryam Shojaei Baghini
IIT Bombay Slide 3 DC Analysis It determines the dc operating point of the circuit with inductors shorted and capacitors opened. It’s options are specified on the .DC, .TF, and .OP command lines. The dc small-signal value of a transfer function, input resistance, and output resistance can also be computed. The dc analysis can also be used to generate dc transfer curves. Autumn 2009 Instructor : Prof. Maryam Shojaei Baghini
IIT Bombay Slide 4 AC Analysis It computes the ac output variables as a function of frequency (user-specified range). The program first auto. computes the dc operating point of the circuit and determines linearized, small- signal models for all of the nonlinear devices in the circuit. The desired output of an ac small-signal analysis is usually a transfer function (voltage gain, trans- impedance, etc.). Autumn 2009 Instructor : Prof. Maryam Shojaei Baghini
IIT Bombay Slide 5 Transient Analysis It computes the transient output variables as a function of time over a user-specified time interval. The initial conditions are auto. determined by a dc analysis. All sources which are not time dependent (for example, power supplies) are set to their dc value. The transient time interval is specified on a “.TRAN “ command line. Autumn 2009 Instructor : Prof. Maryam Shojaei Baghini
IIT Bombay IIT Bombay Slide 6 NGSPICE – Example Inverter Circuit Autumn 2009 Instructor : Prof. Maryam Shojaei Baghini
IIT Bombay Slide 7 Netlist & Commands * Script file is shown below (comment starts with *) * The following line includes MOS model file *”spice_tsmc_model.txt” .include spice_tsmc_model.txt * Declaring m1 and m2 instances of pmos and nmos m1 vout vin vdd vdd CMOSP L = 0.18u W = 0.72u m2 vout vin 0 0 CMOSN L = 0.18u W = 0.18u * Here L = a and W = b overwrites default values of L & W *mentioned in model file. Autumn 2009 Instructor : Prof. Maryam Shojaei Baghini
IIT Bombay Slide 8 Cont… * Electrical sources used * In Inverter Example: input voltage source and supply * voltage Vinput vin 0 dc 0 Vsupply vdd 0 dc 1.8 * The following line directs ngspice to perform dc analysis .dc vinput 0 1.8 0.01 * ngspice execution commands are * between ”.control” & ”. endc ” commands. Autumn 2009 Instructor : Prof. Maryam Shojaei Baghini
IIT Bombay Slide 9 Cont… .control * Running the script file run * ”print v(N)” prints the voltage at node ”N” print v(vout) * plot the voltage of input(vin) & output(vout) nodes, * & plot ”0.9” line on the output plot plot v(vout) v(vin) (0.9) (1.62) (.18) * Create inv_dc_char.ps file of output plot set hcopydevtype = postscript hardcopy inv_dc_char.ps v(vout) v(vin) (0.9) (1.62) (.18) .endc .end Autumn 2009 Instructor : Prof. Maryam Shojaei Baghini
IIT Bombay Slide 10 Execution Of Script File Save the script file as ” filename.spice ” or “filename.cir” ”.spice” or ”.cir” extention is not compulsory but it is a good practice. The following command in linux terminal will execute the script file, > ngspice filename.spice Autumn 2009 Instructor : Prof. Maryam Shojaei Baghini
IIT Bombay IIT Bombay Slide 11 Output Plot Autumn 2009 Prof. Maryam Shojaei Baghini
IIT Bombay IIT Bombay Slide 12 References http://newton.ex.ac.uk/teaching/CDHW/Electroni cs2/userguide/ Autumn 2009 Instructor : Prof. Maryam Shojaei Baghini
IIT Bombay Thank you
Recommend
More recommend