Chapter 3: Operational Amplifier Characteristics

Example No. 3.1, Page No: 107

In [13]:
#Variable Declaration:
Vp=15.0                           #Volatge in volt
Vm=-15.0                          #Voltage in volt
R5=40.0*10**3                     #Resistance in ohm
Vbe11=0.7                         #Voltage in volt
Vbe12=Vbe11                       #Voltage in volt

#Calculations:
Iref= (Vp-Vbe12-Vbe11-Vm)/R5      #Calculating reference current

Iref=Iref*10**3                   #Calculating reference current

#Results:
print("Iref= %.3f mA"%Iref)
Iref= 0.715 mA

Example No. 3.2, Page No: 107

In [14]:
#Variable Declaration:
Iref= 0.715*10**-3         #reference current in ampere
Ic13b= 0.75*Iref           #Current in ampere
Ic17=Ic13b                 #Current in ampere
Ie17=Ic13b                 #Current in ampere
Beta=150.0                 #Gain
Vbe17=0.7                  #Vbe volatge in volt
R9=50.0*10**3              #Resistance in ohm
R8=100.0                   #Resistance in ohm

#Calculations:
Ic16= (Ic17/Beta) + (Ie17*R8 + Vbe17)/R9    #Calculating current
Ic16=Ic16*1000000.0/1.232                   #Calculating current

#Results:
print("\nIc16= %.1f uA"%Ic16)
Ic16= 15.1 uA

Example No. 3.3, Page No:108

In [15]:
#Variable Declaration:
import math
Iref=0.000715                #Reference current in ampere
Vbe19=0.7                    #Vbe voltage in volt
Is18=10**-14                 #Current in ampere
Is19=10**-14                 #Current in ampere
R10=50000.0                  #Resistance in ohm

Is14=2.0*10**-14             #Current in ampere
Is20=2.0*10**-14             #Current in ampere
Vbe=0.7                      #Voltge Vbe in volt
Vbe19=0.612                  #Voltage Vbe in volt
Beta=200.0                   #Gain
Vbe18=0.549                  #Volatge vbe in volt

#Calculations:
Ic13a=0.25*Iref              #Calculating Current          

Ir10=Vbe19/R10               #Calculating current
Ic19=Ic13a-Ir10              #Calculating current

Ib19=Ic19/Beta               #Calculating current
Ic18=Ir10+Ib19               #Calculating current
         
Vbb=Vbe18+Vbe19              #calculating voltage

Ic14=Is20*math.exp(Vbb/2*0.026) #Calculating current
Ic14=Ic14*10**15/0.2042         #Calculating current

#Results:
print('Vbb= %.3f V'%Vbb)
print('\nIc14= %.2f uA'%Ic14)
Vbb= 1.161 V

Ic14= 99.43 uA

Example no. 3.4, Page No: 115

In [16]:
#Variable Declaration:
Ib1=400.0*10**-9         #Current in ampere
Ib2=300.0*10**-9         #Current in ampere

#Calculations:
Ib=(Ib1+Ib2)/2.0         #Calculating current
Ios=Ib1-Ib2              #Calculating current
Ib=Ib*10**9              #Calculating current
Ios=Ios*10**9            #Calculating current

#Results:
print('Ib= %.1f nA'%Ib)
print('\nIos= %.1f nA'%Ios)
Ib= 350.0 nA

Ios= 100.0 nA

Example No. 3.5, Page No: 115

In [17]:
#Variable Declaration:
Ios=400.0*10**-9         #Current in ampere
Rf=100.0*10**3           #Resistance in ohm 
R1=1.0*10**3             #Resistance in ohm

#Calculations:
Vo=Rf*Ios                #Calculating output voltage
Vo=Vo*1000.0             #Calculating output voltage  

#Results:
print('Vo= %.1f mV'%Vo)
Vo= 40.0 mV

Example No. 3.6, Page No: 117

In [2]:
#Variable Declaration:
Rf=10.0*10**3                      #Resistance in ohm
R1=2.0*10**3                       #Resistance in ohm
Vos=5.0*10**-3                     #Voltage in volt
Ios=50.0*10**-9                    #Input offset current in ampere
Ib=200.0*10**-9                    #Input bias current in ampere
Ta=25.0                            #Temperature in degree celsius
#Calculations:
# without compensating resistor
Vot=(1+Rf/R1)*Vos + Rf*Ib          #Calculating output offset voltage
Vot=Vot*1000                       #Calculating output offset voltage
print('Vot= %.1f mV'%Vot)


