Chapter 5: Practical Limitations of Op Amp Circuits

Example 5.1, Page 135

In [5]:
#Variable declaration
G=20.;       #in dB
A=10**(G/20);        #Ordinary gain
GBW=1*10**6;         #in Hz (from datasheet)

#Calculations&Results
f2=GBW/A/1000;
#Result
print "Uper break frequency %.0f kHz"%f2;
Uper break frequency 100 kHz

Example 5.2, Page 135

In [6]:
import math

#Variable declaration
Rf=10000.;       #in Ohm
Ri=2000;        #in Ohm

#Calculations&Results
Av=-Rf/Ri;
print "Av  = %.0f "%Av;
Av1=20*math.log10(-Av);
print "Av in %.0f bB"%Av1;
#for noise gain 
An=1+Rf/Ri;
print "Anoise =%.0f "%An; 
Av  = -5 
Av in 14 bB
Anoise =6 

Example 5.3, Page 138

In [9]:
#Variable declaration
Rf=20000.;      #in Ohms
Ri=500;         #in Ohms
f2=50*10**3;        #In Hz

#Calculations&Results
Anoise=1+(Rf/Ri);
print "Anoise = %.f"%Anoise;
funity=Anoise*f2*10**-6;
print "funity = %.2f MHz"%funity;

print "For this application 741 would not be fast enough, therefore 411 would be fine";
Anoise = 41
funity = 2.05 MHz
For this application 741 would not be fast enough, therefore 411 would be fine

Example 5.4, Page 140

In [12]:
#Variable declaration
#STAGE 1
print "Stage 1";
Rf1=14000.;      #in Ohms
Ri1=2000;         #in Ohms
Av1=1+(Rf1/Ri1);
print "Av = %.f"%Av1;
Anoise1=1+(Rf1/Ri1);
print "Anoise =%.f "%Anoise1;
GBW=1*10**6;         #in Hz (from Datasheet)
f1=GBW/Anoise1;
print "f2 = %.f"%f1;

#STAGE 2
print "\nStage 2";
Rf2=20000.;      #in Ohms
Ri2=10000;         #in Ohms
Av2=-(Rf2/Ri2);
print "Av = %.f"%Av2;
Anoise2=1+(Rf2/Ri2);
print "Anoise = %.f"%Anoise2;
GBW=1*10**6;         #in Hz (from Datasheet)
f2=GBW/Anoise2;
print "f2 = %.f"%f2;

#STAGE 3
print "\nStage 3";
Rf3=12000.;      #in Ohms
Ri3=4000;         #in Ohms
Av3=1+(Rf3/Ri3);
print "Av = %.f"%Av3;
Anoise3=1+(Rf3/Ri3);
print "Anoise = %.f"%Anoise3;
GBW=1*10**6;         #in Hz (from Datasheet)
f3=GBW/Anoise3;
print "f2 = %.f"%f3;

#SYSTEM
Av=Av1*Av2*Av3;
print "\nAv = %.f"%Av;

print "Dominant break frequency here is 125kHz";
GBW=f1*64;
print "Gain bandwidth product = %.f"%GBW;
Stage 1
Av = 8
Anoise =8 
f2 = 125000

Stage 2
Av = -2
Anoise = 3
f2 = 333333

Stage 3
Av = 4
Anoise = 4
f2 = 250000

Av = -64
Dominant break frequency here is 125kHz
Gain bandwidth product = 8000000

Example 5.5, Page 142

In [16]:
#Variable declaration
Anoise=10;
funity=4.*10**6;          #in Hz

#Calculations&Results
f2=funity/Anoise*10**-3;
print "f2 = %.f kHz"%f2;
n=3;
f2_system=f2*(2**(1./n)-1)**0.5*10**-3;
print "f2_system = %.1f KHz"%f2_system;
f2 = 400 kHz
f2_system = 0.2 KHz

Example 5.6, Page 142

In [19]:
#Variable declaration
Av1=26;     #in dB
Av=20;      #ordinary gain
f2=500*10**3;    #in Hz

#Calculations&Results
funity=f2*Av;    #(Anoise=Av for non inverting terminal)
print "funity = %.f Hz"%funity
#411 has funity =4MHZ ,therefore atleast 2 stages would be required
#Stage 1
f411=4.*10**6;            #in hz
Av1=f411/f2;
print "Av = %.f"%Av1;
#To achive gain of 20 second stage should have gain of atleast Av2=2.5
Av2=2.5;
f2=f411/Av2*10**-6;
print "f2 = %.1f MHz"%f2;
funity = 10000000 Hz
Av = 8
f2 = 1.6 MHz

Example 5.7, Page 148

In [21]:
import math

#Variable declaration
slewrate=0.5/10**-6;       # in V/S
Vp=12;      #in Volts

#Calculations
fmax=slewrate/(2*math.pi*Vp);

#Result
print "Fmax = %.f Hz"%fmax;
Fmax = 6631 Hz

Example 5.8, Page 149

In [23]:
import math

#Variable declaration
fmax=20000;     #in Hz
Vp=10;      #in Volts

#Calculations
slewrate=fmax*(2*math.pi*Vp)*10**-6;

#Result
print "Slew rate = %.3f V/uS"%slewrate;
Slew rate = 1.257 V/uS

