#Caption:Determine low and high voltage outputs and resistance for desinging the gate circuit
Vcc=5.#Supply voltage(in volts)
Vf=0.7#Diode forward voltage(in volts)
I=0.5#Collector current(in mA)
Vce=0.2#Collector emitter voltage(in volts)
R=(Vcc-Vf-Vce)/I
Vl=Vce+Vf
Vh=Vcc
print '%s %.1f %s %.f %s %.1f' %('Lowvoltage outputs(in volts)=',Vl,'\nhigh voltage outputs(in volts)=',Vh,'\nRequired resistance(in kilo ohm)=',R)
#Caption:Find minimum value of the resistance to design OR Gate
Rc=3.3#Collector resistance(in kilo ohm)
V=3.508#Gate output voltage(in volts)
Vcc=5.#Supply voltage(in volts)
Vf=0.7#Forward diode voltage(in volts)
I=(Vcc-Vf-V)/Rc
R=V/I
print '%s %.1f' %('Minimum value of resistance to design the circuit is(in kilo ohm)=',R)