# with compensating resistor
Vot=(1+Rf/R1)*Vos + Rf*Ios         #Calculating output offset voltage
Vot=Vot*1000                       #Calculating output offset voltage
print('\nVot= %.1f mV'%Vot)
Vot= 32.0 mV

Vot= 30.5 mV

Example No. 3.7, Page No:119

In [1]:
#Part A
#Variable Declaration:
Vos=1.5*10**-3            #Voltage in volt
Rf=1.0*10**6              #feedback resistance in ohm
R1=100.0*10**3            #Resistance in ohm

#Calculations:
Vo=Vos*(1+Rf/R1)         #Calculating output voltage
Vo=Vo*1000.0             #Calculating output voltage

#Result:
print('Vo= %.1f mV'%Vo)

#Part B
#Variable Declaration:
Iosch= 10.0*10**-9       #Ios current in ampere

#Calculations:
Vosch=Iosch*Rf           #Calculating output voltage
Vosch=Vosch*1000.0       #Calculating output voltage

#Results:
print('\nChange in Vo= %.1f mV'%Vosch)
print('\n Worst case drift is 26.5 mV or -26.5 mV')
Vo= 16.5 mV

Change in Vo= 10.0 mV

 Worst case drift is 26.5 mV or -26.5 mV

Example No.3.8, Page No: 125

In [19]:
f=1000.0                 # frequency in hertz
#from graph
gain_db=60.0             # Gain in db
gain=1000.0              #Gain

#Result:
print('Gain= %d'%gain)
Gain= 1000

Example No. 3.9, Page No: 126

In [20]:
#Variable Declaration:
riset=0.7*10**-6               #rise time in microsecond

#Calculations:
bw=0.35/riset                  #Finding unity gain bandwidth
bw=bw/1000.0                   #Finding unity gain bandwidth

#Results:
print('Bandwidth= %d kHz'%bw)
Bandwidth= 500 kHz

Page No. 3.10, Page No: 126

In [21]:
#Variavle Declaration:
ugb=1.5*10**6              #Unity gain bandwidth in hertz
f1=2.0*10**3               #Signal frequency in hertz

#Calculations:
A0=ugb/f1                  #Calculating open loop DC voltage gain

#Results:
print('Openloop Dc Voltage gain= %d '%A0)
Openloop Dc Voltage gain= 750 

Example No. 3.11, Page No: 134

In [22]:
#Variable Declaration:
Voch=10.0             #Change of voltage in volt
slew=0.5              #Slew rate in volt per microsecond

#Calculations:
time=Voch/slew        #Calculating time taken for output to change by 10V 

#Results:
print('Time= %d us'%time)
Time= 20 us

Example No. 3.12, Page No: 135

In [23]:
import math
#Part A
#Variable Declaration:
slew=0.5                     #Slew rate in volt per microsecond
Vm=12.0                      #Voltage in volt

#calculations:
fmax=slew/(2.0*math.pi*Vm)   #calculating frequency of maximum undistorted wave
fmax=fmax*1000.0             #Calculating frequency of maximum undistorted wave

#Results:
print('Fmax= %.1f kHz'%fmax)

# Part B
#Variable Declarations:
Vm1=2.0                      #Voltage in volt

#Calculations:
fmax1=slew/(2.0*math.pi*Vm1) #calculating frequency of maximum undistorted wave
fmax1=fmax1*1000.0           #calculating frequency of maximum undistorted wave

#Results:
print('\nFmax1= %.1f kHz'%fmax1)
Fmax= 6.6 kHz

Fmax1= 39.8 kHz

Example No. 3.13, Page No: 135

In [1]:
#Variable Declaration:
import math
slew=0.5                   #Slew rate in volt per microsecond
f=10.0*10**3               #frequency in hertz

#Calculations:
Vmmax=slew/(2*math.pi*f)   #Calculating maximum peak to peak voltage
Vmmax=Vmmax*10**6          #Calculating maximum peak to peak voltage

