print " Refer to the figure-5.5 shown"
print "i) When Rb=300 kohm"
print " Base emitter junction is not reverse biased "
print " Assume transistor is operating in active region"
Rb=300e3#
Rc=2e3##collector resistance
Vcc=10##supply voltage
Vbe=0.7##base emitter voltage
print " We know that Vcc=Ib*Rb+Vbe "
Ib=(Vcc-Vbe)/Rb##since Vcc=Ib*Rb+Vbe
print "\n base current Ib is: %.2f microA \n"%(Ib*1e6)
Beta=100#
Ic=Beta*Ib##colector current in active region
print "\n Collector current is %.1f mA \n"%(Ic*1e3)
print " Applying KVL around collector loop ie Vcc=Ic*Rc+Vce"
Vce=Vcc-Ic*Rc##since Vcc=Ic*Rc+Vce
print "\n Now Vce= %.1f V \n\n"%(Vce)
print " Since Vce=3.8 V collector to base junction is reverse biased and we can say \n that our assumption that transistor is in active region is justified"
print "\n\n ii)When Rb=150 kohm\n\n"
print " base emitter junction is not reverse biased "
Rb=150e3#
print " assume transistor is operating in active region"
print " Applying KVL around base loop ie Vcc=Ib*Rb+Vbe"
Ib=(Vcc-Vbe)/Rb##since Vcc=Ib*Rb+Vbe
print "\n base current Ib is: %.0f microA \n"%(Ib*1e6)
Ic=Beta*Ib##colector current in active region
print "\n Collector current is %.1f mA \n"%(Ic*1e3)
print " Applying KVL around collector loop ie Vcc=Ic*Rc+Vce"
Vce=Vcc-Ic*Rc##since Vcc=Ic*Rc+Vce
print "\n Therefore Vce= %.1f V \n\n"%(Vce)
print " Collector voltage Vce has to be +ve or zero but Vce=-2.4 V hence \n transistor is not in active region but it is in saturation region\n\n "
Vbe_sat=0.8##base saturation voltage
Vce_sat=0.2##collector saturation voltage
print " Applying KVL around base loop ie Vcc=Ib*Rb+Vbe_sat"
Ib=(Vcc-Vbe_sat)/Rb##since Vcc=Ib*Rb+Vbe_sat
print "\n base current Ib is: %.0f microA \n"%(Ib*1e6)
print " Applying KVL around collector loop ie Vcc=Ic*Rc+Vce_sat"
Ic=(Vcc-Vce_sat)/Rc#since Vcc=Ic*Rc+Vce_sat
print "\n Collector current is %.1f mA \n"%(Ic*1e3)
print " To justify transistor is in saturation then \n Ib must be greater than (Ic/Beta)"
x=Ic/Beta
print "\n\n Now Ib=%.0f microA \n \n (Ic/Beta)=%.0f microA \n"%(Ib*1e6,x*1e6)
if (Ib>x) :
x=(Ic/Beta)
print " Hence transistor in saturation region is satisfied "
Vbe=0.7##base emitter voltage for silicon
Vcc=12##supply voltage
Rb=150e3#
Rc=2e3
hFE_min=50##minimum voltage gain
hFE_max=60##maximum voltage gain
Ib=(Vcc-Vbe)/Rb##since Vcc=Ib*Rb+Vbe
print "\n base current is %.8f A \n"%(Ib)
print "\n for hFE_min=50"
Ic=hFE_min*Ib
print "\n Ic=%.3f A \n"%(Ic*1e3)
Vce=Vcc-Ic*Rc
print " Vce=%.4f V \n"%(Vce)
print "\n\n for hFE_max=60"
Ic=hFE_max*Ib
print "\n Ic=%.2f A \n"%(Ic*1e3)
Vce=Vcc-Ic*Rc
print " Vce=%.0f V \n"%(Vce)
print "Refer to the figure-5.8 shown"
Vbe=0.7##base emitter voltage for silicon
Vcc=12##supply voltage
Rb=100e3#
Rc=10e3#
Beta=100##voltage gain
Ib=(Vcc-Vbe)/((1+Beta)*Rc+Rb)##since Vcc=Ib*Rb+Vbe
print "\n base current is %.2f microA \n"%(Ib*1e6)
Ic=Beta*Ib
print "\n Ic=%.3f mA \n"%(Ic*1e3)
Vce=Vcc-(Ib+Ic)*Rc
print "\n Vce=%.4f V \n"%(Vce)
Vbe=0.7##base emitter voltage for silicon
Vcc=12##supply voltage
Rb=150e3#
Rc=2e3
hFE_min=50#
hFE_max=60#
print "i) for hFE_min=50"
Beta=hFE_min##minimum voltage gain
Ib=(Vcc-Vbe)/((1+Beta)*Rc+Rb)##since Vcc=Ib*Rb+Vbe
print "\n base current is %.2f microA \n"%(Ib*1e6)
Ic=Beta*Ib
print " Ic=%.3f mA \n"%(Ic*1e3)
Vce=Vcc-(Ib+Ic)*Rc
print " Vce=%.3f V \n"%(Vce)
print "\n for hFE_max=60"
Beta=hFE_max##maximum voltage gain
Ib=(Vcc-Vbe)/((1+Beta)*Rc+Rb)##since Vcc=Ib*Rb+Vbe
print "\n base current is %.2f microA \n"%(Ib*1e6)
Ic=Beta*Ib
print " Ic=%.3f mA \n"%(Ic*1e3)
Vce=Vcc-(Ib+Ic)*Rc
print " Vce=%.3f V \n"%(Vce)
print "Refer to the figure-5.13 shown"
Vbe=0.7##base emitter voltage for silicon
Vcc=10##supply voltage
R1=10e3#
Rc=1e3#
R2=5e3#
Re=500#
Beta=100##voltage gain
Vb=R2*Vcc/(R1+R2)##base voltage
print "\n Vb=%.2f V\n"%(Vb)
Ve=Vb-Vbe##emitter voltage
print "\n Ve=%.2f V \n"%(Ve)
Ie=Ve/Re#
print "\n Ie=%.2f mA \n"%(Ie*1e3)
Ib=5.26e-3/(1+Beta)##Ie=0.00526 A=5.26 mA
print "\n Ib=%.2f microA \n"%(Ib*1e6)
Ic=Beta*Ib#
print "\n Ic=%.3f mA \n"%(Ic*1e3)
print "We apply KVL to the collector circuit"
print "Vcc-Ic*Rc-Vce-Ie*Re=0"
Vce=Vcc-Ic*Rc-Ie*Re##since Vcc-Ic*Rc-Vce-Ie*Re=0
print "\n Vce=%.2f V \n"%(Vce)
print "Refer to the figure-5.13 shown in the question no 5.5\n"
#We must find the value of Ic,Ve,Vce using exact analysis
Vbe=0.7##base emitter voltage for silicon
Vcc=10##supply voltage
R1=10e3#
Rc=1e3#
R2=5e3#
Re=500#
Beta=100##voltage gain
Vt=R2*Vcc/(R1+R2)##thevenin's voltage
print "\n Vt=%.2f V\n"%(Vt)
Rb=R1*R2/(R1+R2)#
print "\n Rb=%.0f ohm \n"%(Rb)
Ib=(Vt-Vbe)/(Rb+(1+Beta)*Re)#
print "\n Ib=%.3f microA \n"%(Ib*1e6)
Ic=Beta*Ib#
print "\n Ic=%.2f mA \n"%(Ic*1e3)
Vce=Vcc-Ic*Rc-(Ic+Ib)*Re##since Vcc-Ic*Rc-Vce-Ie*Re=0
print "\n Vce=%.3f V \n"%(Vce)
#the ans for Ve in the book is 2.648V whereas in output it is 2.638V because
# in the book the values has been rounded off so that the final answer is
#2.648V same is the case for Rb,Ib andIc
Vbe=0.7##base emitter voltage for silicon
Vcc=12##supply voltage
R1=10e3#
R2=2e3
Re=470#
Rc=2e3
hFE_min=50#
hFE_max=60#
Vb=R2*Vcc/(R1+R2)##base voltage
print "\n Vb=%.0f V\n"%(Vb)
Ve=Vb-Vbe##emitter voltage
print "\n Ve=%.1f V \n"%(Ve)
Ie=Ve/Re#
print "\n Ie=%.2f mA \n"%(Ie*1e3)
print "\ni) for hFE_min=50"
Beta=hFE_min#
Ib=Ie/(Beta+1)#
Ic=Beta*Ib#
print "\n Ic=%.3f mA \n"%(Ic*1e3)
Vce=Vcc-Ic*Rc-Ve#
print " Vce=%.3f V \n"%(Vce)
print "ii)for hFE_max=60"
Beta=hFE_max#
Ib=Ie/(Beta+1)#
Ic=Beta*Ib#
print " Ic=%.3f mA \n"%(Ic*1e3)
Vce=Vcc-Ic*Rc-Ve#
print " Vce=%.2f V \n"%(Vce)
print "refer to the figure-5.17 shown"
Vbe=0.7##base emitter voltage for silicon
Vcc=10##supply voltage
Beta=100##voltage gain
Vce=5##colector to emitter voltage
Ic=5e-3##collector current
print "We apply KVL to the collector circuit ie Vcc-Vce-Ic*Rc=0"
Rc=(Vcc-Vce)/Ic##since Vcc-Vce-Ic*Rc=0
print "\n Rc=%.0f kohm \n"%(Rc*1e-3)
Ib=Ic/Beta##base current
print "\n Ib=%.2f microA \n"%(Ib*1e6)
print "We apply KVL to the base circuit ie Vcc-Vbe-Ib*Rb=0"
Rb=(Vcc-Vbe)/Ib##since Vcc-Vbe-Ib*Rb=0
print "\n Rb=%.0f kohm \n"%(Rb*1e-3)
print "the standard value of Rb=200k ohm"
print "refer to the figure-5.19 shown"
Vbe=0.7##base emitter voltage for silicon
Vcc=16##supply voltage
Beta=100##voltage gain
Vce=5##colector to emitter voltage
Ic=5e-3##collector current
Ib=Ic/Beta##base current
print "\n Ib=%.0f microA \n"%(Ib*1e6)
Rc=(Vcc-Vce)/(Ic+Ib)##since Vcc-Vce-Ic*Rc=0
print "\n Rc=%.3f kohm \n"%(Rc*1e-3)
print "Rc=2 kohm standard value"
print "We apply KVL to the input circuit ie Vce-Vbe-Ib*Rb=0"
Rb=(Vce-Vbe)/Ib##since Vce-Vbe-Ib*Rb=0
print "\n Rb=%.0f kohm \n"%(Rb*1e-3)
print "the standard value of Rb=91 kohm"
print "Refer to the figure-5.20 shown"
Vbe=0.7##base emitter voltage for silicon
Vcc=12##supply voltage
Beta=100##voltage gain
Vce=5##colector to emitter voltage
Ve=3##assumption
Ic=3e-3##collector current
Ib=Ic/Beta##base current
print "\n Ib=%.0f microA \n"%(Ib*1e6)
Ie=Ic+Ib##emitter current
print "\n Ie=%.2f mA \n"%(Ie*1e3)
Re=Ve/Ie#
print "\n Re=%.0f ohm \n"%(Re)
print " the standard value of Re=910 ohm"
Re=910##standard value
Ve=Ie*Re#
print "\n\n Ve=%.3f V \n"%(Ve)
Rc=(Vcc-Ve-Vce)/Ic
print "\n Rc=%.0f ohm \n"%(Rc)
print " the lower side standard value is selected to reduce Ic*Rc and increase Vce "
Vb=Ve+Vbe
print "\n\n Therefore Vb=%.5f V \n"%(Vb)
I=10*Ib
print "\n I=%.1f mA \n"%(I*1e3)
R2=Vb/I#
print "\n R2=%.0f ohm \n"%(R2)
print " the standard value of R2=11 kohm\n"
print "the lower side standard is selected to satisfy I>=10*Ib"
R2=11e3#
I=Vb/R2#
print "\n I=%.4f mA \n"%(I*1e3)
R1=(Vcc-Vb)/(I+Ib)
print "\n R1=%.3f kohm \n"%(R1*1e-3)
print " the standard value of R1=22kohm\n"
print "The lowest standard value is selected to satisfy I>=10*Ib"
#for base bias take the figure as shown the Example5.1
Beta=100#
S=1+Beta##stability factor
print "\n For base bias: stability factor=%.0f \n"%(S)
#for collector to base bias the figure as shown the Example5.3
Beta=100#
Rc=10e3#
Rb=100e3
S=(1+Beta)/(1+Beta*(Rc/(Rc+Rb)))#
print "\n For collector to base bias: stability factor=%.0f \n"%(S)
#for voltage divider bias take the figure as shown the Example5.5
Re=500#
R1=10e3#
R2=5e3#
Rb=R1*R2/(R1+R2)##R1 and R2 are in parallel
S=(1+Beta)/(1+Beta*(Re/(Re+Rb)))#
print "\n For voltage divider bias: stability factor=%.2f \n"%(S)
print "Refer to the figure-5.25 shown"
Icbo1=2e-6##at a temperature T1=25 degree celsius
Vbb=5#
Vbe=0.1
print "Icbo doubles for every 10 degree Celsius"
T1=25##temperature in degree celsius
T2=80##temperature in degree celsius
Icbo2=Icbo1*2**((T2-T1)/10)##at a temperature T2=80 degree celsius
print "\n Therefore Icbo2=%.2f microA \n"%(Icbo2*1e6)
print "Apply KVL to the base circuit Vbb=Vbe+Icbo2*Rb we get"
Rb=(Vbb-Vbe)/Icbo2#
print "\n Rb=%.3f kohm \n"%(Rb*1e-3)
print "Refer to the figure-5.26 shown"
Vcc=15##supply voltage
Beta=100##voltage gain
Vbe=0.6##base emitter voltage
Ic=2e-3
Vce=3#
R4=600#
R2=10e3#
Ib=Ic/Beta#
Ie=Ic+Ib##collector current
print "\n Apply KVL to the collector side Vcc=Ic*R3+Vce+Ie*R4"
R3=(Vcc-Vce-Ie*R4)/Ic##since Vcc=Ic*R3+Vce+Ie*R4
print "\n Therefore R3=%.3f kohm \n"%(R3*1e-3)
print "\n Apply KVL to the base side I*R2=Vbe+Ie*R4"
I=(Vbe+Ie*R4)/R2##since I*R2=Vbe+Ie*R4
print "\n Therefore I=%.4f mA \n"%(I*1e3)
print "\n Apply KVl to the potential divider side we get Vcc=(I+Ib)*R1+I*R2"
R1=(Vcc-I*R2)/(I+Ib)##since Vcc=(I+Ib)*R1+I*R2
print "\n therefore R1=%.3f kohm \n"%(R1*1e-3)
print "Refer to the figure-5.27 shown"
Vcc=12##supply voltage
Beta=100##voltage gain
Vbe=0.7##base emitter voltage
Ic=2e-3#
Ib=Ic/Beta#
R1=50e3#
R2=5e3#
Rc=2e3#
print "apply KVl to the potential divider side we get Vcc-(I+Ib)*R1-I*R2=0 we get"
I=(Vcc-R1*Ib)/(R1+R2)##since Vcc-(I+Ib)*R1-I*R2=0
Vb=R2*I#
Ie=Ib+Ic#
Re=(Vb-Vbe)/(Ib+Ic)##Vb=Vbe+Re*Ie
print "\n Re=%.2f ohm \n"%(Re)
print "Apply KVL to the collector side Vcc-Ic*Rc-Vce+Ie*Re=0"
Vce=Vcc-Ic*Rc-Ie*Re##since Vcc-Ic*Rc-Vce+Ie*Re=0
print "\n Therefore Vce=%.1f V \n"%(Vce)
Rb=R1*R2/(R1+R2)##R1 and R2 are in parallel
S=(1+Beta)/(1+Beta*(Re/(Re+Rb)))#
print "\n stability factor=%.3f \n"%(S)
print "Refer to the figure-5.28 shown"
Vbe=0.7#
Rb=100e3#
Rc=600#
Vcc=12##supply voltage
T1=25##temperature in degree celsius
T2=75##temperature in degree celsius
print "at T1=25 degree celsius, applying KVL to the base circuit we get"
print "Vcc-Ib*Rb-Vbe=0"
Beta=100##voltage gain at T1=25 degree celsius
Ib=(Vcc-Vbe)/Rb##since Vcc-Ib*Rb-Vbe=0
Ic=Beta*Ib#
print "\n Therefore Ic=%.1f mA \n"%(Ic*1e3)
print "Apply KVL to the collector side Vcc-Ic*Rc-Vce=0"
Vce=Vcc-Ic*Rc##since Vcc-Ic*Rc-Vce=0
print "\n Therefore Vce=%.2f V \n"%(Vce)
Beta=125##voltage gain at T1=25 degree celsius
Ic1=Beta*Ib#
Vce1=Vcc-Ic1*Rc##since Vcc-Ic*Rc-Vce=0
print "\n At 75 degree celsius Vce=%.3f\n"%(Vce1)
Ic_change=(Ic1-Ic)*100/Ic##percentage in Ic
print "\n change in Ic=%.0f %% (an increase)\n"%(Ic_change)
Vce_change=(Vce1-Vce)*100/Vce##percentage in Vce
print "\n change in Vce=%.2f %% (a decrease) \n"%(Vce_change)