SPICE
SPICE
SPICE
Laboratory Manual
July 2008
1
Tutorial # 1
OBJECTIVES
1.
2.
3.
4.
INTRODUCTION
Currently, one of the more widely used general purpose circuit simulation program for
industrial and academic computer systems is SPICE. As you know SPICE can be used to
simulate circuits containing resistors, capacitors, inductors, mutual inductors,
independent and dependent voltage and current sources, and basic semiconductor
devices. In EE 203 students were using Schematic Editor of SPICE to draw circuits and
then run simulation analysis. In fact, drawing circuits and ensuring correct
interconnections may be time consuming. Alternatively, circuits can be described in
SPICE by specifying their various components and their terminal connections (net
listing). A typical SPICE input file format is as follows:
TITLE STATEMENT
CIRCUIT ELEMENTS:
Power Supplies / Signal Sources
Circuit description/Element Descriptions
Model Statement
* Comments
CONTROL COMMANDS:
Analysis Requests
Output Requests
* Comments
.END
Notes:
1. The first line must be a title line which is usually reflects the file contents. It
cannot be omitted.
2. The last line must be the .END statement.
3. You can insert comment lines starting with "*".
2
CIRCUITS ELEMENTS
1. The general format for describing independent voltage source is
Vname N+ N- [DC value] [AC Magn phase] or [SIN V0 Va freq td df
phase]
Where
The voltage source must start with letter V.
N+ and N- are the positive and negative nodes of the source, respectively.
Sources can be assigned values for dc analysis [DC value], ac analysis [AC
magnitude phase], or transient analysis [SIN].
The ac phase angle is in degrees.
The parameters of the sin are given in this order: dc offset, amplitude, frequency,
delay, damping factor, phase, respectively. In most cases there is no need to
specify td, df, and phase but rather leave SPICE use their default values of
zeroes.
Other the transient signal generators such as PULSE and PWL are introduced in
Experiment 3.
2. An independent current source can be described similarly but using Iname to replace
Vname. But note that current flows from a positive node to the negative node.
3. Various dependent sources are defined when needed in Experiments 3 and 4.
4. Passive elements are described by element statements that specify the type-name and
terminal connections as follows:
Rname
N1
N2
value
Cname
N1
N2
value
Lname
N1
N2
value
5. Semiconductor devices such as diodes, MOSFETs and BJTs are described by two
statements. In addition to an element statement, a model statement is required. SPICE
allows varying degrees of circuit element model complexity. In this tutorial we intend to
provide basic default model descriptions and more complex model descriptions.
Examples will be used to illustrate the differences between the results obtained using
hand calculations, default device models and complex device models. By the end of this
tutorial we expect that the student will get an appreciation of the advantages of using
SPICE complex models. The following subsections briefly described element and model
statements for basic semiconductor devices.
Diode Models
The diode element model is given in Figure 1. The element statement format is given by
Dname
NA
NC
MNAME [AREA]
MNAME
NA
NC
ID
.MODEL
MNAME
D [PNAME1=PVAL1 PNAME2=PVAL2]
The anode of the diode is connected to NA; the cathode to NC. MNAME is an
alphanumeric model designation for the device. Detailed model parameters are provided
in Table 1.
Bipolar Junction Transistor
The npn and pnp transistor element models are shown in Figure 2. The element statement
format is
Qname NC NB NE MNAME [AREA]
NC
NB
NC
NB
NE
NE
NPN
PNP
.MODEL
MNAME
or
.MODEL
4
MNAME
pnp[PNAME1=PVAL1 PNAME2=PVAL2]
ND
NG
NB
NG
NB
NS
NS
NMOS
PMOS
.MODEL
and for P-channel
.MODEL
MNAME
MNAME
Detailed model parameters are provided in Table 3. Note that the default values for the
gate length, VALL, and the gate width, VALW, are 1cm. Obviously, these are not
realistic values; however, the model uses the ratio of VALL and VALW rather than the
individual values in its calculations.
CONTROL COMMANDS
.OP
The inclusion of the statement .OP makes SPICE perform DC analysis to find the
operating point of the circuit.
.AC Sweep-mode NP START STOP
The .AC control statement is used to perform ac analysis on a circuit and provide
data for frequency response plotting.
Where Sweep-mode is one of the keywords thats indicates the frequency
variation by decade (DEC), by octave (OCT), or linearly (LIN).
NP is the number of points per sweep-mode;
FSTART is the starting frequency. FSTART cannot be zero.
5
GENERAL EXAMPLES
At this stage you are requested to write and run the following three programs, obtain the
results from SPICE simulation. Before start writing the program label all nodes with the
common node (ground) always has number "0".
1. The input file of the circuit of
Figure 4 can be as follows:
PWRSUP.CIR
* Sin input with 100V amplitude
*and 50Hz frequency
VAC
10 0 SIN(0 100 50)
D
10 11 MODR
* default model
.MODEL MODR D
RS
11 12 2
CF
12 0 40U
RL
12 0 1K
.TRAN
1M 40M
*Who many cycle will be
plotted?
.PLOT TRAN V(12)
.PROBE V(12)
.END
10
VAC
11
12
RS
CF
RL
|Av(j)|
[dB]
FH(j)
FL(j)
Am
Midband
region
wP1
wZ2
wP2
wL
wP3
wH
wP4
[log scale]
+VDD=5V
RD
100k
Rsig
R2
4.3k
C2
vo
C1
0.15
1k
vsig
RL
0.15
300k
100k
R1
RS
1.3k
CS
10
3.
+
5V
RC
Vcc
RB1
C2
Q1
C1
RS
4.3k
30k
1k 1
RL
RB2
Vs
100k
10k
RE 1.3k
CE
47
ASSIGNMENT
Consider the BJT amplifier circuit shown in Figure 8 and perform the following:
1. Using the default parameters of the BJT, write a SPICE program to plot the gainfrequency characteristic. From the SPICE output file, calculate the medium frequency
gain and the upper and lower 3dB points.
2. Repeat step 2 using the practical model given below.
3. Comment on your results.
10
Vout
+
5V
RC1
Vcc
RB1
4.3k
RB3
C2
30k
30k
4.3k
2N3904
Q1
C1
Vout
2N3904
RSig
1k
RB4
10k
RE2
RB2
Vsig
10k
RE1
1.3k
CE
47
11
1.3k
C3
100k
RL
12
Parameters
saturation current
emission coefficient
parasitic resistance
zero-bias pn capacitance
pn potential
pn grading coefficient
forward-bias depletion capacitance coefficient
transit time
reverse breakdown voltage
reverse breakdown current
bandgap voltage (barrier height)
IS temperature exponent
flicker noise coefficient
flicker noise exponent
Default
Units
1E-14
1
0
0
1
0.5
0.5
0
infinite
1E-10
1.11
3
0
1
A
ohm
farad
volt
S
volts
A
eV
13
Parameters
pn saturation current
ideal maximum forward beta
forward current emission coefficient
forward Early voltage
corner for fwd beta high-cur roll off
base-emitter leakage saturation current
base-emitter leakage emission coefficient
ideal maximum reverse beta
reverse current emission coefficient
reverse Early voltage
corner for rev beta hi-cur roll off
base-collector leakage saturation current
base-collector leakage emission coefficient
zero-bias (maximum) base resistance
minimum base resistance
emitter ohmic resistance
collector ohmic resistance
base-emitter zero-bias pn capacitance
base-emitter built-in potential
base-emitter pn grading factor
base-collector zero-bias pn capacitance
base-collector built-in potential
base-collector pn grading factor
fraction of Cbc connected into Rb
collector-substrate zero-bias pn capacitance
collector-substrate built-in potential
collector-substrate pn grading factor
forward-bias depletion capacitor coefficient
ideal forward transit time
transit time bias dependence coefficient
transit time dependency on Vbc
transit time dependency on Ic
excess phase @ 1/ (2TF) Hz
ideal reverse transit time
bandgap voltage (barrier height)
forward and reverse beta temp coefficient
IS temperature effect exponent
flicker noise coefficient
flicker noise exponent
Default
Units
lE-16
100
1
infinite
infinite
0
1.5
1
1
infinite
infinite
0
2.0
0
RB
0
0
0
0.75
0.33
0
0.75
0.33
1
0
0.75
0
0.5
0
0
infinite
0
0
0
1.11
0
3
0
1
V
A
A
V
A
A
ohm
ohm
ohm
ohm
F
V
F
V
s
V
A
C
s
eV
Description
Default
LEVEL
L
W
LD
WD
VTO
KP
GAMMA
PHI
LAMBDA
RD
RS
RG
RB
RDS
RSH
IS
JS
PB
CBD
CBS
CJ
CJSW
MJ
MJSW
FC
CGSO
CGDO
CGBO
NSUB
NSS
NFS
TOX
TPG
model type(l, 2, or 3)
channel length
channel width
lateral diffusion (length)
lateral diffusion (width)
zero-bias threshold voltage
transconductance
bulk threshold parameter
surface potential
channel-length. modulation (LEVEL 1 or 2)
drain ohmic resistance
source ohmic resistance
gate ohmic resistance
bulk ohmic resistance
drain-source shunt resistance
drain-source diff. sheet res.
bulk pn saturation current
bulk pn sat. current/area
bulk pn potential
bulk-drain zero-bias pn cap.
bulk-source zero-bias pn cap.
bulk pn zero-bias bot. cap./area
bulk pn zero-bias perimeter cap./length
bulk pn bottom grading coefficient
bulk pn sidewall grading coefficient
bulk pn forward bias capacitance coefficient
gate-source overlap capacitance/channel width
gate-drain overlap capacitance/channel width
gate-bulk overlap capacitance/channel length
substrate doping density
surface state density
fast surface state density
oxide thickness
gate material type; +1 = opposite of substrate;
-1 = same as substrate; 0 = aluminum
metallurgical junction depth
surface mobility
mobility degradation critical field (LEYEL=2)
mobility degradation exponent (LEVEL=2)
(not used) mobility degradation transverse field coefficient
maximum drift velocity
channel charge coefficient (LEVEL=2)
fraction of channel charge attributed to drain
width effect on threshold
mobility modulation (LEVEL=3)
static feedback (LEVEL=3)
saturation field factor (LEVEL=3)
flicker noise coefficient
flicker noise exponent
1
DEFL
DEFW
0
0
0
2E-5
0
0.6
0
0
0
0
0
infinite
0
1E-14
0
0.8
0
0
0
0
0.5
0.33
0.5
0
0
0
0
0
0
infinite
+1
XJ
UO
UCRIT
UEXP
UTRA
VMAX
NEFF
XQC
DELTA
THETA
ETA
KAPPA
KF
AF
14
Units
meter
meter
meter
meter
volt
A/V2
voltl/2
volt
volt-1
ohm
ohm
ohm
ohm
ohms
ohm/sq.
A
A/m2
volt
farad
farad
F/m2
F/m
F/m
F/m
F/m
cm-3
cm-2
cm-2
meter
0
600
IE4
0
meter
cm2/Vs
V/cm
0
1
1
0
0
0
0.2
0
1
m/s
volt-1
Experiment # 1
BACKGROUND
A typical CS amplifier is shown in Figure 1.
+VDD=5V
RD
100k
Rsig
R2
4.3k
C2
vo
C1
0.15
2N4351
1k
vsig
RL
0.15
300k
100k
R1
RS
1.3k
CS
10
As you have studied in your lectures small signal ac analysis can be used to shown that:
1. The midband frequency gain (AM) is given by:
v
RG
AM o
g m RL'
(1)
vsig
Rsig RG
RG R1 || R2 and RL RL || RD
Where
2. The low and high -3dB pole frequencies can be estimated as:
3
1
1
1
1
wL
(2)
i 1 R C
C1 ( RSig RG ) C2 ( RL RD ) C ( R || 1 )
iS i
S
S
gm
15
1
1
(3)
'
RiS Ci [CGS CGD (1 gmRL )]Rsig // RG (CGD CDB ) RD // RL
3. Also, it can be shown that when Cs is removed the gain will decrease to:
Rg
g m RL'
(4)
AM
Rsig Rg 1 g m Rs
4. The value of L will decrease whereas that of H will increase.
1
1
(5)
wL
C1 ( RS RG ) C2 ( RL RD )
1
(6)
wH
g m RL' Rth
RL' Rs
Rth Rs
'
CGS (
) CGD ( Rth RL
) CDB (
)
1 g m Rs
1 g m Rs
1 g m Rs
In fact, the amplifier bandwidth (BW) is defined as the difference between
f H wH /( 2 ) and f L wL /( 2 ) and since, usually f L f H , BW f H . Normally, the
amplifier is designed so that its bandwidth coincides with the spectrum of the signals that
it is required to amplify. Otherwise, signal distortion will occur.
Finally, a figure-of-merit for the amplifier is its gain-bandwidth product, which is defined
as GB= AM BW. It will be seen that in amplifier design there is usually trade-off between
gain and bandwidth.
wH
PRELAB WORK
Students must perform the hand calculations and SPICE before the lab.
Hand Calculation:
1. With CS, calculate AM, f L , f H , BW, and GB for RL=100k and RL=10k assuming
gm=1.04mA/V. Try to deduce the trade-of between gain and bandwidth from these
results.
2. From the results obtained in step 1, try to deduce the effect of RL on the AM and the
bandwidth?
3. Without Cs, calculate AM, f L , f H , and BW when RL=100k.
4. From the results obtained in step 1 and 3, try to deduce the effect of Cs on the AM and
the BW?
5. Record your results in Table II.
16
SPICE Simulation:
SPICE simulations can be used to verify the hand calculations. In practice, howevere,
stray and bread board capacitances will affect high frequency pole significantly. So, to
compare your experimental results for f H with SPICE you need to add parasitic
capacitances in your SPICE file. For example, use three parastic capacitances between
each two terminals of the transistors.
6. Use PISCE program developed in the pervious SPICE tutorial to generate three
output files for the cases: (a) With Cs and RL=100k (b) With Cs and RL=10k (c)
Without Cs and RL=100k. Use no parastic capacitances.
7. Determine AM, f L , f H , BW, and GB for each case.
8. Record your results in Table II.
9. Repeat steps 6 and 7 but using parastic capacitances of about 20pF.
10. Record your results in Table III.
EXPERIMENTAL WORK
See pin configurations of MOSFET 2N4351 in the data sheet given in the Appendix at the
end of the manual.
1. Construct the circuit shown in Figure 1 with the capacitor CS and RL=100k. Apply a
small ac signal vsig with a frequency in the midband (about 10kHz). Keep increasing
the amplitude and make sure by monitoring the oscilloscope that the output voltage is
not distorted. Using vsig that results in maximum undistorted output (approximately
20mVp-p), in the remaining steps.
(a) Measure the output amplitude in midband (the output should be constant over
wide range of frequencies). Calculate AM by dividing the amplitude of the output
signal by that of the input signal.
Notes:
i.
You may use Table I to record your readings.
ii.
Keep monitoring the input value during measurement since it may
vary. Always adjust it to 20mVp-p in order to get correct data.
iii.
Note that at low-frequency the output signal will be noisy, to reduce
this effect use the average function on the oscilloscope by pressing the
acquire knob, do this for frequencies above 1MHz also.
(b) Change the input frequency gradually from 10kHz to about 20Hz. At each
frequency measure the small signal voltage gain. Give a special attention to the
frequency where gain reduces to AM / 2 .
(c) Now set the frequency back to 10kHz and gradually increase the frequency up to
2MHz and measure the small signal voltage gain at each step. Again give a
special attention to the frequency where AM reduces to AM / 2
2. Plot this set of data on the provided graph sheet (Figure 2).
17
18
19
Parameter
SPICE Simulation
Without CS
With CS
With CS
Without CS
With CS
With CS
RL=100k
RL=100K
RL=1K
RL=100k
RL=100K
RL=1K
AM
fL
fH
BW
GB=
AM BW
Table III: Summary of SPICE simulation including parasitic capacitances and experimental results.
SPICE Simulation
Experimental Result
With parasitic capacitances
Parameter
AM
fL
fH
BW
GB=
20
AM BW
Without CS
With CS
With CS
Without CS
With CS
With CS
RL=100k
RL=100K
RL=1K
RL=100k
RL=100K
RL=1K
21
Experiment # 2
OBJECTIVE
1. To measure the frequency response of common emitter (CE) amplifier.
2. To study the effect of the load resistance RL on the frequency response of the
CE amplifier.
3. To explore some advantages of using multistage amplifier Common EmitterCommon-Collector amplifier.
BACKGROUND
A typical common emitter (CE) amplifier is shown in Figure 1.
+
5V
RC1
Vcc
RB1
1k
C2
30k
Q1
C1
RSig
4.3k
Vout
1
RL
RB2
Vsig
100k
10k
RE1
1.3k
CE
47
As you have studied in your lectures, it can be shown using small signal ac analysis that:
1. The midband frequency AM gain is given by:
v
v v
Rin
A M o be o
g m RL'
(1)
v sig v sig vbe
Rsig Rin
22
wH
1
[C 1 Ceq ]Rin // Rs
1
C 1 g m R ( Rin // Rs )
(3)
'
L
Where gm R L' represents the voltage gain between the two terminals of C1 (i.e. the gain
between the collector and base of Q1). Since RL is connected at the collector of Q1,
changing its value will directly alter both AM and H. In order to maintain almost constant
gain and hence constant bandwidth a buffer stage or common-collector (CC) amplifier
can be used to isolate the load from the basic CE amplifier or C1 as shown in Figure 2.
Now the input resistance of the CC amplifier (Rin2) will act as the new load derived by
the collector of Q1. The input resistance of Q2 is slightly dependent on RL and hence
changing RL will lead to small variation in the gain and H. In other words, since the CC
amplifier has a relatively small output resistance which can derive various loads while
maintaining almost constant gain. Keeping the gain almost constant will also results in
constant bandwidth. Also, note that since CC amplifier has usually much larger
bandwidth than that of the CE amplifier, the overall bandwidth of the multistage
amplifier will mainly be decided by the poles of CE amplifier.
+
5V
RC1
Vcc
RB1
4.3k
RB3
C2
30k
30k
4.3k
2N3904
Q1
C1
Vout
2N3904
RSig
1k
RB4
10k
RE2
RB2
Vsig
1.3k
C3
100k
10k
RE1
1.3k
CE
47
With the buffer connected the midband the various parameters become:
v
Rin
g m RL'' ABuffer
1. A M o
v sig
Rsig Rin
23
(4)
RL
RL // RE 2 (1 )
(5)
r 2 RL // RE 2 (1 )
2. Note that C3 is associated with relatively small resistance and hence may significantly
contribute to value of the low frequency pole particularly when RL is small:
1
1
(6)
wL
r RS // RB1 // RB 2
r 2 RC1 // RB1 // RB 2
C E ( RE1 //
) C3 [( RE 2 //
) RL ]
1
1
3. The high frequency pole can be expressed as:
1
1
wH
(7)
''
''
[C 1 C 1 (1 g m RL )]Rin // Rs
C 1 g m RL ( Rin // Rs )
ABuffer
It can be seen that unlike R L' , the value of R L'' will be almost constant for different load
values.
PRELAB WORK
Students must perform the following calculations and SPICE before the lab.
Hand Calculation:
1. Given that gm1=gm2=16.9mA/V and r1= r2=7.2k, complete the Table I.
RL
ABuffer
R L'
R L''
1 k
100 k
% Change
2. For the two amplifier circuits shown in Figure 1 and Figure 2 calculate AM, f L , f H ,
BW and GB required to complete Table II.
SPICE Simulation:
3. Use the programs developed in the pervious SPICE tutorial to generate the required
outputs for Figure 1 and Figure 2 to determine AM, f L , f H , BW and GB to complete
Table II. For the SPICE analysis use the frequency range 10Hz to 8MHz. Use the BJT
model given in the tutorial.
24
4. Use three parastic capacitances of about 10pF between each two terminals of the
transistors. Repeat step 3 and determine f H , BW and GB and record your results in
Table II.
EXPERIMENTAL WORK
See pin configurations of BJT 2N3904 in the data sheet given in the Appendix at the end
of the manual.
1. Construct the circuit shown in Figure 1. Apply a small ac signal vsig and frequency in
the midband about 10kHz. Keep increasing the amplitude and make sure by
monitoring the output on oscilloscope that the output voltage is not distorted.
Calculate AM. Use the corresponding value of vsig in the remaining steps.
2. Reduce the input frequency from 10kHz gradually to find f L .
3. Go back with frequency to 10kHz and increase it gradually to find f H .
4. Calculate BW and GB from your measured gain-frequency characteristic.
5. Repeat steps 1 through 4 when RL is changed to 1k.
6. Construct the circuit shown in Figure 2 with RL=100k.
7. Repeat steps 1 through 4 for Figure 2.
8. Repeat steps 1 through 4 for Figure 2 when RL is changed to 1k.
9. Insert your experimental results into Table IV.
10. Compare your hand calculations, SPICE simulations and experimental measurements.
11. Comment on your results.
25
Figure 1
Parameter
RL=1 k
RL=100 k
Figure 2
%
Change
RL=1 k
RL=100 k
%
Change
AM
fL
fH
BW
GB=
AM BW
Table III: Summary of SPICE simulations
Figure 1
Parameter
RL=1 k
AM
fL
fH
f H (with parasitic
capacitances)
BW
BW (with parasitic
capacitances)
GB=
AM BW
GB (with parasitic
capacitances)
26
RL=100 k
Figure 2
%
Change
RL=1 k
RL=100 k
%
Change
Figure 1
Parameter
RL=1 k
AM
fL
fH
BW
GB=
27
AM BW
RL=100 k
Figure 2
%
Change
RL=1 k
RL=100 k
%
Change
Experiment # 3
OBJECTIVE
1. To measure the characteristics of several linear circuits based on the operational
amplifier namely inverting amplifier, inverting summer, inverting integrator,
inverting differentiator and differential amplifier.
2. Learn factors involved in circuit design using op amps.
3. To design circuits to implement simple linear functions.
BACKGROUND
This section provides brief discussion of the main characteristics of the op amp based
circuits shown in Figure 1:
Unity-gain Buffer:
It has a voltage gain, input resistance and output resistance of Av vo / vi 1 , Ri and
Ro 0 , respectively. It does not take any input current and can drive any desired load
resistance without loss of signal voltage. Thus, it used to provide excellent impedancelevel transformation while maintaining signal voltage level.
Inverting Amplifier:
It has a voltage gain, input resistance and output resistance of Av vo / vi R2 / R1 ,
Ri R1 and Ro 0 , respectively. The minus sign means a 180o phase shift between the
output and input signals
Summing Amplifier:
The output voltage can be expresses as vo [( R3 / R1 )v1 ( R3 / R2 )v2 ] .
It can be seen that the scale factors for the two inputs can be independently adjusted by
proper choice of R2 and R1. Also, more inputs can be added simply by connecting them
same way as v1 and v2. Hence, it can be used as a simple digital-to-analog converter.
Inverting Integrator:
28
1
vi ( )d vi (to )
RC to
This means that the output voltage at time t is given by the initial capacitor voltage plus
the integral of the input signal from start of integration interval, here, t=0. Note that dc
gain is infinity which means any small dc component of vi(t) results in output. In
practice, the op amp will saturates at a voltage close to positive or negative supply
depending on input voltage polarity.
Differentiator:
dvi (t )
dt
This means that the output is scaled version of derivative of input voltage. The
differentiator is noise magnifier (i.e. spikes may be produced at output due to sharp
changing in vi(t)).
Difference Amplifier:
This circuit amplifies difference between two input signals. The output voltage can be
expresses as vo ( R2 / R1 )(v1 v2 ) ( R2 / R1 )(v2 v1 ) .
Voltage to Current Converter:
Such a converter is capable of producing a current into a load that is independent of the
load value and also proportional to the input voltage. It can be shown for the simple
voltage to current converter given in Figure 1 that Iout=Vi/R regardless of the value of ZL.
Can you prove that?
29
Function
CIRCUIT
+15V
2
741
Unity-gain Buffer
3
Vout
7
-15V
R2=5k
+15V
R1=1k
Inverting Amplifier
741
Vout
-15V
R1=1k
R3=2k
+15V
R2=1k
Summing Amplifier
(Adder)
741
Vout
-15V
1500pF
100k
+15V
2
Inverting Integrator
741
+
4
-15V
30
Vout
10k
+15V
1500pF
Differentiator
741
Vout
-15V
R2=2k
+15V
R1=1k
741
Difference Amplifier
3
R1=1k
Vout
R2=2k -15V
RX=5k
RX=5k
+15V
2
7
741
R=10k
+
4
-15V
Vout
1k or 2k
ZL
R=10k
Iout
PRELAB WORK
Students must perform the following calculations and SPICE before coming to the
lab.
During design phase, use typical values of resistors and capacitors from the list provided
in the Appendix of this manual.
31
Hand Calculation:
1. For the different configurations shown in Figure 1, perform an approximate hand
calculation assuming that the operational amplifier is ideal. In each case sketch the
expected output waveform in Table I. Assume that the sine and triangular waves have
amplitude of 1V, the square wave varies from 0 to 5V with 50% duty cycle, and
frequency of all signals is set to 1kHz.
2. Redesign the integrator circuit so that when the input is sine wave with frequency
1kHz the output voltage will have same amplitude. Use C=0.1F.
3. Redesign the differentiator circuit so that when the input is sine wave with frequency
1kHz the output voltage will have same amplitude. Use C=0.1F.
SPICE Simulation:
4. Using SPICE simulate the different configurations and submit the output waveforms
for each case. At this stage, the op-amp can be simulated using the simplified model
of Figure 2. Usually, the op amp model is written as SUBCIRCUIT in which the
model of the op-amp is written only once and then recalled whenever needed. The
concept of SUBCIRCUIT is very useful when simulating large systems containing
several identical devices. The general format of a SUBCIRCUIT is
.SUBCKT SUBNAME N1 N2 N3 .
CIRCUIT DESCRPTION
.ENDS
The first line define the SUBNAME which is the name given to the SUBCIRCUIT
and N1, N2, N3, .... are the nodes to which the SUBCIRCUIT will be connected.
Then element statements are given. The last line must be the .ENDS control line.
10
1Meg
Vin
20
30
+
5x104Vin
(a)
V-
V+ Vo
.SUBCKT OPAMP 10
20
30
RIN 20 10 1MEG
EOUT 30 0 20 10 5E4
.ENDS
(b)
Figure 2: A simple SPICE model for the op amp: (a) Circuit (b) SPICE subcircuit
32
.
Whereas the triangular wave illustrated in Figure 4 can be simulated using piecewise
linear (PWL) function having the following general form:
V N+
NPWL(T1 V1 T2 V2 T3 V3 )
Voltage
or
Current
(T6,V6)
(T5,V5)
(T7,V7)
(T2,V2)
(T3,V3)
(T1,V1)
Time
Figure 5 shows the spice file needed to simulate the adder circuit. Familiarize your self
with it. Then use it to develop the programs for other circuits of Figure 1.
33
Notes:
1. Nodes 2, 0, and 6 in basic circuit will be assigned
to nodes 10, 20, and 30 in the subcircuit,
respectively.
2. General format for Voltage controlled voltage
source is: Ename N1 N2 NC1 NC2 Value
In the example, it is specified with positive node 30,
negative node 0 while nodes 20 and 10 being the
possitive and negative nodes of the controling
volatge. The value of the controlling constant is 5E4.
Requiremnt:
Change the input file such that the two
inputs are not synchronized. This can be
achieved by changing TD of the pulse from
0 to 0.1ms and run the program again.
You must have your SPICE output file with your hand calculations ready before
you come to the lab.
EXPERIMENTAL WORK
See pin configurations of 741 op amp in the data sheet given in the Appendix at the end
of the manual.
Also, note when testing the adder and difference circuits that the two input are not
synchronized and hence be careful when you plot the results.
1. Construct the voltage buffer circuit shown in Figure 1. Apply a sine wave of 1V and
frequency of 1kHz. Monitor the input and output wave forms and sketch the output
in Table I.
2. Repeat step 1 for the inverting amplifier.
3. Construct the adder circuit. In this case, two inputs are need. Generate the triangular
signal normally from the function generator whereas use its SYNC output to
provide the square wave input. Note that square wave varies from 0 to 5V and its
amplitude cannot be changed. Sketch the output in Table I. Be careful when you
plot the results the two inputs may not be synchronized.
4. Construct the inverting integrator. Apply a square wave normally from the signal
generator of 1V and frequency of 1kHz. Monitor the input and output wave forms
and sketch the output in Table I.
5. Test your design of the prelab and sketch the output in Table I
34
35
Circuit
Hand Calculation
Unity-gain Buffer
Inverting Amplifier
Summing Amplifier
(Adder)
Figure 1
Inverting Integrator
Your design
Figure 1
Differentiator
Your design
Difference Amplifier
Voltage to Current
Converter
36
Experimental Result
MINI-SYSTEM
Now, you should be apply to combine the basic circuit of Figure 1 to design more general
linear functions, see for example the circuit of Figure 3.
R2
V1
V2
R1
R7
R3
+
R4
c1
R5
V3
Vout
R6
Figure 3: An example of combining some circuit of Figure 1 to design a more general linear function.
Design Problem:
An individual design problem will be assigned by the lab instructor for example:
V
7V V dt
out
1
2
dV
Vout V1 5 2
dt
Vout 3
37
dV1 1
V2 dt
dt 2
Experiment # 4
OBJECTIVE
1. To study the effects of the limited op amp bandwidth in the frequency response op
amp amplifiers.
2. Investigate how to achieve wider bandwidth for a given gain using multi-stage
amplifiers.
3. Introduce the use of Network Analyzer based testing.
BACKGROUND
Just like any amplifier the op amp gain is frequency dependent. General-purpose op
amps, internally compensated for stability, can be represented by a single-pole low-pass
transfer function:
Ao
Ao
A( s)
A( jw )
(1)
1 s wb
1 jw w b
At high frequencies w w b , the gain can be approximated as:
Aw
w
(2)
A( jw ) o b T
jw
jw
Where Ao is the DC gain, w b is open loop bandwidth of op amp and w T is the unity gain
frequency of the op amp or gain bandwidth product (frequency at which magnitude of
gain becomes unity). Analyzing the inverting amplifier using the model given by (2)
yields:
38
vo ( s)
vi ( s)
1
R2 / R1
s
wT /(1 R2
)
R1
This means that the inverting amplifier has frequency response of a low pass function
with DC gain of -R2/R1 and 3dB pole at wT (1 R2 / R1 ) . Also, it can be seen that as
the gain increases the bandwidth decreases. In fact, this is considered to be the most
serous disadvantage of using op amp (i.e. the conflict between gain and bandwidth of op
amp based circuits). Also, it is worth mentioning that the unity gain inverting amplifier
has 3dB frequency of fT/2. One solution to circumvent this problem is through cascading
several (N) simple amplifiers as shown in Figure 1.
R1
R2
R3
R4
vo1
vo2
vs
...
R5
R6
+
voN
If each sub-amplifier is modeled by a single pole, it can be shown easily that the dc gain
of the amplifier is equal to the product of dc gains of individual amplifiers and the
bandwidth of the cascade amplifier is wH
H1
relation This implies that distributing the gain over several amplifiers will results in
wider bandwidth than using a single stage amplifier.
PRELAB WORK
Students must perform the following calculations and SPICE before the lab.
Hand Calculation:
1. For a single stage inverting amplifier let R1=1k and complete Table I assuming
ft=1MHz for op amp 741.
39
R2
DC gain
BW
GB
1k
10k
100k
2. Design a two stage amplifier to provide total gain of 100V/V such that
(a) Each stage provides gain of -10V/V.
(b) The first stage provides gain of -5V/V while the second stage provides gain of
-20V/V.
3. Estimate the BWs of the two amplifiers required by step 2.
SPICE Simulation:
4. Using SPICE simulate the different amplifiers of step 1 and 2 and submit the
output waveforms for each case. Use a more detailed model for simulation opamps as shown in Figure 3. This model is more sophisticated than the first model
presented in Experiment 3, as it models the finite input resistance, the finite
differential gain, the finite output resistance, the frequency dependence of the
differential gain and the limiting characteristics of the op-amp.
R1
C2
(4)
R2
gm3*v7
C1
gm2*v3
+
Rin
(7)
(3)
gm1*(v1-v2)
(1)
R0
DL1
DL2
VL1
VL2
(2)
(0)
*
.SUBCKT OPAMP
RIN 1
2
GM1 0
3
R1
3
0
C1
3
0
GM2 0
7
R2
7
0
C2
7
0
GM3 0
4
R0
4
0
40
(0)
V- V+
2
1
2MEG
1
2
1MEG
0.031uF
3
0
1K
39.8pF
7
0
1K
Vo
4
20m
10m
1m
(0)
DL1 4
DL2 6
VL1 5
VL2 0
.MODEL
.ENDS
5
DIODE
4
DIODE
0
DC
13V
6
DC
13V
DIODE
D
Figure 2: Detailed Model for the op amp
EXPERIMENTAL WORK
1. Construct an inverting amplifier and measure the gain and BW for fixed
R1=R2=1k. Use an input of 1V sine wave with 1 kHz frequency and find the gain.
Then gradually increase the frequency until you find the 3dB BW. Estimate the ft of
your op amp.
2. Change R2 to 10k and measure the gain and BW.
3. Repeat step 2 for R2=100k. But you need to use a sine wave with input of 0.1V.
Why?
4. Record your results for steps 1 through 2 in Table II.
5. Construct two stage amplifiers to test your designs of step 2 of the prelab.
6. Record your results for step 5 in Table III.
7. Compare your hand calculations, SPICE simulations and experimental results.
8. Comment on your results.
41
R2
Gain
BW
Experimental Results
GB
Gain
BW
GB
1k
10k
100k
Table III: Summary of hand calculation and experimental results for two stage amplifiers .
Hand Calculations
Amplifiers
42
Gain
BW
Experimental Results
GB
Gain
BW
GB
43
Experiment # 5
BACKGROUND
Non-ideal behavior of op amps causes various error terms in practical. In this experiment,
DC imperfections of the op amp including offset voltage, biasing and offset currents are
measured. Also, various large signal limitations are explored.
Input-Offset Voltage:
Op amps are direct-coupled devices with large DC gains. Any small DC offset voltage of
the input causes the op amp to saturate. Even with inputs being zero, the amplifier output
rests at some dc voltage offset level instead of zero. This offset voltage is usually referred
to the input port as input offset (Vos) by dividing its value by the op amp gain. Typical
values for VOS are in the range of 1 to 5mV. Actual sign of VOS is unknown as only upper
bound is given. The input offset voltage can be measured as shown in Figure 1(a). Here,
the amplifier is connected as voltage-follower to give output voltage equal to offset
voltage.
Input-Bias and Offset Currents:
The input currents in both the non-inverting terminal (IB1) and inverting terminal (IB2) are
not zeroes in practical op amps particularly those based on BJT. They are similar in value
with directions depending on internal amplifier circuit type. The difference between the
bias currents is known as input offset current I os I B1 I B 2 having unknown sign. The
circuit of Figure 2 (b) can be used to measure IB1 since Vo Vos R1I B1 whereas the circuit
of Figure 2 (c) can be used to measure IB2 since Vo Vos R2 I B 2
44
+15V
2
+15V
741
R1
2
6
741
Vout
-15V
1Meg
R1
Vout
-15V
R2
1Meg
+15V
2
741
Vout
-15V
(c) Circuit to measure bias current in inverting terminal. Do not neglect V OS.
Figure 1: Circuit to measure DC offsets.
Offset Compensation:
In general, to measure the offset voltage of a given circuit, the input signal is set to zero
as demonstrated for amplifier shown in Figure 2. In this case the circuits for the inverting
and non-inverting amplifiers become the same. Apart from the Vos, it can be shown
without R2 (short circuit) that Vo R2 I B 2 . This means that the Vo is proportional to the
magnitude of the biasing current. But when RB is used and its value is selected as
RB R1 // R2 will lead to Vo I OS R2 . Since, offset current (IOS) is typically 5-10 times
smaller than individual bias currents, dc output voltage error is reduced by this method.
R
When Vos is not neglecting Vo (1 2 )Vos I OS R2 why?
R1
45
R2
+15V
R1
741
Vout
-15V
RB
Figure 2: Equivalent circuit for measuring the output offset voltage for both the inverting and noninverting amplifiers
In addition, the output offset voltage of most IC op amps can be manually adjusted by
adding a potentiometer between pins 1 and 5 as shown in Figure 3. Here a small voltage
with opposite polarity of the offset voltage is introduced to cancel its effect.
Vcc
Potentiometer
+15V
2
741
3
Vout
-15V
Figure 3: Manual offset nulling
Output Voltage:
General purpose op amps have their output voltage limited to several volts less than
power supply span. Like other amplifiers the op amp has a linear range for the output
swing before saturation or clipping. It is known as the rated output voltage.
Slew Rate:
The second important large signal limitation of the op amp is known as the slew rate.
Slew rate (SR) is defined as the maximum rate of change of voltage at output of op amp.
Typical values are in the range from 0.1V/ms to 10V/ms. Slew rate is usually studied by
46
considering the op amp connected as a voltage buffer. For large step input the output will
be ramp. This is because the op amp output is unable to increase at required rate and the
op amp is said to be slewing. Slew rate phenomenon not only causes distortion in large
output signal but also in sinusoidal waveforms. Assume the input to the buffer is a sine
wave input with frequncy o and amplitude V, if the rate of change of this signal (oV) is
more than SR the output will be distorted as shown in Figure 3.
Full-power bandwidth:
Another important term related to slew rate is known as full-power bandwidth. It is
usually given in op amp data sheets. It is defined as the maximum frequency (fM) at
which a full-scale signal (maximum possible output Vomax) can be processed without
slewing. This means f M SR /( 2Vo max ) .
EQUIPMENTS &COMPONENTS
6.
7.
8.
9.
PRELAB WORK
Students must perform the following calculations and SPICE before the lab.
Hand Calculation:
Manufacturers usually provide users with the most important parameters of the
operational amplifiers. Table I shows the typical performance of selected operational
amplifiers. These data, however give the average performance of a selected type. The
actual performance of a particular operational amplifier may be different from its typical
characteristic. Use the data sheet of 741 op amp given in the appendix to complete Table
I.
Table I : Typical Performance of Operational Amplifiers
Parameters
Input offset voltage (mV)
Bias current (nA)
Offset current (nA)
47
741
EXPERIMENTAL WORK
Read the steps before you start you may decide to do part III inside part I and part II.
Part I: DC measurements. Use the multi-meter and record your results in Table I.
1. Construct the circuit of Figure 1(a) and measure the output voltage.
2. Construct the circuit of Figure 1(b) and measure the output voltage and deduce
the value of IB1.
3. Construct the circuit of Figure 1(c) and measure the output voltage and deduce the
value of IB2. Calculate the value of Ios using results of steps 2 and 3.
4. Construct the circuit of Figure 2, with RB short circuit measure the output. Now
use RB=50 measure the output. Do you see the reduction in the output offset?
Part II: Measurements of large signal non-idealities
5. Construct an inverting amplifier with gain -1 using two resistors of 10k. Apply a
sine wave input with amplitude of 1V and frequency 1 kHz. Keep increasing the
input amplitude until you observe clipping in the output signal. What is the
maximum output swing. Record your results in Table II.
6. Construct the circuit of Figure 4, apply a square wave of 20V p-p (here we
assume that the dc supply voltage of the op-amp is 15V i.e. the 20V p-p
represents the maximum output voltage of the op-amp) and if we keep the
48
frequency at, say 1kHz, then the output will be as shown in Figure 4. Notice the
effect of slew rate. The slew rate can be easily measured from the output Slew
Rate = Vout/TSR. Record your results in Table II.
7. Now apply a sine wave input of 20V p-p. Keep increasing the frequency of the
input sine wave while monitoring the output until it starts to show distortion as
shown in Figure 5. Determine this frequency. This is fM. Verify the relationship
between fM and the slew rate. Record your results in Table II.
Vin
+15V
2
741
Vin
3
vo
+
4
-15V
Vout
Vout
vo
TSR
Part III:
8. Repeat steps 1 to 7 using another different op amp. Record your results in Table I
and Table II.
9. Comparing the results of part I and II with their counterparts obtained from part
III comment on your results.
49
Part IV:
10. Measure the SR for another type of op amp the will be assigned by the lab
instructor.
11. Comment on your results.
50
Parameter
Vos
IB1
IB2
Ios (from IB1
Op amp 1
Op amp 2
and IB2)
Ios (from
Figure 2)
Table II: Summary of experimental results for part II
Parameter
Max.
Output
Slew Rate
Full-power
bandwidth
51
Op amp 1
Op amp 2
Experiment # 6
OBJECTIVE
1.
2.
3.
4.
BACKGROUND
High order-filters can be realized by cascading first and second order sections. These
filters can be implemented by passive RC or LC circuit. However, using active-RC filters
based on op amps provides several advantages: gain which can be set to a desired value,
independent of some of the filter parameters without affecting others and the output
impedance is very low (ideally zero) allowing cascading. Figure 1 gives summary of
various types of first order filters including the transfer functions, bode plots and op amp
based circuit realizations.
Type
T(s)
Bode plot
Circuit
R2
|T| dB
Low-pass
filter
T ( s)
ao
s wo
20 dB
a
20 log| wo |
o
decade
|T| dB
T ( s)
a1s
s wo
52
DC gain =
R1
20 log|a1|
wo
w [log]
+
Vo
1
CR2 = w
20 dB
decade
High-pass
filter
+
Vi
w [log]
wo
R1
R2
R1
R2
+
Vi
1
CR1 = w
+
Vo
High-frequency gain =
R2
R1
|T| dB
General
(bilinear)
filter
a s a0
T ( s) 1
s wo
decade
a
20 log| wo |
C2
+
Vi
20 log|a1|
R2
R1
20 dB
wo
a
| ao |
1
w [log]
C1
+
Vo
1
C2 R2 = w
a
C1 R1 = a1
o
DC gain =
R2
R1
HF gain =
|T| dB
20 log|a1|
s w0
s wo
T ( s) a1
All-pass
filter
( jw ) tan
tan
( w / w )
o
(w /wo )
2 tan
wo
(w /wo )
R1
R1
w [log]
+
Vi
+
Vo
R
C
1
CR1 = w
90o
180o
EQUIPMENTS &COMPONENTS
1.
2.
3.
4.
PRELAB WORK
Students must perform the following calculations and SPICE before the lab.
Design:
1. Design the LPF to have a 3dB frequency at 10kHz, dc gain of 10 and input
resistance of 10k.
2. Using R1=10k, design the HPF to achieve a corner frequency at 104 rad/s and
HF gain of 10.
53
C1
C2
3. Design bilinear circuit to have a zero at 830 Hz a pole frequency at 13kHz and HF
gain of 14.1. Select C1=50nF. What will be the DC gain?
4. Design the all-pass filter to realize a 120o phase shift at 60Hz. Use resistors of
R1=10k and C=1F.
SPICE:
5. Using SPICE simulates the different filters and submits their frequency responses.
Use op amp model of experiment 4.
EXPERIMENTAL WORK
1. Assemble the circuits shown in Figure 1 (Do not forget the supplies of the op amp).
Apply sinusoidal input voltage with constant amplitude of 1V, and vary the frequency
within the range decided by your hand calculations of the prelab. In each case
monitor the input and output voltages on a dual trace oscilloscope.
2. Measure the output voltage and plot your results on the provide graph sheet.
3. From your measurements determine the various parameters of each filter type.
4. For the HPF, bilinear, and allpass filters keep increasing the frequency and monitor
the output until the gain starts roll-off (decrease). What is the reason for this problem?
5. Compare your hand calculations, SPICE simulations and experimental measurements
and tabulate them in Table I.
6. Comment on your results.
54
Circuit
LPF
HPF
Bilinear
Function
All-pass
Hand
Calculation
SPICE
Simulation
Experimental
Result
DC gain
fo
Att. at
f =10fo
HF gain
fo
Att. at
f =0.1fo
DC gain
fo
fz
HF gain
Gain
Ang. at
0.1fo
Ang. at fo
Ang. at
10fo
MINI-SYSTEM
Individual design problem will be assigned by the lab instructor.
Now, you should be able to combine the filter circuit of Figure 1 to design different
frequency spectrum. Examples include:
1. By cascading a first-order LPF with a first-order HPF one can provide a wideband
band-pass filter. Provide such a design for the case in which the midband gain is 10 and
the 3 dB bandwidth extends from 100 Hz to 10 kHz. Select the input resistance to be
10k and equal value for the two capacitors.
2. Design of bandstop filter using two Bilinear filters. This response can be achieved by
implementing a transfer function such as
s 103 s 104
T ( s)
x
.
s 102 s 105
55
57
Experiment # 7
BACKGROUND
Low-Pass Filter Realization
One famous realization of LPF biquad is the Sallen-Key as shown in Figure 1.
C1
+Vcc
R1
R2
vo
vs
741
-Vcc
R3
C2
R4
Vo
K
2
vs
Vs s s(C1R1 C2 R1 C2 R2 C1R1K ) /(C1C2 R1R2 ) 1/(C1C2 R1R2 )
Where K=(1+R3/R4).
TLP ( s)
58
wo
C1 R1 C2 R1 C2 R2 C1R1K
Q
C1C2 R1R2
2 R1 R2 (1 K )
Q
d)
C1
R1R2
c)
R1C1
R2C2
C2
+Vcc
3
vs
C1
vo
741
R3
-Vcc
R2
R4
vo
s2 K
2
vs
vs s s(C1R1 C2 R1 C2 R2 C2 R2 K ) /(C1C2 R1R2 ) 1/(C1C2 R1R2 )
Thus, the filter parameters are as follows:
a) High frequency gain=K
b) wo 1/ C1C2 R1R2
THP ( s)
c)
d)
59
wo
C1 R1 C2 R1 C2 R2 C2 R2 K
Q
C1C2 R1R2
R1 C1 C2
Q
(1 K )
R
C
C
2
1 2
R2C2
R1C1
Bandpass realization
A circuit that realize biquadratic BPF based on a single op amp is shown in Figure 3
known as Delyiannis-Friend biquad
C1
R2
R1
vs
R3
+Vcc
7
741
C2
3
vo
-Vcc
vo
s / C1R1
2
vs
s s(C1 C2 ) /(C1C2 R2 ) ( R1 R3 ) / C1C2 R1R2 R3
Therefore, the filter parameters are as follows:
1/ C1R1
C2 R2
a) gain=
b) w o
R1 R3
C1C2 R1 R2 R3
c) BW
wo
wo
d) Q
BW
(C1 C2 )
C1C2 R2
R1 R3
R1 R3
C1C2 R2
C1 C2
PRELAB WORK
Students must perform the following calculations and SPICE before coming to the
lab.
Design:
1. Design the circuit of Figure 1 such that fo=12.5kHz, Q=5, the dc gain is not specified.
Use C1=C2=C and R1=R2=R.
2. Design the circuit of Figure 3 to achieve fo=10kHz, Q=3 and gain of 5. Use
C1=C2=5nF.
60
SPICE simulation:
3. Use SPICE simulations to verify your designs and submit their frequency responses.
Use op amp model of experiment 4.
You must have your SPICE output file with your hand calculations ready before
you come to the lab.
EXPERIMENTAL WORK
1. Construct the filter of Figure 1 and measure the frequency response for your design.
2. Plot your data in the provided graph sheet and determine the parameters required by
Table I.
3. Use same components of Figure 1 to assemble the filter of Figure 2.
4. Repeat step 2 for the filter of Figure 2.
5. Construct the filter of Figure 3 and measure the frequency response for your design.
6. Repeat step 2 for the filter of Figure 3.
7. Compare your hand calculations, SPICE simulations and experimental measurements.
8. Comment on your results.
61
Circuit
MF Gain
Figure 1
Corner
Frequency
Att. at
f =10fo
MF Gain
Figure 2
Corner
Frequency
Att. at
f =0.1fo
MF Gain
Center
Frequency
Figure 3
Bandwidth
Att. at
f =10fo
Att. at
f =0.1fo
62
Hand
Calculation
SPICE
Simulation
Experimental
Result
Experiment # 8
BACKGROUND
Shunt-Shunt
A typical MOSFET based shunt-shunt feedback amplifier is shown in Figure 1.
It can be shown that the open loop gain A g m ( RL // RD // RF )( R1 // R2 // RF // Rsig ) V/A
and 1 / RF A/V. The closed loop gain can be calculated
Af Vo / I s A /(1 A) leading to voltage gain of Vo / Vsig Af / Rsig .
The input resistance Rin (1 / Rif 1 / Rsig ) 1 with Rif Ria /(1 A) where
Ria R1 // R2 // RF // Rsig .
The output resistance Rout (1/ Rof 1/ RL )1 with Rof Roa /(1 A)
where Roa RL // RD // RF .
Also it is known that negative feedback cause the upper 3 dB frequency pole to increase
by the amount of feedback (i.e. wHf wH (1 AB) ).
64
+VDD=5V
100k
Rsig
RD
4.3k
C2
R2
C1
0.15
M
1k
0.15
0.15
vsig
300k
R1
RS
1.3k CS
10
10k
CF
RL
100k
RF
Precision Rectifiers
The half wave rectifier circuit studied in EE203 suffer from having one diode drop in the
signal path. Thus this circuit is suitable for power-supply design where the input signal is
much larger than the diode drop. But for applications such as in instrumentation where
the signal to be rectified is small (less than 0.5V) cannot be used. The solution is to apply
negative feedback across as shown in Figure 2 to form what is called superdiode or
precision half-wave rectifier. Similar idea can be used to remove the dead region or
crossover distortion encounter in class-AB output stages. The operation of this circuit
assuming ideal op amp can be described as follows: For vI>0, the circuit acts as a voltage
follower (i.e. vO = vI). The feedback loop is closed through the forward biased diode. The
feedback mechanism will adjust the op amp output vO1 to exactly absorb the forward
voltage drop of the diode. The positive load current will force the op amp to provide an
equal positive diode current to follow. For vI<0, the output voltage will tend to go
negative. This will tend to induce negative load and diode currents. But the diode cannot
pass current from cathode to anode. Thus the diode will be cutoff and the loop will be
broken. This force the load current to be zero and thus the output voltage will be zero.
65
+15V
7
2
741
Vi
V0
6
RL
-15V
Figure 2: Precision half-wave rectifier
COMPONENTS
1.
2.
3.
4.
5.
PRELAB WORK
Students must perform the following calculations and SPICE before the lab.
Hand calculations:
1. Recall from Experiment 1, the values of AM, f L , f H , BW and GB for the amplifier
of Figure 1 but without feedback. Also, calculate the input resistance and the output
resistance without feedback.
2. For the circuit shown in Figure 1, use the feedback techniques to calculate AM, f L ,
f H , BW and GB for this amplifier with feedback.
SPICE simulation:
3. Using SPICE simulate your circuit of Figure 1 and from SPICE output file calculate
the parameters of the amplifier obtained in step 2. Use the model of MOSFET given
in the tutorial. Run SPICE two times without and with parasitic capacitances of 20pF
as demonstrated in Experiment 1.
4. Tabulate the results obtained from your hand calculations and from SPICE simulation
in Table I.
5. Draw the voltage transfer characteristic of precision half-wave rectifier.
66
You must have your SPICE output file with your hand calculations ready before
you come to the lab.
EXPERIMENTAL WORK
Part I:
1. Construct the circuit shown in Figure 1 and apply a small ac signal vsig with a
frequency in the midband (about 10kHz) and make sure by monitoring the
oscilloscope that the output voltage is not distorted. Measure the midband gain. Use
vsig that results in maximum undistorted output in the remaining steps.
Keep monitoring the input value during measurement to keep it fixed.
2. Decrease the input frequency gradually to determine f L .
3. Go back with the frequency to 10kHz and increase it gradually to find f H .
4. Remove Rs (short circuit) and measure the midband gain for the amplifier of Figure
1. Use the result of this step and step 1 to calculate the input resistance using the
formula: Rin / (Rin+Rsig) =(Gain with Rsig)/(Gain without Rsig)
5. Reconnect Rs and remove RL (open circuit) and measure the midband gain for the
amplifier of Figure 1. Use the result of this step and step 1 to calculate the output
resistance using the formula: RL/ (RL+Rout)=(Gain with RL)/(Gain without RL)
6. Now remove the resistor RF and capacitor CF and repeat steps 1 through 5.
7. Record your results in Table I.
8. Compare your hand calculations, SPICE simulations and experimental measurements.
9. Comment on your results.
Part II:
10. Connect the circuit of Figure 2. Apply sinusoidal signal of 10V (P-P), and frequency
1 KHz and monitor both the input and output signals using the oscilloscope.
11. Use the oscilloscope to display the transfer characteristics with output Vo vertically
and input Vi horizontally. Make sure to establish convenient axes near the lower left
corner of your oscilloscope screen. Note to observe the transfers characteristics use
the X-Y format, which you can find on the display setting of the oscilloscope.
67
12. Design the precision full-wave rectifier shown in Figure 3. (Hint the circuit uses
superdiode for positive half cycle and inverting superdiode for the negative half
cycle).
+15V
7
2
D1
741
R2
Vi
+15V
R1
7
2
D2
741
-15V
Figure 3: Precision full-wave rectifier
68
V0
RL
Without Feedback
Hand
Hand
SPICE* Experiment
SPICE* Experiment
Calculation
Calculation
Gain
fL
fH
BW
GB
Rin
Rout
* For f H record the SPICE results with and without parasitic capacitances for better
comparisons.
69
Experiment # 9
2.
BACKGROUND
The Wien-Bridge Oscillator
The Wien-Bridge oscillator is shown in Figure 1. It can be shown that when Rp Rs R
1 R2
,
2
CR R1
respectively. However, one must select R2/R1 slightly greater than 2 to make sure that
oscillations will start. Thus R2 will be replaced by a variable resistor (potentiometer) that
is varied until oscillations starts. Stop at the value of R2 that results in minimum required
gain to sustain oscillations. This is because loop gain greater than unity causes distorted
oscillations.
R1
+15V
2
Vo
741
R2
3
+
4
-15V
RS
CS
RP
CP
Amplitude Controll
Althogh the frequncy of oscillation of an oscillator circuit can be therotically calculated.
The amplitude of oscillation remains unknown. A simple limiter can be used for
amplitude control as shown in Figure 2. When R6=R7 and/or R5=R8 are varied the output
swing will change.
+15V
R5
D1
R1
R6
+15V
2
Vout
741
R2
3
+
4
-15V
Rs
Cs
RP
R7
CP
D2
R8
-15V
Figure 2: The Wien-Bridge Oscillator with amplitude control
71
Rf
+15V
C
2
Vo
741
+
4
-15V
+15V
2
741
R
3
Vo
741
2R
+15V
-15V
6
2R
4
C
Vo1
Rf
(Normally
2R)
1
whereas
CR
1
R f R 0 R f 2R .
2
Finally, it is worth mentioning that these oscillators are suitable for low frequency
applications (up to few hundreds of kHz). This is mainly due the small slew rate and
limited gain-bandwidth product of the op amp.
72
COMPONENTS
1.
2.
3.
4.
5.
PRELAB WORK
Students must perform the following calculations and SPICE before coming to the
lab.
Design:
Design the oscillator of Figure 1 to provide o=104 rad/s. Use equal capacitors of
0.1F.
2. Design the oscillator of Figure 3 such that the frequency of oscillation will be 610Hz.
Use equal capacitors of 15nF.
3. Design the oscillator of Figure 4 to provide frequency of oscillation at 2.1kHz. Use
equal capacitors of 15nF.
1.
SPICE Simulation:
Using SPICE simulate the different configurations and from SPICE output file obtain the
oscillation frequency. For simulating the op-amp you can use the second model presented
in Experiment # 4. The simulation of oscillator circuits using SPICE usually produces no
output. This is because the oscillator theoretically has no input signal. In practice, an
oscillator starts oscillating because there is a small voltage or noise present at the circuit
terminals. This small voltage must be included in the simulation of oscillator circuits to
overcome the start up problems. To illustrate this point, consider the SPICE program
given in Figure 5. It can be seen that to start oscillation a small voltage VIMAG is
applied for a short time (1s). This will make sure that oscillations will start. Once the
oscillations starts, they will sustain even when the VIMAG goes to zero after 1s.
Wein Bridge Oscillator Simulation
R1
2 5 270
R2
2 6 541
RS
6 1 10K
CS
1 3 15n
RP
3 0 10K
CP
3 0 15n
VIMAG 5 0 PWL(0 0 0.1u 0.1 0.5u 0.1 1u 0)
X1 2 3 6 OPAMP
.TRAN 0.01m 652m 650m 0.01m
.PROBE
*
v- v+ vo
.SUBCKT OPAMP
2
1
4
RIN
1
2
2MEG
GM1
0
3
1
2
20m
73
R1
3
C1
3
GM2
0
R2
7
C2
7
GM3
0
R0
4
DL1
4
DL2
6
VL1
5
VL2
0
.MODEL
.ENDS
.END
0
0
7
0
0
4
0
5
4
0
6
DIODE
1MEG
0.031uF
3
0
1K
39.8pF
7
0
1K
DIODE
DIODE
DC
13V
DC
13V
D
10m
1m
4. Tabulate the results obtained from your hand calculations and from SPICE simulation
in Table I.
EXPERIMENTAL WORK
1. Assemble the circuit shown in Figure 1 using your design values. Change the variable
resistance until you get an output on the oscilloscope. This means that your circuit is
oscillating. Record frequency of oscillation and the value of the resistance at which
oscillation just starts to appear on the oscilloscope in Table I.
2. Repeat step 1 for circuit shown in Figure 2 for two cases R5=R8=5k and
R5=R8=5k. Use R6=R7=1k.
3. Repeat step 1 for circuit shown in Figure 3.
4. Repeat step 1 for circuit shown in Figure 4.
74
Hand
Calculation
Circuit
Frequency
Figure 1
R1
Amplitude
Frequency
Figure 2
R5=R8=5k
R1
Amplitude
Frequency
Figure 2
R5=R8=3k
R1
Amplitude
Frequency
Figure 3
Rf
Amplitude
Frequency
Figure 4
Rf
Amplitude
75
SPICE
Simulation
Experimental
Result
Experiment # 10
BACKGROUND
Comparator:
The simplest way to implement a comparator is to use the op amp in open loop
configuration as shown in Figure 1. For input Vs >VREF, output saturates at VCC while for
Vs<VREF, output saturates at -VEE.
VCC
Vo
741
Vs
3
VREF
+
4
-VEE
Schmitt Trigger:
If an external input Vi is used to trigger the bistable circuit as shown in Figure 2, the
circuit becomes known as Schmitt Trigger circuit. The operation of this circuit can be
explained as follows:
76
+15V
Vi
2
7
-
Vo
741
R1
+
4
-15V
R2
Before applying Vi, the output will be either at the positive (L+) or negative (L-) rated
output of the op amp. Assuming the output starts at L+, this means v+=VTH= L+ with
=R1/(R1+R2). The output will remain at this value (L+) until the input exceeds VTH where
the differential input of the op amp becomes negative. Thus the output will change to L-.
Similarly, if the output starts at L-, the output will stay there unless the input becomes less
than VTL= L- where the differential input of the op amp becomes positive and the output
will switch to L+.
Square wave generation
A simple circuit capable of generating square wave oscillation utilizing Schmitt Trigger
is shown in Figure 3.
R
+15V
C
7
-
Vout
741
R1
+
4
-15V
R2
Figure 3: A simple square wave generator circuit
R3
C4
R6
C6
+15V
C3
+15V
R4
741
R1
Square
wave
output
741
-15V
+15V
R5
+
4
-15V
Vout
741
Triangle
wave
output
+
4
-15V
R2
Astable multivibrator
Integrator
6
Sin wave
output
Low-pass filter
Figure 4: A simple circuit to generate triangle and sin waves from square wave.
R1
C3
+15V
+15V
2
R5
741
741
R2
+
4
R3
+15V
2
-15V
Vout
741
-15V
-15V
Sin wave
output
C1
Square wave
output
Integrator
R4
C2
Figure 5: A simple circuit to generate square and triangular waves from Sin wave.
COMPONENTS
1. Digital Oscilloscope, Bread Board, Digital Multi-Meter, Signal generator.
2. DC supplies from the board.
3. Resistors: 1k(2 NOs),0.27k,10k (3NOs),120k,5k
78
Triangle wave
output
PRELAB WORK
Students must perform the following calculations and SPICE before coming to the
lab.
Design:
1. Design the oscillator of Figure 3 to provide square wave with frequency 2.5kHz use
C=15nF.
2. Design the integrator of Figure 4 such that when the input is square wave with
frequency 2.5kHz the output voltage will have same amplitude. Use capacitor of
20nF.
3. Design the LPF of Figure 4 such that it will pass the 2.5kHz signal and attenuate its
harmonics as much as possible. Use capacitor of 20nF.
4. Design the integrator of Figure 5 such that when the input is square wave with
frequency 1.53kHz the output voltage will have same amplitude. Use capacitor of
20nF.
SPICE Simulation:
5. Using SPICE simulate the circuit of Figure 3 from SPICE output file obtain the
oscillation frequency. For simulating the op-amp you can use the model presented in
Experiment 4.
EXPERIMENTAL WORK
1. Assemble the circuit shown in Figure 3 using your design. Measure the frequency of
oscillation and duty cycle of the square wave output. Sketch the output wave form.
2. Construct the circuit of Figure 4 and test your design. Sketch the different outputs.
3. Use signal generator to provide sine wave with frequency of 1.5kHz with amplitude
of 18V (P-P). Construct the circuit of Figure 5 to generate square and triangle waves.
Sketch the different outputs.
4. Finally, can you think if you start with triangle wave how a sin and square wave can
be generated?
79
MINI-SYSTEM
Consider the circuit of Figure 6. Observing that it consists of an inverting integrator
followed by a sharp comparator (with output of 14V or -14V) in a feedback loop. Answer
the following:
1. Assume at t=0, Vo2 is 14V, what is the value of Vol that makes Vi negative?
2. What will happen when Vo2 switches to -14V?
3. What are the elements that determine the rate of change of Vol?
4. What are the elements that control the threshold that Vol must reach before the
comparator switches states?
5. Draw the output wave from at the output of each op amp.
6. Show for the values given in Figure 6 that the value of the period T = (1.3)RC.
+15V
2
C=-0.1F
+15V
2
741
R=6.8k
3
Vo2
741
Vi
3
-15V
6
3.9k
12k
Vo1
Figure 6: Triangular wave generator (Note that polarity of the op amp inputs
Your lab instructor will assign you to redesign the circuit of Figure 6 for a given
frequency of oscillation.
80
APPENDIX
1. Capacitors and Resistor available in stores are listed below.
81
CERAMIC
CERAMIC
ELECTROLYTE
1P
1.5P
2P
4.7P
5P
10P
18P
22P
27P
33P
47P
68P
100P
180P
220P
270P
330P
470P
560P
1000P
2000P
0.1
0.01
0.05
0.0001
0.00022
0.00047
0.001
0.0015
0.22
0.0047
0.015
0.022
0.047
0.47
0.15
0.47
1
2.2
3.3
4.7
6.8
10
15
22
33
47
100
220
330
380
10
11
12
13
15
16
18
20
22
24
27
30
33
36
39
43
47
51
56
62
68
75
82
91
100
110
120
130
150
160
180
82
200
220
240
270
300
330
360
390
430
470
510
560
620
680
750
820
910
1K
1.1K
1.2K
1.3K
1.5K
1.6K
1.8K
2K
2.2K
2.4K
2.7K
3K
3.3K
3.6K
3.9K
4.3K
4.7K
5.1K
5.6K
6.2K
6.8K
7.5K
8.2K
9.1K
10K
11K
12K
13K
15K
16K
18K
20K
22K
24K
27K
30K
33K
36K
39K
43K
47K
51K
56K
62K
68K
82K
91K
100K
110K
120K
130K
150K
160K
180K
200K
220K
240K
270K
300K
330K
360K
390K
430K
470K
510K
560K
620K
680K
750K
820K
910K
1M
2.2M
10M
83
84
85
86
87
88
89
90
91