from __future__ import division
VEE=15
print "VEE= %0.2f"%(VEE)," volts" # voltage supply
VCC=15
print "VCC= %0.2f"%(VCC)," volts" # voltage supply
VHI=+5
print "VHI= %0.2f"%(VHI)," volts" # output voltage upper limit
VLO=-5
print "VLO= %0.2f"%(VLO)," volts" # output voltage Lower limit
Vo=-VLO
IZmin=1*10**(-3)
print "IZmin= %0.2f"%(IZmin)," A" # Zener diode current rating
SR=0.5*10**(6)
print "SR= %0.2f"%(SR)," volts/seconds"#Slew rate
RB=100
print "RB= %0.2f"%(RB)+ " ohm" # resistance
RA=10*10**(3)
print "RA= %0.2f"%(RA)+ " ohm" # resistance
A = 5000
print "A = %0.2f"%(A)#op-amp gain
VREF=1
print "VREF= %0.2f"%(VREF)," volts" # Reference- voltage
print "part(i)"
RD=(VCC-Vo)/IZmin
print "RD=(VCC-Vo)/IZmin= %0.2f"%(RD)+ " ohm" # Series dropping-resistance
print "part(ii)"
t=(VHI-VLO)/SR
print "t=(VHI-VLO)/SR= %0.2e"%(t)," seconds"# Time required to swing the output
tp=10*t
print "tp=(VHI-VLO)/SR= %0.2e"%(tp)," seconds"# Pulse width
fmax=1/(2*tp)
print "fmax=1/(2*tp) = %0.2f"%(fmax)," Hz"# Maximum frequency of operation of OP-AMP comparator
print "part(iii)"
B=RB/(RA+RB)
print "B=RB/(RA+RB)= %0.2f"%(B)#Feedback factor
VLTP=(VLO*B)+(VREF*(RA/(RA+RB)))
print "VLTP=(VLO*B)+[VREF*(RA/(RA+RB))]= %0.2f"%(VLTP)," volts" # Lower trigger point
VUTP=(VHI*B)+(VREF*(RA/(RA+RB)))
print "VUTP=(VHI*B)+[VREF*(RA/(RA+RB))]= %0.2f"%(VUTP)," volts" # Upper trigger point
VH=VUTP-VLTP
print "VH=VUTP-VLTP= %0.2f"%(VH)," volts" # Hysteresis voltage
from math import log
from __future__ import division
Vo=14
print "Vo= %0.2f"%(Vo)," volts" # output voltage
f=500
print "f = %0.2f"%(f)," Hz"#frequency
IB2=500*10**(-9)
print "IB2= %0.2e"%(IB2)," A" #base- Current
B=0.5
print "B=%0.2f"%(B)#Feedback factor
vf=B*Vo
print "vf=B*Vo= +%0.2f"%(vf),", -%0.2f"%(vf)," volts" # Feedback voltage
IR=100*IB2# Taking IR as 100 times that of IB2
print "IR=100*IB2= %0.2e"%(IR)," A" # Current in RB resistor
RB=vf/IR
print "RB=vf/IR= %0.2f"%(RB)+ " ohm" # resistance
RA=RB*((1/B)-1)# Using formulae B=RA/(RA+RB)
print "RA=RB*((1/B)-1)= %0.2f"%(RA)+ " ohm" # resistance
RF=100*10**(3)#Choosing RF=100k
print "RF= %0.2f"%(RF)+ " ohm" #Feedback resistance
C1=1/(2*RF*f*log(1+(2*RB/RA)))
print "C1=1/[2*RF*f*log(1+(2*RB/RA))]= %0.2e"%(C1)," farad" # calculated capacitance value
from __future__ import division
Vo=14
print "Vo= %0.2f"%(Vo)," volts" # output voltage
f=500
print "f = %0.2f"%(f)," Hz"#frequency
R2=10*10**(3)
print "R2= %0.2f"%(R2)+ " ohm" # resistance
VTW=14
print "VTW= %0.2f"%(VTW)," volts" # Triangular peak-peak output voltage
T=1/f
C2=(Vo*T)/(2*VTW*R2)
print "C2=(Vo*T)/(2*VTW*R2)= %0.2e"%(C2)," farad" # calculated capacitance value for deriving triangular wave from square wave astable multivibrator
from __future__ import division
VI=-15
print "VI= %0.2f"%(VI)," volts" # Input voltage
TSW=2*10**(-3)
print "TSW= %0.2e"%(TSW)," seconds"# triangular wave Sweep time
R=10*10**(3)
print "R= %0.2f"%(R)+ " ohm" # resistance as ckt. parameter
C=0.5*10**(-6)
print "C= %0.2e"%(C)," farad" # capacitance as ckt. parameter
S=-VI/(R*C)
print "Sweep rate=VI/(R*C)=%0.2f"%(S)+ " V/s" # Sweep rate for sweep generator
VSW=TSW*S
print "VSW=TSW*S= %0.2f"%(VSW)," volts" # Sweep voltage amplitude
# note in book author has not provided any variable for sweep rate ... but here I have used 'S' for it .
from __future__ import division
VEE=15
print "VEE= %0.2f"%(VEE)," volts" # voltage supply
VCC=15
print "VCC= %0.2f"%(VCC)," volts" # voltage supply
R1=10*10**(3)
print "R1= %0.2f"%(R1)+ " ohm" # resistance
RF=20*10**(3)
print "RF= %0.2f"%(RF)+ " ohm" # Feedback resistance
RB1=3*10**(3)
print "R1= %0.2f"%(R1)+ " ohm" # resistance
RB2=RB1
RF1=1*10**(3)
print "RF1= %0.2f"%(RF1)+ " ohm" # Feedback resistance
RF2=RF1
Av=1*10**(3)
print "Av= %0.2f"%(Av)
print "part(i)"
VBR1= (VCC*RF1)/RB1
VBR2 = VBR1
print "VBR1=VBR2=(VCC*RF1)/RB1= %0.2f"%(VBR1)," volts" #Limit values at the break points and VBR=VBR1=VBR2
So=-RF/R1
print "So=-RF/R1= %0.2f"%(So) # slope of Transfer characteristic at zero crossings
S1=-(RF1/R1)
print "S1=S2=-RF1/R1= %0.2f"%(S1)# slope of Transfer characteristic at the extreme ends
VSL=(-VBR1/So)
print "VSL=VSU=(-VBR1/So)= %0.2f"%(VSL)," volts" # magnitude of input voltage required to produce vo=VBR
VSU=VSL
print "part(ii)"
VSU=(VBR2/Av)#Formulae
print "VSU=VSL=(VBR2/Av)= -%0.2f"%(VSU),", +%0.2f"%(VSU)," volts" # magnitude of input voltage required to produce vo=VBR in case gain Av is very large