Chapter14-Operational Amplifier and Applications

Ex1-pg438

In [2]:
##Ex14_1
import math
Ad = 100.##differential gain
Ac = 0.01##common mode gain
CMRR = Ad/Ac##Common Mode Rejection Ratio
CMRR_dB = 20.*math.log10(CMRR)##Common Mode Rejection Ratio in decibles
print'%s %.2f %s'%("Ad = ",(Ad),"")
print'%s %.2f %s'%("Ac = ",(Ac),"")
print'%s %.2f %s'%("CMRR = Ad/Ac = ",(CMRR),"")
print'%s %.2f %s'%("CMRR = ",(CMRR_dB),"dB")
Ad =  100.00 
Ac =  0.01 
CMRR = Ad/Ac =  10000.00 
CMRR =  80.00 dB

Ex2-pg439

In [3]:
##Ex14_2
import math
CMRR_dB = 100.##Common Mode Rejection Ratio in decibles
CMRR = 10**(100./20.)##CMRR as a ratio
print'%s %.2f %s'%("CMRR = ",(CMRR_dB),"dB")
print'%s %.2f %s'%("CMRR = 10^(100/20) = ",(CMRR),"")
CMRR =  100.00 dB
CMRR = 10^(100/20) =  100000.00 

Ex3-pg439

In [4]:
##Ex14_3
import math
Rf = 10.*10**3##feedback resistance
R1 = 10.*10**3##resistance 1
R2 = 2.*10**3##resistance 2
v1 = 10.##input voltage across resistance 1
v2 = 4.##input voltage across resistance 2
##note: according to the given fig. in the textbook for the question we have:

vo = -Rf*((v1/R1)+(v2/R2))##output voltage of adder circuit
print'%s %.2f %s'%("Rf = ",(Rf),"ohm")
print'%s %.2f %s'%("R1 = ",(R1),"ohm")
print'%s %.2f %s'%("R2 = ",(R2),"ohm")
print'%s %.2f %s'%("v1 = ",(v1),"V")
print'%s %.2f %s'%("v2 = ",(v2),"V")
print'%s %.2f %s'%("vo = -Rf*((v1/R1)+(v2/R2)) = ",(vo),"V")
Rf =  10000.00 ohm
R1 =  10000.00 ohm
R2 =  2000.00 ohm
v1 =  10.00 V
v2 =  4.00 V
vo = -Rf*((v1/R1)+(v2/R2)) =  -30.00 V

Ex4-pg439

In [5]:
##Ex14_4
import math
Rf = 1.*10**3##feedback resistance
R1 = 1.*10**3##resistance 1
R2 = 1.*10**3##resistance 2
R3 = 1.*10**3##resistance 3
v1 = 2.##input voltage 1
v2 = 1.##input voltage 2
v3 = 3.##input voltage 3
vo = -Rf*((v1/R1)+(v2/R2)+(v3/R3))##output voltage of adder circuit
print'%s %.2f %s'%("Rf = ",(Rf),"ohm")
print'%s %.2f %s'%("R1 = ",(R1),"ohm")
print'%s %.2f %s'%("R2 = ",(R2),"ohm")
print'%s %.2f %s'%("R3 = ",(R3),"ohm")
print'%s %.2f %s'%("v1 = ",(v1),"V")
print'%s %.2f %s'%("v2 = ",(v2),"V")
print'%s %.2f %s'%("v3 = ",(v3),"V")
print'%s %.2f %s'%("vo = -Rf*((v1/R1)+(v2/R2)+(v3/R3)) = ",(vo),"V")
Rf =  1000.00 ohm
R1 =  1000.00 ohm
R2 =  1000.00 ohm
R3 =  1000.00 ohm
v1 =  2.00 V
v2 =  1.00 V
v3 =  3.00 V
vo = -Rf*((v1/R1)+(v2/R2)+(v3/R3)) =  -6.00 V

Ex7-pg440

In [6]:
##Ex14_7
import math
Af = -20.##closed loop gain of op-amp
R = 10.*10**3##output resistance
Rf = -Af*R##feedback resistance
print'%s %.2f %s'%("Af = ",(Af),"")
print'%s %.2f %s'%("R = ",(R),"ohm")
print'%s %.2f %s'%("Rf = -Af/R = ",(Rf),"ohm")
Af =  -20.00 
R =  10000.00 ohm
Rf = -Af/R =  200000.00 ohm