#Caption:Design a 555 monostable circuit
t=1.#Pulse width(in ms)
Vcc=15.#Supply voltage(in volts)
Ith=0.25#Threshold current(in micro Ampere)
Ic=100.*Ith
R=Vcc*1000./(3.*Ic)
C=t*10.**6./(1.*R)
print '%s %.f %s %.f' %('Components required for designing 555 monostable circuit are \nR(in kilo ohm)=',R,'\nC(in pF)=',C)
#/Caption:Design a 555 astable multivibrator
p=2.#Pulse repetition frequency(in Khz)
d=0.66#Duty cycle
Ic=1.#Minimum collector voltage selected(in mA)
Vcc=18.#Supply voltage(in volts)
t=1000./p
t1=d*t
t2=t-t1
R=Vcc/(3*Ic)
C=t1*0.001/(0.693*R)
Rb=t2*0.001/(0.693*C)
Ra=R-Rb
print '%s %.1f %s %.2f %s %.2f' %('Components required to design the circuit are resistors \nRa(in kilo ohm)=',3.3,'\nRb(in kilo ohm)=',Rb,'\nCapacitance(in micro farad)=',C)
#Caption:Determine actual PRF and duty cycle
C=0.082#Capacitance(in micro farad)
Ra=3.3#Resistance(in kilo ohm)
Rb=2.7#Resistance(in kilo ohm)
t1=0.693*C*(Ra+Rb)*1000.
t2=0.693*C*Rb*1000.
T=t1+t2
P=1000./T
d=t1*100./T
print '%s %.f %s %.2f' %('Duty cycle(in %)=',d,'\nPRF(in Khz)=',P)
#Caption:Design a square wave generator using 7555 CMOS
V=5.#Supply voltage(in volts)
f1=1.#Frequency(in khz)
f2=3.#Frequency(in khz)
C=0.01#Capacitance(in micro farad)
Ra=47.#Choosed resistor(in kilo ohm)
t1=1./(0.979*f1)
t2=1./(2.*f2)
R=t1/(0.693*C)
Rb=R-Ra
print '%s %.f %s %.f %s %.2f' %('Components required to design the circuit are \nRa(in kilo ohm)=',Ra,'\nRb(in kilo ohm)=',Rb,'\nCapacitance(in micro farad)=',C)