Beginning of Presentation CDEEP EE 705/707 NGSPICE - Demo - - PowerPoint PPT Presentation

beginning of presentation
SMART_READER_LITE
LIVE PREVIEW

Beginning of Presentation CDEEP EE 705/707 NGSPICE - Demo - - PowerPoint PPT Presentation

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


slide-1
SLIDE 1

Beginning of Presentation

IIT Bombay

EE – 705/707 NGSPICE - Demo Presented By: Sandeep Kasliwal (TA) CDEEP

Autumn 2009 Instructor : Prof. Maryam Shojaei Baghini

slide-2
SLIDE 2

Slide 1 IIT Bombay

Autumn 2009 Instructor : Prof. Maryam Shojaei Baghini

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.

slide-3
SLIDE 3

IIT Bombay

Autumn 2009 Instructor : Prof. Maryam Shojaei Baghini

Types Of Analysis

  • DC
  • AC Small Signal
  • Transient
  • Pole-Zero
  • Small Signal Distortion
  • Sensitivity
  • Noise

Slide 2

slide-4
SLIDE 4

IIT Bombay

Autumn 2009 Instructor : Prof. Maryam Shojaei Baghini

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.

Slide 3

slide-5
SLIDE 5

IIT Bombay

Autumn 2009 Instructor : Prof. Maryam Shojaei Baghini

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

Slide 4

slide-6
SLIDE 6

Slide 5 IIT Bombay

Autumn 2009 Instructor : Prof. Maryam Shojaei Baghini

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.

slide-7
SLIDE 7

IIT Bombay IIT Bombay

NGSPICE – Example

Inverter Circuit

Slide 6

Autumn 2009 Instructor : Prof. Maryam Shojaei Baghini

slide-8
SLIDE 8

Slide 7 IIT Bombay

Autumn 2009 Instructor : Prof. Maryam Shojaei Baghini

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.

slide-9
SLIDE 9

Slide 8 IIT Bombay

Autumn 2009 Instructor : Prof. Maryam Shojaei Baghini

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

Cont…

slide-10
SLIDE 10

Slide 9 IIT Bombay

Autumn 2009 Instructor : Prof. Maryam Shojaei Baghini

.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

Cont…

slide-11
SLIDE 11

Slide 10 IIT Bombay

Autumn 2009 Instructor : Prof. Maryam Shojaei Baghini

  • 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

Execution Of Script File

slide-12
SLIDE 12

IIT Bombay IIT Bombay

Output Plot

Slide 11

Autumn 2009

  • Prof. Maryam Shojaei Baghini
slide-13
SLIDE 13

IIT Bombay IIT Bombay

References

Slide 12

Autumn 2009 Instructor : Prof. Maryam Shojaei Baghini

  • http://newton.ex.ac.uk/teaching/CDHW/Electroni

cs2/userguide/

slide-14
SLIDE 14

IIT Bombay

Thank you