#Results:
print('Vm(max)= %.2f V'%Vmmax)
Vm(max)= 7.96 V

Example No. 3.14, Page No: 135

In [25]:
#Variable Declaration:
slew=0.5                  #Slew rate in volt per microsecond
riset=4.0                 #Rise time in microsecond

print('\nVo is greater than 1V')
Vswing=(0.9-0.1)*5.0      #Voltage swing in volt

#Calculations:
slewreq=Vswing/riset      #Calculating required slew rate

#Results:
print('\nSlew Rate Required= %d V/us'%slewreq)
Vo is greater than 1V

Slew Rate Required= 1 V/us

Example No. 3.15, Page No: 135

In [26]:
#Variable Declaration:
Vch=20.0                #Change in voltage in volt
time=4.0                #Time in microseconds

#Calculations:
slew=Vch/time           #Calculating slew rate       

#Results:
print('\nSlew Rate = %d V/us'%slew)
Slew Rate = 5 V/us

Example No. 3.16, Page No: 136

In [27]:
#Variable Declaration:
import math
A=50.0                                #Gain
slew=0.5                              #Slew rate in volt per microsecond
Vid=20.0*10**-3                       #Voltage difference in volt
 
#Calculations:
Vm=A*Vid                              #Calculating maximum voltage 

fmax=(slew*10**6)/(2*math.pi*Vm)      #calculating frequency of maximum undistorted wave   
fmax=fmax/1000.0                      #calculating frequency of maximum undistorted wave

#Results:
print('Fmax= %.1f kHz'%fmax)
Fmax= 79.6 kHz

Example No. 3.17, Page No: 136

In [28]:
#Variable Declaration:
import math
slew=0.5                      #Slew rate in volt per microsecond
f=4.0*10**4                   #frequency in hertz

#Calculations:
Vm=(slew*10**6)/(2*math.pi*f) #Calculating Vm
Vmpp=2.0*Vm/10.0              #Calculating maximum peak to peak input signal that can be applied

#Results:
print('Vpeak= %.2f V'%Vm)
print('\nVoltage peak-to-peak= %.3f V'%Vmpp)
Vpeak= 1.99 V

Voltage peak-to-peak= 0.398 V

Example No. 3.18, Page No: 138

In [29]:
#Variable Declaration:
Rf=10.0*10**3        #Resistance in ohm
R1=100.0             #Resistance in ohm
Vni=1*10**-6         #input rms noise voltage in volt

#Calculations: 
Kn=1+Rf/R1           #Calculating noise gain
Vno=Vni*(1+Rf/R1)    #Calculating output voltage
Vno=Vno*10**6        #Calculating output voltage

#Results:
print('Output noise voltage= %d uV (rms)'%Vno)
Output noise voltage= 101 uV (rms)

Example No: 3.19, Page No: 142

In [30]:
#Variable Deeclaration:
Rf=10.0*10**3       #Feedback resistance in ohm
R1=1.0*10**3        #Resistance in ohm

#Calculations:
Av=-Rf/R1           #Calculating gain

#Results:
print('Closed loop voltage gain= %d'%Av)
Closed loop voltage gain= -10

Example No. 3.20, Page No: 147

In [31]:
#Variable Declaration:
Rf=10.0*10**3      #Feedback resistance in ohm
R1=1.0*10**3       #Resistance in ohm

#Calculations:
Av=1+ Rf/R1        #Calculating gain

Beta=R1/(Rf+R1)    #Calculating feedback factor

#Results:
print('Closed loop voltage gain= %d'%Av)
print('\nFeedback factor= %.3f'%Beta)
Closed loop voltage gain= 11

Feedback factor= 0.091

Example No. 3.21, Page No:147

In [32]:
#Variable Declaration:
R1=10.0*10**3        #Resistance in ohm
R2=1.0*10**3         #Resistance in ohm
R3=1.0*10**3         #Resistance in ohm
Rf=50.0*10**3        #Resistance in ohm

#Calculations:
I=1/(R2+R3)          #Calculating current 
Vi1=I*R2             #Calculating input voltage
Vo=Vi1*(1+ Rf/R1)    #Calculating output voltage   

#Result:
print('Vout= %d V'%Vo)
Vout= 3 V

