This directory contains the chapters for the text book, "LTSpice
for Microelectronic Circuits, 1st Edition" by Roberts.
All the LTSPICE files as they appear in the textbook are also listed below for easy access.
The DC operating point of a circuit is found using the Spice directive:
.OP
A DC transfer curve can be created using the following Spice directive:
.DC source_name start_value stop_value step-value
A small-signal AC analysis is performed using the following Spice directive:
.AC {LIN,OCT,DEC} points frequency_start frequency_stop
A transient analysis is performed using the following Spice directive with initial condition:
.TRAN time_step time-stop no_print_time max_step_size
.IC V(node_1)=value V(node_2)=value ...
Figure 1.3: First Example of chapter
Figure 1.8: Resistive Network With Dependent Sources
Figure 1.11: Transient Response Of A 3-Stage Linear Amplifier
Figure 1.14: Investigating Initial Conditions Established By LTSpice
Figure 1.19: Frequency Response Behavior Of A Voltage Amplifier
The DC operating point of a circuit is found using the Spice directive:
.OP
A DC transfer curve can be created using the following Spice directive:
.DC source_name start_value stop_value step-value
A small-signal AC analysis is performed using the following Spice directive:
.AC {LIN,OCT,DEC} points frequency_start frequency_stop
A small-signal transfer function analysis is performed using the following Spice directive:
.TF output_port input_source_name
A transient analysis is performed using the following Spice directive with initial condition:
.TRAN time_step time-stop no_print_time max_step_size
.IC V(node_1)=value V(node_2)=value ...
A circuit component can be assigned a parameterized value by identifying its value between brackets { parameter } and including the following Spice directive:
.PARAM parameter = value
Any analysis can be repeated by specifying a range of values for a particular circuit variable using the following parameter sweep command:
.STEP circuit_varaible start_value stop_value increment_value
An alternative manner in which to perform an analysis can be repeated by first specifying a component with a parametric value x_value set between {x_value} and specifying a range of values for this parameter using the following Spice directive:
.STEP PARAM x_value start_value stop_value increment_value
Conversely, analysis can be repeated by first specifying a component with a parametric value x_value set between {x_value} and specifying a list of values for this parameter using the following Spice directive:
.STEP PARAM x_value LIST value_list
Any analysis can be repeated by specifying a range of values for a particular model parameter using the following parameter sweep command:
.STEP model_parameter start_value stop_value increment_value
A subcircuit described by SDL can be included with the circuit schematic; A subcircuit begins and ends as follows:
.SUBCKT subcircuit_name list_of_nodes; SDL circuit description; .ENDS subcircuit_name
A subcircuit can be stored as a text file in a local directory and read into the Spice netlist by using the .include or .inc Spice directive command:
.INCLUDE file_path/file_name or .INC file_path/file_name
A call to a subcircuit in the SDL is to include an element description that begins with the letter X and is followed by the node connections and subcircuit name as follows:
Xname node_connections_to_subcircuit subcircuit_name {parameter_list}
Figure 2.2: Inverting Amplifier Configuration
Figure 2.5: The Miller Integrator
Figure 2.10: The Miller/Damped Integrator Comparison
Figure 2.14: The Miller/Damped Integrator Comparison Using .Step Directive
Figure 2.16: Instrumentation Amplifier
Figure 2.21: Inverting Amplifier With Gain -10 Described using a Subcircuit Description Typed Directly on Schematic
Figure 2.25: Inverting Amplifier With Gain -10 using Subcircuit File Access through User Define Folder Path
Figure 2.28: Inverting Amplifier With Op-Amp Subcircuit with Frequency Dependent Input-Output Behavior
Figure 2.34: Inverting Amplifier With Op-Amp Subcircuit with Large-Signal Input-Output Behavior
Figure 2.37: Unity-Gain Amplifier with Slew-Rating Effects
Figure 2.41: Instrumentation Amplifier With Non-ideal Op-Amp Effects Included
Figure 2.45: Inverting Amplifier With Non-ideal Op-Amp Effects Included
A circuit component can be assigned a parameterized value by identifying its value between brackets { parameter } and including the following Spice directive:
.PARAM parameter = value
Often one is required to compare the simulation results of one active device with others. To gather the results into one display window, a .STEP directive can be used to cycle through a listing of device models once the model name is given an “ako” (a kind of) designation. For example, assuming the following two models of diode behavior are assigned as follows:
.model 1mA_diode D (Is=100pA n=1.679)
.model 1 ako:1ma_diode
.model bkdwn_diode D (Is=100pA n=1.679 BV=10V IBV=1nA)
.model 2 ako:bkdwn_diode
The following .STEP command can be used to perform two simulations involving these two device models:
.STEP PARAM model_parameter LIST {model_numbers}
The temperature of a circuit can be changed under some Spice directive using the .TEMP Spice directive command:
.TEMP temperature_list
Figure 3.4: LTSpice As A Curve Tracer: Diode I-V Characteristics
Figure 3.7: LTSpice As A Curve Tracer: Selecting Different Device Models
Figure 3.11: A Three Diode String Voltage Regulator Circuit
Figure 3.15: Zener Diode Voltage Regulator Circuit (No Load)
Figure 3.17: Zener Diode Voltage Regulator Circuit (With Load)
Figure 3.22: Half-Wave Rectifier Circuit
Figure 3.27: Full-Wave Peak Rectifier Circuit
Figure 3.32: A Regulated Power Supply
Figure 3.36: A Diode Limiter Circuit
Figure 3.39: A DC Restorer Circuit
Figure 3.42: A Voltage Doubler Circuit
Random number generators are used to model a component whose value is treated as a random variable. There are three types of random number generator available in LTSpice: zero-mean value Gaussian distribution, zero-mean value uniform distribution, and a non-zero mean-value uniform distribution.
+ A zero-mean value Gaussian distributed random variable with standard deviation σ is called using the function gauss(σ).
+ A zero-mean value uniform distributed random variable from -ζ to ζ is called using the function flat(ζ).
+ A component with value μ that is uniformly distributed from μ *(1 - δ ) to μ *(1 + δ ) is called using the function mc(μ , δ ).
+ All random variable calls must be placed inside brackets, { }.
To invoke the selection of a new random component for a Spice analysis involving N trials, the following .STEP directive is used:
.STEP PARAM run 1 N 1
where run is just a dummy variable representing the sample iteration.
Figure 4.3: Verifying Transistor Circuit Design
Figure 4.5: Spice As A Curve Tracer: BJT I-V Characteristics
Figure 4.9: NPN Transistor Operated In Active Mode
Figure 4.11: PNP Transistor DC Operating Point Calculation
Figure 4.13: Multiple Transistor Circuit Bias Point Calculation
Figure 4.16: Calculating Voltage Gain Of A CE Amplifier
Figure 4.18: Time-Domain Waveforms Of An NPN Transistor Amplifier Using a .STEP Directive
Figure 4.21: Time-Domain Waveforms For A PNP Transistor Amplifier Using a .STEP Directive
Figure 4.25: Circuit setup used to determine the CE amplifier's small-signal parameters: Av, Ai and Ri.
Figure 4.26: Circuit setup used to determine the CE amplifier's output resistance Ro.
Figure 4.29: Sinusoidal Response of a Common-Emitter Amplifier Stage
Figure 4.31: Circuit setup used to determine the CB amplifier's small-signal parameters: Av, Ai and Ri.
Figure 4.33: Circuit setup used to determine the CB amplifier's output resistance Ro.
Figure 4.34: Using The 2N696 As A BJT Switch
Figure 4.38: Investigating Circuit Sensitivities of Two Biasing Arrangements for CE Amplifier
Figure 4.41: Investigating Temperature Dependencies of Two Biasing Arrangements for CE Amplifier
To investigate the i-v characteristic of a MOSFET subject to different λ factors, the lambda parameter in a model statement is assigned a variable using the bracket { } notation and a .STEP directive is used to repeat the number of times the DC sweep analysis is performed according to the following:
.model nmos_enhancement_mosfet nmos (kp=20u Vto=+2V lambda={lambda_variable})
.STEP param lambda_variable 0 0.05 0.01; * vary lambda_variable from 0 to 0.05 in increments of 0.01
Random number generators are used to model a component whose value is treated as a random variable. There are three types of random number generator available in LTSpice: zero-mean value Gaussian distribution, zero-mean value uniform distribution, and a non-zero mean-value uniform distribution.
+ A zero-mean value Gaussian distributed random variable with standard deviation σ is called using the function gauss(σ).
+ A zero-mean value uniform distributed random variable from -ζ to ζ is called using the function flat(ζ).
+ A component with value μ that is uniformly distributed from μ *(1 - δ ) to μ *(1 + δ ) is called using the function mc(μ , δ ).
+ All random variable calls must be placed inside brackets, { }.
To invoke the selection of a new random component for a Spice analysis involving N trials, the following .STEP directive is used:
.STEP PARAM run 1 N 1
where run is just a dummy variable representing the sample iteration.
Figure 5.3: Simple Enhancement-Mode MOSFET Circuit
Figure 5.5: Enhancement-Mode N-Channel MOSFET Id - Vds Characteristics
Figure 5.8: Enhancement-Mode N-Channel MOSFET Id - Vgs Characteristics
Figure 5.9: A Simple Enhancement-Mode PMOS Circuit (Rd=6k)
Figure 5.11: A Depletion-Mode PMOS Transistor Circuit
Figure 5.13: A Depletion-Mode NMOS Transistor Circuit
Figure 5.17: A Simple N-Channel JFET Circuit
Figure 5.19: A Simple P-Channel JFET Circuit
Figure 5.21: Dynamic Behavior of an Enhancement-Type NMOS Amplifier
Figure 5.22: Transfer Characteristic of an Enhancement-Mode NMOS Amplifier
Figure 5.26: Frequency Response Behavior of a CS Amplifier with Gate-Drain Feedback
Figure 5.29: A Monte Carlo Analysis of a CS Amplifier - resistor Variations
Figure 5.31: A Monte Carlo Analysis of a CS Amplifier - VDD Variations
Figure 5.32: A Monte Carlo Analysis of a CS Amplifier - Transistor Model Parameter Variations
Figure 5.34: An Enhancement-Load Amplifier Including Body Effect
Figure 5.37: A CMOS Amplifier with Current Source Biasing
Figure 5.43: Computing Switch On-Resistance Of A NMOS, PMOS and CMOS Switch
Figure 5.46: Step Response of an NMOS Switch
Figure 5.50: i-v Characteristics of an N-Channel MESFET
Figure 5.51: A MESFET Amplifier
Random number generators are used to model a component whose value is treated as a random variable. There are three types of random number generator available in LTSpice: zero-mean value Gaussian distribution, zero-mean value uniform distribution, and a non-zero mean-value uniform distribution.
+ A zero-mean value Gaussian distributed random variable with standard deviation σ is called using the function gauss(σ).
+ A zero-mean value uniform distributed random variable from -ζ to ζ is called using the function flat(ζ).
+ A component with value μ that is uniformly distributed from μ *(1 - δ ) to μ *(1 + δ ) is called using the function mc(μ , δ ).
+ All random variable calls must be placed inside brackets, { }.
To invoke the selection of a new random component for a Spice analysis involving N trials, the following .STEP directive is used:
.STEP PARAM run 1 N 1
where run is just a dummy variable representing the sample iteration.
Figure 6.2: A BJT Differential Pair Incorrectly Driven
Figure 6.4: A BJT Differential Pair with DM & CM Sources
Figure 6.8: A 2-Port Equivalent Circuit Representation of a BJT Differential Pair
Figure 6.9: Differential Amplifier with Tail Current Effects
Figure 6.10: Monte Carlo Analysis of Differential Amplifier Subject To Random Collector Resistance Variations
Figure 6.12: Monte Carlo Analysis of Differential Amplifier Subject To Random Transistor Saturation Current Variation
Figure 6.14: Monte Carlo Analysis of Differential Amplifier Subject To Random Transistor Beta Variation
Figure 6.17: A Current Mirror Comparison: Simple, Base Compensation and The Wilson Current Mirror
Figure 6.22: The High-Swing vs. Wilson Current Mirrors
Figure 6.25: A Simple Bipolar Current Source Arrangement
Figure 6.29: A CMOS Differential Amplifier With Current Source Biasing
Figure 6.34: A MESFET Differential Amplifier
Figure 6.40: A Simple Operational Amplifier
The average and RMS value of any of transient waveform can be obtained using the waveform viewer by moving the mouse over the waveform label at the top of each graph, hold down the control key, and left click the mouse button.
A voltage-controlled switch can be defined in LTSpice using the following element and model statement:
Sname n+ n- nc+ nc- switch_model_name
.model switch_model_name SW (Ron=value Roff=value Vt=value Vh=value)
A current-controlled switch can be defined in LTSpice using the following element and model statement:
Wname n+ n- Vsense switch_model_name
Vsense nc+ nc- 0
.model switch_model_name CSW (Ron=value Roff=value It=value Ih=value)
A Fourier analysis of a transient waveform can be performed using the following Spice directive:
.FOUR fundamental_frequency output_variable_list
Here the field denoted by fundamental_frequency represents the fundamental frequency of the Fourier series decomposition and the field output_variable_list is a list of the circuit variables that will be analyzed.
The Fourier Analysis command of Spice decomposes a time-domain waveform into its Fourier series components. This includes the fundamental, a DC component and the next eight harmonics. In addition, a total harmonic distortion measure (THD) is also provided.
Fourier analysis is performed on the last cycle of a time-varying waveform computed by LTSpice. It is therefore important that by the final cycle the waveform has reached steady state if the Fourier analysis results are to be interpreted correctly.
The results of the Fourier analysis command appear in table format in the SPICE Error Log file. One must open this file using a text editor and observe the results.
The post-processing capabilities of the LTSpice waveform viewer are helpful in generating graphical displays of the various power waveforms by multiplying different voltage and current signals together and by computing a running average.
Figure 7.1: A Class A Output Stage
Figure 7.7: A Class B Output Stage
Figure 7.15: A Class AB Output Stage
Figure 7.19: A Class AB Output Stage with Short Circuit Protection
Specifying the gain of a dependent source as a Laplace transform function is restricted in LTSpice to only the VCVS and VCCS (designated with the letters E and G, respectively). The general form of the element statement used to specify the gain of either one of these controlled sources in terms of the Laplace variable s is as follows:
Ename n+ n- nc+ nc- Laplace = T(s)
Gname n+ n- nc+ nc- Laplace = T(s)
The first part of this statement, before the keyword Laplace, is identical to that given previously for either the VCVS or VCCS (i.e., element type with a unique name and the nodes the dependent source is connected to). After the keyword Laplace, the variable that the controlled source depends on is specified between braces (e.g., { V(1) } ). An equal sign (=) is necessary to connect the word Laplace and an expression written in terms of the Laplace variable.
Figure 8.2: A Simple Circuit Arrangement for Investigating Transfer Function Behavior
Figure 8.6: Small Signal Parameters of 2N2222 NPN Transistor
Figure 8.7: Frequency Response Of A CS JFET Amplifier
Figure 8.10: Investigating the Miller Effect
Figure 8.13: A Common-Emitter vs. Cascode Amplifiers
Figure 8.16: A Common-Emitter Common-Collector Cascade Stage
Figure 8.19: Various Differential Amplifier Configurations
Figure 8.25: The Effect of Emitter Degeneration on a Differential Amplifier
A step command will enable one to sweep an AC or DC or any other analysis over multiple parameter values. For instance, by identifying a component to swept by surrounding the variable to be swept with { } and including a Spice .STEP directive that specifies the swept values in the general manner as
.STEP param swept_variable LIST list_of_values
A Nyquist plot can be generated with LTSpice - run an AC analysis, select the signals that make up the complex function T(s) and right click on the magnitude of the vertical axis of the plot that appears, then select the Nyquist plot option under the Bode plot button that appears in the resulting pull-down menu.
To complete the Nyquist plot, include the complex conjugate of the loop transmission function using the LTSpice operation
conj{T(s)}
Figure 9.9: An example of a voltage-mixing, voltage-sensing feedback amplifier.
Figure 9.11:A noninverting Amplifier.
Figure 9.13: A broadband amplifier composed of a feedback triple.
Figure 9.17: A current-mixing, voltage-sensing amplifier.
Figure 9.20: A current-mixing, current-sensing amplifier.
Figure 9.22a: Computing the input resistance of a noninverting amplifier.
Figure 9.24a: Computing the output resistance of a noninverting amplifier.
Figure 9.31b: Open-loop voltage-In voltage-out amplifier.
Figure 9.31c: Closed-loop amplifier configuration for frequency response test.
Figure 9.32: Analyze-as-one AC response of noninverting amplifier.
Figure 9.33: Analyze-as-one transient response of noninverting amplifier.
Figure 9.36: Break-the-loop AC response of noninverting amplifier.
Figure 9.40:AC Response of a Second-order Active Filter Circuit in Closed-Loop
A Nyquist plot can be generated with LTSpice - run an AC analysis, select the signals that make up the complex function T(s) and right click on the magnitude of the vertical axis of the plot that appears, then select the Nyquist plot option under the Bode plot button that appears in the resulting pull-down menu.
To complete the Nyquist plot, include the complex conjugate of the loop transmission function using the LTSpice operation
conj{T(s)}
Figure 10.6: Analyzing a Wein-Bridge amplifier as a current-mixing topology.
Figure 10.10: Analyzing a Wein-Bridge amplifier as a voltage-mixing topology.
Figure 10.16: Analyzing a Colpitts amplifier as a current-mixing topology.
Figure 10.24: Analyzing a Pierce amplifier as a current-mixing topology.