import math
#initialisation of variables
Vcc=12.0
R2=15.0*10**3
R1=33.0*10**3
rs=600
#Calculations
print("with no signal source")
Vb=(Vcc*R2)/(R1+R2)
print(" base bais voltage when no signal source is present %3.2fV " %Vb)
print(" signal source directly connected")
Vb=(Vcc*((rs*R2)/(rs+R2))/(R1+((rs*R2)/(rs+R2))))
#Results
print("base bais voltage is %3.2fV " %Vb)
import math
#initialisation of variables
Rc=2.2*10**3
Re=2.7*10**3
R1=18.0*10**3
R2=8.2*10**3
Vbe=.7
#Calculations
print("drawing dc load line")
Rldc=Rc+Re
print(" for Vce")
Ic=0
Vcc=20
Vce=Vcc-Ic*(Rc+Re)
print("plot point A at")
Ic=Vcc/(Rc+Re)
print("plot point B Ic=4.08mA and Vce=0")
print(" draw dc laod line through point A nad B")
Vb=(Vcc*R2)/(R1+R2)
Ve=Vb-Vbe
Ic=Ve/Re
Ie=Ic
print("drawing the ac load line")
Rlac=Rc#when there is no external Rl
Vce=Ic*Rc
#Results
print("The voltage is %.2f v " %Vce)
import math
#initialisation of variables
Vce=4.5
Ib=40.0*10**-6
#Calculations
print("from current characteristic at Vce=4.5V and Ib=40uA")
Ic=4.0*10**-3
Ib=30.0*10**-6
hFE=Ic/Ib
print(" the value of hFE is %d " %hFE)
print("from output characteristic at Vce=4.5 and Ib=40uA")
Ic=0.2
Vce=6
hoe=(Ic/Vce)
R=1/hoe
#Results
print("the value of hoe is %3.1fuS " %(hoe*10**3))
print("the value of 1/hoe is %3.1fuS " %(1/hoe))
import math
#initialisation of variables
hfe=133.0
hoe=33.3*10**-6
hfc=1+hfe
#Calculations
hob=hoe/(1+hfe)
A=hfe/(1+hfe)
#Results
print("tye value of a is %3.1fuS " %(A))
import math
#initialisation of variables
Ib=20.0*10**-6
Ic=1.0*10**-3
Ie=Ic
#Calculations
re=(26*10**-3)/Ie
hfe=Ic/Ib
hie=(1+hfe)*re
r=hie
B=hfe
#Results
print("the value of b is %3.1f " %(B))
import math
#initialisation of variables
hie=2.1*10**3
hfe=75.0
hoe=1*10**-6
R1=68.0*10**3
R2=56.0*10**3
Rc=3.9*10**3
Rl=82*10**3
#Calculations
print(" input impedance Zi=R1||R2||hie")
Zi=((R1*R2*hie)/(R1+R2+hie))*10**-3
print(" input impedance is %3.2fKohm " %Zi)
print("output impedance is Zo=Rc||(1/hoe)")
Zo=((Rc*(1/hoe))/(Rc+(1/hoe)))*10**-3
print(" output impadance is %f3.2fKohm " %Zo)
Av=-(hfe*((Rc*Rl)/(Rc+Rl)))/hie
#Results
print(" voltage gain is %d " %Av)
import math
#initialisation of variables
Ic=1.5*10**-3
Rc=4.7*10**3
Rl=56.0*10**3
#Calculations
Ie=Ic
re=(26*10**-3)/Ie
Av=-(((Rc*Rl)/(Rc+Rl))/re)
#Results
print(" voltage gain is %d " %Av)
import math
#initialisation of variables
hie=2.1*10**3
hfe=75.0
hoe=1.0*10**-6
Re=4.7*10**3
R1=68.0*10**3
R2=56.0*10**3
Rc=3.9*10**3
Rl=82.0*10**3
#Calculations
Zb=hie+Re*(1+hfe)
print(" input impedance is Zi=R1||R2||Zb")
Zi=((R1*R2*Zb)/(R1+R2+Zb))
print(" input circuit resistance is %3.3fKohm " %Zi)
Zo=Rc
Av=-hfe*((Rc*Rl)/(Rc+Rl))/(hie+Re*(1+hfe))
#Results
print("voltage gain is %3.3f " %Av)
import math
#initialisation of variables
hie=2.1*10**3
hfe=75.0
R1=10.0*10**3
R2=10.0*10**3
Re=4.7*10**3
Rl=12.0*10**3
rs=1.0*10**3
#Calculations
print(" Rl is not connected")
hic=hie
hfc=1+hfe
Zb=hic+hfc*(Re)
Zi=(R1*R2*Zb)/(R1+R2+Zb)
Ze=(hic+(R1*R2*rs)/(R1+R2+rs))/hfc
Z0=(Ze*Re)/(Ze+Re)
print(" when Rl is connected")
Zb=hic+hfc*((Re*Rl)/(Re+Rl))
Zi=(R1*R2*Zb)/(R1+R2+Zb)
hib=hie/(1+hfe)
Av=((Re*Rl)/(Re+Rl))/(hib+((Re*Rl)/(Re+Rl)))
#Results
print("voltage gain is %3.3f " %Av)
import math
#initialisation of variables
hie=2.1*10**3
hfe=75.0
Re=4.7*10**3
Rc=3.9*10**3
Rl=82.0*10**3
#Calculations
hib=hie/(1+hfe)
hfb=hfe/(1+hfe)
Zi=(hib*Re)/(Re+hib)
print("input impedance is %3.2fohm " %Zi)
Zo=Rc
print(" output impedance is %3.2fohm " %Zo)
Av=(hfb*((Rc*Rl)/(Rc+Rl)))/hib
#Results
print(" voltage gain is %3.2f " %Av)
import math
#initialisation of variables
hib=27.6
hfb=.987
R1=68.0*10**3
R2=56.0*10**3
Re=4.7*10**3
Rc=3.9*10**3
Rl=82.0*10**3
#Calculations
Rb=(R1*R2)/(R1+R2)
Ze=hib+Rb*(1-hfb)
Zi=(Ze*Re)/(Ze+Re)
Av=(hfb*((Rc*Rl)/(Rc+Rl)))/(hib+Rb*(1-hfb))
#Results
print("voltage gain is %3.3f " %Av)
import math
#initialisation of variables
Rc=5.6*10**3
Rl=33.0*10**3
rs=600.0
hfe=100
hie=1.5*10**3
vs=50.0*10**-3
#Calculations
print(" CE circuit operation with vs at transistor base and Re bypassed")
Av=(hfe*((Rc*Rl)/(Rc+Rl)))/hie
Zb=hie
Rb=(R1*R2)/(R1+R2)
Zi=(Rb*Zb)/(Rb+Zb)
vi=(vs*Zi)/(rs+Zi)
vo=Av*vi
print("Cb circuit operation with vs at emitter and the base resistor bypassed")
Av=(hfe*((Rc*Rl)/(Rc+Rl)))/hie
Ze=hie/(1+hfe)
Zi=(Ze*Re)/(Ze+Re)
vi=(vs*Zi)/(rs+Zi)
vo=Av*vi
#Results
print("voltage vo is %3.2f " %(vo*10**3))
import math
#initialisation of variables
Io=50.0*10**-9
Vbe=.7
Vbc=-10
Af=.995
Ar=.5
Vt=26.0*10**-3
n=2.0
Vd=-10.0
#Calculations
x=Vd/(n*Vt)
Idc=(Io*((2.73**-x)-1))*10**9
Idc=Io*(-1)
y=Vbe/(n*Vt)
Ide=Io*((2.73**y)-1)
I1=Af*Ide
I2=Ar*Idc
Ic=I1-Idc
Ie=Ide-I2
Ib=Ie-Ic
#Results
print("voltage gain is %3.3f " %(Ib*10**6))