#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)
#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)
#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)
#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)
#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)
#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)
#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')
f=1000.0 # frequency in hertz
#from graph
gain_db=60.0 # Gain in db
gain=1000.0 #Gain
#Result:
print('Gain= %d'%gain)
#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)
#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)
#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)
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)
#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)
#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)
#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)
#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)
#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)
#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)
#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)
#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)
#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)
#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)
#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)
#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)
#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)
#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)
#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)
#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)
#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)