Example No: 3.22, Page No: 147

In [33]:
#Variable Declration:
Vi=0.6                #volatge in volt 
Vi1=0.6               #volatge in volt
Vi2=0.6               #volatge in volt
R1=10.0*10**3         #Resistance in ohm
Rf=20.0*10**3         #Resistance in ohm
RL=2.0*10**3          #Resistance in ohm

#Calculations:
I1=Vi/R1              #Calculating current
I1=I1*1000.0          #Calculating current
Av=1+Rf/R1            #Calculating gain
Vo=Av*Vi              #Calculating output voltage
IL=Vo/RL              #Calculating load current
IL=IL*1000            #Calculating load current

#By Kirchhoff's current law
Io=I1+IL              #Calculating output current

#Results:
print('\nIo=%.2f mA'%Io)
print('Av=%d'%Av)
print('\nVo=%.1f V'%Vo)
print('\nI1=%.1f mA'%IL)
Av=3

Vo=1.8 V

I1=0.9 mA

Io=0.96 mA

Example No. 3.23,Page No:151

In [34]:
#Variable Declaration:
import math
fL=50.0                       #Frequency in hertz
RL=3.3*10**3                  #Resistance in ohm
Ibmax=500.0*10**-9            #Current in ampere
R1max=140.0*10**3             #Resistance in ohm

#Calculations:
C1=1/(2*math.pi*fL*R1max/10)   #Calculating value of capacitor
C1=C1*10**6                    #Calculating value of capacitor

C2=1/(2*math.pi*fL*RL)         #Calculating value of capacitor
C2=C2*10**6                    #Calculating value of capacitor

#Results:
print('C1=%.3f uF'%C1)
print('\nC2=%.2f uF'%C2)
C1=0.227 uF

C2=0.96 uF

Example No. 3.24, Page NO: 153

In [2]:
#Variable Declaration:
import math

Vbe=0.6                     #Voltage Vbe in volt
Ibmax=500.0*10**-9          #Current in ampere
fL=50.0                     #frequency in hertz
RL=3.3*10**3                #Resistance in ohm
Mmin=50000.0

#Calculations:
R1max=0.1*Vbe/Ibmax         #Calculating maximum value of the resistance R1
R1=R1max/2.0                #Calculating value of R1
R2=R1                       #Value of R2 is equal to R1

C3=1/(2*math.pi*fL*RL)      #Calculaing value of capacitance
C3=C3*10**6                 #Calculaing value of capacitance

C2=1/(2*math.pi*fL*R2/10)   #Calculaing value of capacitance
C2=C2*10**6                 #Calculaing value of capacitance


Zinmin=(1+Mmin)*56.0*10**3  #Calculating minimum input impedance
Zinmin=Zinmin/10**6         #Calculating minimum input impedance

#Results:
print('\nC3=%.2f uF'%C3)
print('\nC2=%.2f uF'%C2)
# answer in textbook is wrong
print('\nZin(min)= %d Mohm'%Zinmin)
C3=0.96 uF

C2=0.53 uF

Zin(min)= 2800 Mohm

Example No. 3.25, Page No: 156

In [36]:
#Variable Declaration:
import math
Vo=3.0                      #output voltage in volt
Vi=10.0*10**-3              #Input voltage in volt
R2=1.0*10**6                #Resistance in ohm
Av=300.0                    #Gain
fL=100.0                    #Frequency in hertz
RL=15.0*10**3               #Resistance in ohm

#Calculations:
R3=R2/(Av-1)                #Calculating value of resistance 

R1=R2-R3                    #Calculating value of resistance
C2=1/(2*math.pi*fL*R3)      #Calculatinf value of capacitance
C2=C2*10**6                 #Calculating value of capacitance
  
C3=1/(2*math.pi*fL*RL/10)   #Calculating value of capacitance
C3=C3*10**6                 #Calculating value of capacitance

#Results:
print('\nC2= %.2f uF'%C2)
print('\nC3= %.2f uF'%C3)
C2= 0.48 uF

C3= 1.06 uF

Example No. 3.26, Page NO: 159