Example 5.9, Page 157

In [27]:
#Variable declaration
Rf=10000.;       # in Ohm
Ri=1000;        #in ohm
Roff=0;         #in ohm

#Calculations&Results
Anoise=1+Rf/Ri;
print "Anoise = %.f"%Anoise;
Vos=0.5*10**-3;      #in Volt
Ios=10*10**-9;       #in Amp
Ib=800*10**-9;       #in Amp
Vout=(Vos*Anoise)+(Ib*Roff*Anoise+Ib*Rf);
print "Vout = %f V"%Vout;

Roff=Ri*Rf/(Rf+Ri);
Vout=(Vos*Anoise)+(Ios*Rf);
print "Vout_offset = %f V"%Vout;
Anoise = 11
Vout = 0.013500 V
Vout_offset = 0.005600 V

Example 5.10, Page 158

In [30]:
#Variable declaration
Rf=20000;       # in Ohm
Ri=5000;        #in ohm
Av=-Rf/Ri;
Vin=3*10**-3;        #in Volt 

#Calculations&Results
Vout=Av*Vin;
print "Vout = %f V"%Vout;

#411 typical apecs
Vos=0.8*10**-3;      #in Volt
Ios=25*10**-12;       #in Amp
Ib=50*10**-12;       #in Amp
Anoise=1+Rf/Ri;
Roff=0;
Vout=(Vos*Anoise)+(Ib*Roff*Anoise+Ib*Rf);
print "Vout = %f V"%Vout;
Vout = -0.012000 V
Vout = 0.004001 V

Example 5.11, Page 161

In [31]:
#Variable declaration
Roff=909;           #in Ohm
Rf=10000;           #in Ohm
Anoise=11;
DT=55;      #degree Celsius
DVbyDT=5*10**-6;      #    V/C
DInoisebyDT=200*10**-12;            #  A/C

#Calculations&Results
Vdrift=(DVbyDT*DT*Anoise)+(DInoisebyDT*DT*Rf);
print "Vdrift = %f V"%Vdrift;
Av=Anoise;
Vdriftin=Vdrift/Av;
print "Vdriftinput = %f V"%Vdriftin;
Vdrift = 0.003135 V
Vdriftinput = 0.000285 V

Example 5.12, Page 163

In [32]:
#Variable declaration
Av=20;          #in dB
Vin=-60;        #in dBV
CMRR=-90;       #in dB

#Calculations&Results
#for differential input
Vout=Av+Vin;
print "Vout for differential mode input = %.f dBV"%Vout;
#for common mode input
Vout1=Vout+CMRR;
print "Vout for common mode signal = %.f dBV"%Vout1;
#This signal is so small that it is overshadowed by noise
Vout for differential mode input = -40 dBV
Vout for common mode signal = -130 dBV

Example 5.13, Page 164

In [37]:
#Variable declaration
PSRR=86.;        #in dB
Vripple=0.5;       #in Volt

#Calculations&Results
Psrr=10**(PSRR/20);
print "PSRR ordinary value = %d"%Psrr;
Vout=Vripple/Psrr;
print "Vout_ripple = %.e Vpp"%Vout
#incorrect answers in textbook
PSRR ordinary value = 19952
Vout_ripple = 3e-05 Vpp

Example 5.14, Page 167

In [39]:
import math

#Variable declaration
Rf=99000.;       # in Ohm
Ri=1000;        #in ohm
Rs=100;        #in ohm

#Calculations&Results
Av=1+Rf/Ri;
print "Av ordinary value %.f"%Av;
print "Av dB value = %.f"%(20*math.log10(Av))
Anoise=Av;          #for non inverting amplifier
Rnoise=Rs+Rf*Ri/(Rf+Ri);
print "Rnoise =%.f ohms"%Rnoise;

T=300;      #Given in degree cel.
K=1.38*10**-23;      #Boltzmann's constant
Vind=4*10**-9;       #In V/Hz
Iind=0.6*10**-12;     #in A/Sqrtof Hz
eth=(4*K*T*Rnoise)**0.5;      #sqared the 
etot=((Vind**2)+(Iind*Rnoise)**2 +eth**2)**0.5;
print "V/(Hz)**0.5 = %e etotal"%etot;

funity=10*10**6;     #in Hz
f2=funity/Anoise;
print "f2 = %.f Hz"%f2;
BWnoise=f2*1.57;
print "BWnoise =%.f Hz"%BWnoise;

en=etot*(BWnoise)**0.5;
print "en= %e V"%en;

en_out=en*Anoise;
print "en_out =%.e V"%en_out;

#for a nominal output signal of 1V RMS signal to noise ratio is 
signal=1;           #in V
Noise=en_out;
S_N=signal/Noise;

print "Signal to Noise ratio =%.f"%S_N;           #answer in book is approxmately 
print "S/N in dB = %.1f"%(20*math.log10(S_N));
Av ordinary value 100
Av dB value = 40
Rnoise =1090 ohms
V/(Hz)**0.5 = 5.871807e-09 etotal
f2 = 100000 Hz
BWnoise =157000 Hz
en= 2.326599e-06 V
en_out =2e-04 V
Signal to Noise ratio =4298
S/N in dB = 72.7