#Given
Vplus=15
Vminus=-15
Vsatp=13
Vsatm=-13 #All in Volts
Aol=200000.0 #gain
#Example 2-1(a)
Vam=-10*(10**-6) #voltage at minus input
Vap=-15*(10**-6) #voltage at plus input
Ed1=Vap-Vam #Differential Input Voltage
Vout1=Ed1*Aol #Output Voltage
if Vout1>15:
print"Value of o/p voltage1 = 13.0000V" #positive saturation voltage
elif(Vout1<-15):
print"Value of o/p voltage1 = -13.0000V" #negative saturation voltage
else:
print" Value of o/p voltage1 = ",Vout1*Vsatp,"V"
#Example 2-1(b)
Vbm=-10*(10**-6) #voltage at minus input
Vbp=+15*(10**-6) #voltage at plus input
Ed2=Vbp-Vbm #Differential Input Voltage
Vout2=Ed2*Aol #Output Voltage
if Vout2>15:
print"Value of o/p voltage2 = 13.0000V" #positive saturation voltage
elif(Vout2<-15):
print"Value of o/p voltage2 = -13.0000V" #negative saturation voltage
else:
print" Value of o/p voltage2 = ",Vout2,"V"
#Example 2-1(c)
Vcm=-10*(10**-6) #voltage at minus input
Vcp=-5*(10**-6) #voltage at plus input
Ed3=Vcp-Vcm #Differential Input Voltage
Vout3=Ed3*Aol #Output Voltage
if(Vout3>15):
print"Value of o/p voltage3 = 13.0000V" #positive saturation voltage
elif(Vout3<-15):
print"Value of o/p voltage3 = -13.0000V" #negative saturation voltage
else:
print" Value of o/p voltage3 = ",Vout3,"V"
#Example 2-1(d)
Vdm=+1.000001 #voltage at minus input
Vdp=+1.000000 #voltage at plus input
Ed4=Vdp-Vdm #Differential Input Voltage
Vout4=Ed4*Aol #Output Voltage
if(Vout4>15):
print"Value of o/p voltage4 = 13.0000V" #positive saturation voltage
elif(Vout4<-15):
print"Value of o/p voltage4 = -13.0000V" #negative saturation voltage
else:
print" Value of o/p voltage4 = ",round(Vout4,2),"V"
#Example 2-1(e)
Vem=+5*(10**-3) #voltage at minus input
Vep=0 #voltage at plus input
Ed5=Vep-Vem #Differential Input Voltage
Vout5=Ed5*Aol #Output Voltage
if(Vout5>15):
print"Value of o/p voltage5 = 13.0000V" #positive saturation voltage
elif(Vout5<-15):
print"Value of o/p voltage5 = -13.0000V" #negative saturation voltage
else:
print" Value of o/p voltage5 = ",Vout5
#Example 2-1(f)
Vfm=0 #voltage at minus input
Vfp=+5*(10**-3) #voltage at plus input
Ed6=Vfp-Vfm #Differential Input Voltage
Vout6=Ed6*Aol #Output Voltage
if(Vout6>15):
print"Value of o/p voltage6 = 13.0000V" #positive saturation voltage
elif(Vout6<-15):
print"Value of o/p voltage6 = -13.0000V" #negative saturation voltage
else:
print" Value of o/p voltage6 = V ",Vout6
#Given
f=50.0 #in Hz
Vtemp=4.0 #input signal in volts
Ecm=10.0
#Calculation
#Example 2-2(a)
T=1/f
Th=(Vtemp*T)/Ecm #High time in seconds
#Example 2-2(b)
d=(Th/T)*100 #duty cycle in percentage
#Result
print" High Time is ",Th*1000,"ms"
print" Duty cycle is",d,"percent"
#Given
Vtemp=4.0 #in volts
Ecm=5.0 #maximum peak voltage of a sawtooth carrier wave
T=0.01 #in seconds
#calculation
Th=T*(1-(Vtemp/Ecm)) #High Time
#Result
print" High Time is ",Th*1000,"ms"