Presentation On Using SPICE: by Shweta - Kulkarni
Presentation On Using SPICE: by Shweta - Kulkarni
By Shweta . Kulkarni
OUTLINE
Introduction to SPICE DC Analysis Transient Analysis Locate poles and zeros Perform signal transfer functions Determination signal frequency response Signal sensitivities Fourier, distortion and noise analysis
Introduction
SPICE-Simulation Program with Integrated Circuits Emphasis Developed in 1970s at Berkeley by university of California General purpose analog simulator PSPICE, which runs on the PC and HSPICE is a industry standard SPICE takes a circuit netlist and performs mathematical simulation of the circuits behavior. A netlist describes the components in the circuit and how they are connected. Types of input file Netlist , Schematics
Components
Independent and dependent voltage and current sources Resistors Capacitors Inductors Mutual inductors Transmission lines Operational amplifiers Switches Diodes Bipolar transistors MOS transistors JFET MOSFET Digital gates
Two other statements are required: the title statement and the end statement.
The title statement is the first line and can contain any information, while the end statement is always .END
TITLE STATEMENT ELEMENT STATEMENTS . . COMMAND (CONTROL) STATEMENTS OUTPUT STATEMENTS .END
Data Statements
To Specify the Circuit Components and Topology
Example: RESISTOR General form: RXXX R N1 N2 Values 2 3 50K
Control Statements
To Specify the Type of Analysis Calculate DC Operating Point
.OP Statement This statement instructs Spice to compute the DC operating points: voltage at the nodes current in each voltage source operating point for each element
.DC Statement This statement allows you to increment (sweep) an independent source over a certain range with a specified step.
General form: .DC SRCNAM VSTART VSTOP VINCR [SRC2 START2 STOP2 INCR2]
SRC name is the name of the source, START and STOP are the starting and ending value, respectively; and STEP is the size of the increment. Examples: .DC V1 0 20 2 .DC Vds 0 5 0.5 Vgs 0 5 1
Transient Analysis
The transient analysis portion of SPICE computes the transient output variables as a function of time over a user-specified time interval. The initial conditions are automatically determined by a dc analysis.
.TRAN Statement
This statement specifies the time interval over which the transient analysis takes place, and the time increments. The format is as follows:
TSTART is the starting time (if omitted, TSTART is assumed to be zero) TMAX is the maximum step size. Example .TRAN 1NS 100NS
Pole-Zero Analysis
The pole-zero analysis portion of SPICE computes the poles and/or zeros in the small-signal ac transfer function. The program first computes the dc operating point and then determines the linearized, small-signal models for all the nonlinear devices in the circuit. This circuit is then used to find the poles and zeros of the transfer function. The transfer function can either be Voltage Gain (output voltage/input voltage) or Impedance (output voltage/input current).
.PZ: Pole-Zero Analysis General form: .PZ NODE1 NODE2 NODE3 NODE4 CUR POL . PZ NODE1 NODE2 NODE3 NODE4 CUR ZER . PZ NODE1 NODE2 NODE3 NODE4 CUR PZ .PZ NODE1 NODE2 NODE3 NODE4 VOL POL .PZ NODE1 NODE2 NODE3 NODE4 VOL ZER .PZ NODE1 NODE2 NODE3 NODE4 VOL PZ
Example
Example
Consider the circuit in the image, where a Pole-Zero analysis is defined with the following parameter values: Input Node = IN Input Reference Node = 0 Output Node = OUT Output Reference Node = 0 Transfer Function Type = V ( output) / V( input) Analysis Type = Poles and Zeros The entry in the SPICE netlist will be: .PZ IN 0 OUT 0 VOL PZ
Running the simulation will yield the output wave plot shown in the image below:
DEC and OCT for a decade and octave variation respectively. NP stands for the number of points ND and NO for the number of frequency points per decade and octave. FSTART and FSTOP are the start and stopping frequencies in Herz
Signal Sensitivities
Spice will calculate either the DC operating-point sensitivity or the AC small-signal sensitivity of an output variable with respect to all circuit variables, including model parameters. Spice calculates the difference in an output variable (either a node voltage or a branch current) by perturbing each parameter of each device independently.
.SENS: DC or Small-Signal AC Sensitivity Analysis General form: .SENS OUTVAR .SENS OUTVAR AC DEC ND FSTART FSTOP .SENS OUTVAR AC OCT NO FSTART FSTOP .SENS OUTVAR AC LIN NP FSTART FSTOP Examples: .SENS V(1,OUT) .SENS V(OUT) AC DEC 10 100 100k
Distortion Analysis
.DISTO: Distortion Analysis The Disto line does a small-signal distortion analysis of the circuit. Syntax .DISTO DEC ND Fstart Fstop .DISTO OCT NO Fstart Fstop .DISTO LIN NP Fstart Fstop Example .DISTO DEC 10 1kHz 100Mhz
Output Statements
Specifies what outputs are to be printed or plotted. Types
.PRINT Statement A print is a table of data points Syntax .PRINT PRtype OV1 <OV2; ... OV8> Example: .PRINT DC I(R1) I(R2) I(R3) I(R4) .PLOT Lines Syntax: .PLOT TYPE OV1 OV2 OV3 Example .PLOT DC V(4) V(5) V(1)