In [37]:
#Variable Declaration:
import math
fL=20.0                   #frequency in hertz
fH=2000.0                 #frequency in hertz
RL=300.0                  #Resistance in ohm
R1=1.5*10**3              #Resistance in ohm
R2=56*10**3               #Resistance in ohm

#Calculations:
C1=1/(2*math.pi*fL*R1/10) #Calculating value of capacitance

C1=C1*10**6               #Calculating value of capacitance

C2=1/(2*math.pi*fL*RL)    #Calculating value of capacitance
C2=C2*10**6               #Calculating value of capacitance

Cf=1/(2*math.pi*fH*R2)    #Calculating value of capacitance
Cf=Cf*10**12              #Calculating value of capacitance


#Results:
print('\nC1= %d uF'%C1)
print('\nC2= %.1f uF'%C2)
print('\nCf= %d pF'%Cf)
C1= 53 uF

C2= 26.5 uF

Cf= 1421 pF

Example No. 3.27, Page No: 162

In [3]:
#Variable Declaration:
import math
Ibmax=500.0*10**-9       #Current in ampere
Vcc=24.0                 #Volatge Vcc in volt
I2=50.0*10**-6           #Current in ampere
Vo=6.0                   #Output voltage in volt
Av=100.0                 #Gain
fL=100.0                 #Frequency in hertz
RL=5.6*10**3             #Resistance in hertz

#Calculations:
I2=100.0*Ibmax           #Calculating current
R1=Vcc/(2.0*I2)          #Calculating resistance
R2=R1                    #value of R2 is equal to R1
Vi=Vo/Av                 #Calculating input voltage

I4=100.0*Ibmax           #Calculating current
R4=Vi/I4                 #Calculating  value of resistance

R3=118.8*10**3           #Calculating value of resistance
R1pR2=(R1+R2)/4.0        #Calculating parellel combination of R1 and R2

C1=1/(2*math.pi*fL*R1pR2/10.0) #Calculating value of capacitance
C1=C1*10**6                    #Calculating value of capacitance
 
C2=1/(2*math.pi*fL*RL/10.0)    #Calculating value of capacitance
C2=C2*10**6                    #Calculating value of capacitance

C3=1/(2*math.pi*fL*R4)         #Calculating value of capacitance
C3=C3*10**6                    #Calculating value of capacitance

#Results:
print('\nC1= %.3f uF'%C1)
print('\nC2= %.3f uF'%C2)
print('\nC3= %.3f uF'%C3)
C2= 2.842 uF

C1= 0.133 uF

C3= 1.326 uF

Example No. 3.28, Page No:166

In [39]:
#Variable Declaration:
cmrr=10**5         #Common mode rejection ratio
Adm=10**5          #Differential gain

#Calculations:
Acm=Adm/cmrr       #Calculating common mode gain

#Results:
print('Common mode gain Acm= %d'%Acm)
Common mode gain Acm= 1

Example No: 3.29, Page NO: 168

In [4]:
#Variable Declaration:
R1=560.0            #Resistance value in ohm
R3=560.0            #Resistance value in ohm
Rf=5.6*10**3        #Resistance value in ohm

R2=Rf               #Value of R2 is equal to Rf
Vo1=-2.0            #Volatage in volt  
Ri=2.0*10**6        #Resistance value in ohm
Vo2=-1.0            #Voltage in volt

#Calculations:
# Part 1
Ad=1+Rf/R1          #Calculating differential gain

# Part 2
A=200000.0                      #Gain
Ri1=Ri*(1+ (A*R2)/(R2+R3))      #Calculating resistance value
Ri1=Ri1/10**9                   #Calculating resistance value

Ri2=Ri*(1+ (A*R1)/(R1+Rf))      #Calculating resistance value  
Ri2=Ri2/10**9                   #Calculating resistance value
 
# Part 3
Vid=Vo2-Vo1                     #Calculating differential voltage
Vo=(1+Rf/R1)*Vid                #Calculating output voltage
Vo=Vo

#Results:
print('\nAd= %d'%Ad)
print('\nRi1=%.1f Gohm'%Ri1)
print('\nRi2=%.2f Gohm'%Ri2)
print('\nVo=%d V'%Vo)
Ad= 11

Ri1=363.6 Gohm

Ri2=36.37 Gohm

Vo=11 V
In [ ]: