##Ex8_1
import math
print("(a)")
Vce=0.
Ic=2.*10**-3
Ib=30.*10**-6
Vbe=50.*10**-3
print'%s %.f %s'%("Vce = ",(Vce),"V")##collector-emitter voltage
print'%s %.2e %s'%("Ic = ",(Ic),"A")##collector current
print'%s %.f %s'%("Ib = ",(Ib),"A")##base current
print'%s %.2f %s'%("Vbe = ",(Vbe),"V")##base-emitter voltage
hfe=Ic/Ib
print'%s %.2f %s'%("hfe = Ic/Ib = ",(hfe),"")##current gain in CE amplifier
hie=Vbe/Ib
print'%s %.2f %s'%("hie = Vbe/Ib = ",(hie),"ohm")##input impedance in CE amplifier
print("(b)")
Ib=0.
Vce=1.
Vbe=0.3*10**-3
Ic=0.1*10**-3
print'%s %.f %s'%("Vce = ",(Vce),"V")##collector-emitter voltage
print'%s %.2e %s'%("Ic = ",(Ic),"A")##collector current
print'%s %.f %s'%("Ib = ",(Ib),"A")##base current
print'%s %.2e %s'%("Vbe = ",(Vbe),"V")##base-emitter voltage
hoe=Ic/Vce
print'%s %.2e %s'%("hoe = Ic/Vce = ",(hoe),"mho")##output conductance in CE amplifier
hre=Vbe/Vce
print'%s %.2e %s'%("hre = Vbe/Vce = ",(hre),"")##voltage gain in CE amplifier
## note: textbook answers has printing mistake, regaeding hre.
##Ex8_2
import math
RL = 8.*10**3
hie=1.0*10**3
hre=2.5*10**-4
hfe=50.
hoe=25.*10**-6
print'%s %.2f %s'%("RL = ",(RL),"ohm")##load resistance
##h-parameters for CE transistor amplifier are as follows:
print'%s %.2f %s'%("hie = ",(hie),"ohm")##input resistance of CE transistor
print'%s %.2e %s'%("hre = ",(hre),"")##voltage gain of CE transistor
print'%s %.2f %s'%("hfe = ",(hfe),"")##current gain of CE transistor
print'%s %.2e %s'%("hoe = ",(hoe),"mho")##output conductance of CE transistor
##calculation for current gain:
Ai=-hfe/(1.+(hoe*RL))
print'%s %.2f %s'%("Ai = -hfe/(1+(hoe*RL)) = ",(Ai),"")
print'%s %.2f %s'%("Ai = ",(abs(Ai)),"")
##calculation for input resistance:
Ri = hie+(hre*Ai*RL)
print'%s %.2f %s'%("Ri = hie+(hre*Ai*RL) = ",(Ri),"ohm")
##note : answer in the textbook regarding above problem is not accuratly calculated.
##Ex8_3
import math
RL = 8.*10**3
Rs= 500.
hie=1.0*10**3
hre=2.5*10**-4
hfe=50.
hoe=25.*10**-6
print'%s %.2f %s'%("RL = ",(RL),"ohm")##load resistance
print'%s %.2f %s'%("Rs = ",(Rs),"ohm")##source resistance
##h-parameters for CE transistor amplifier are as follows:
print'%s %.2f %s'%("hie = ",(hie),"ohm")##input resistance of CE transistor
print'%s %.2e %s'%("hre = ",(hre),"")##voltage gain of CE transistor
print'%s %.2f %s'%("hfe = ",(hfe),"")##current gain of CE transistor
print'%s %.2e %s'%("hoe = ",(hoe),"mho")##output conductance of CE transistor
Ai=-hfe/(1.+(hoe*RL))
print'%s %.2f %s'%("Ai = -hfe/(1+(hoe*RL)) = ",(Ai),"")##calculation for current gain
Ri = hie+(hre*Ai*RL)
print'%s %.2f %s'%("Ri = hie+(hre*Ai*RL) = ",(Ri),"ohm")##calculation for input resistance
Ais=(Ai*Rs)/(Ri+Rs)
print'%s %.2f %s'%("Ais = (Ai*Rs)/(Ri+Rs)= ",(Ais),"")##current gain with source resistance
Avs = Ai*RL/Ri
print'%s %.2f %s'%("Avs = Ai*RL/Ri = ",(Avs),"")##voltage gain with source resistance
##note : in the textbook above problem has given two values for hie BUT no value for hfe ...
## thus assuming hie=50 as hfe =50, as given in the previous example 8_2
##note : answer in the textbook is not accuratly calculated.
##Ex8_4
import math
RL=5.*10**3
Rs=1.2*10**3
hre=2.5*10**-4
hie=1.1*10**3
hfe=100.
hoe=25.*10**-6
print'%s %.2f %s'%("RL = ",(RL),"ohm")##load resistance
print'%s %.2f %s'%("Rs = ",(Rs),"ohm")##source resistance
##h-parameters for CE transistor amplifier are as follows:
print'%s %.2f %s'%("hie = ",(hie),"ohm")##input resistance of CE transistor
print'%s %.2e %s'%("hre = ",(hre),"")##voltage gain of CE transistor
print'%s %.2f %s'%("hfe = ",(hfe),"")##current gain of CE transistor
print'%s %.2e %s'%("hoe = ",(hoe),"mho")##output conductance of CE transistor
##calculation for current gain:
Ai=-hfe/(1.+(hoe*RL))
print'%s %.2f %s'%("Ai = -hfe/(1+(hoe*RL)) = ",(abs(Ai)),"")
##calculation for input resistance:
Ri = hie+(hre*Ai*RL)
print'%s %.2f %s'%("Ri = hie+(hre*Ai*RL) = ",(Ri),"ohm")
##calculation for voltage gain:
Av = Ai*RL/Ri
print'%s %.2f %s'%("Av = Ai*RL/Ri = ",(Av),"")
##calculation for output resistance:
Go=hoe-((hre*hfe)/(hie+Rs))
Ro = 1./Go
print("Ro = 1/Go")
print'%s %.2e %s'%("Go = hoe-((hre*hfe)/(hie+Rs)) = ",(Go),"mho")
print'%s %.2f %s'%("Ro = ",(Ro),"ohm")
##note : in the textbook, above problem has given two values for "hfe" and no value for "hre"...
## thus assuming value for "hre = 2.5*10^-4" as taken in previous example 8_2
## and "hfe=100"
##note : in text LOAD RESISTANCE is noted as Rc in question, but RL in solution.
## I have work with Load Resistance with notification RL.
##Ex8_5
import math
RL = 22.*10**3
hfb=-0.98
hob=7.6*10**-7
print'%s %.2f %s'%("RL = ",(RL),"ohm")##load resistance
print'%s %.2f %s'%("hfb = ",(hfb),"")##forward current gain in CB amplifier
print'%s %.2e %s'%("hob = ",(hob),"mho")##output conductance in CB amplifier
Ai = -hfb/(1.+(hob*RL))
print'%s %.2f %s'%("Ai = -hfb/(1+(hob*RL)) = ",(Ai),"")##current gain
##Ex8_6
import math
hfb = -0.999
hib = 50.
hob = 0.82*10**-6
hrb = 4.*10**-6
RL = 22.*10**3
print'%s %.2f %s'%("RL = ",(RL),"ohm")##load impedence
##h-parameters for CB transistor amplifier are as follows:
print'%s %.2f %s'%("hib = ",(hib),"ohm")##input resistance of CB transistor
print'%s %.2e %s'%("hrb = ",(hrb),"")##voltage gain of CB transistor
print'%s %.2f %s'%("hfb = ",(hfb),"")##current gain of CB transistor
print'%s %.2e %s'%("hob = ",(hob),"mho")##output conductance of CB transistor
Av = -(hfb*RL)/((RL*(hib*hob-hfb*hrb))+hib)
print'%s %.2f %s'%("Av = -(hfb*RL)/((RL*(hib*hob-hfb*hrb))+hib) = ",(Av),"")##voltage gain
##note : answer provided in the textbook is not precised.
##Ex8_7
import math
RL = 1.2*10**3
##assuming Rs = RL as given in problem
Rs = RL
##assuming values for h-parameters
hie = 1.0*10**3
hre=2.5*10**-4
hfe = 50.
hoe = 25.*10**-6
print'%s %.2f %s'%("RL = ",(RL),"ohm")##load resistance
print'%s %.2f %s'%("Rs = RL = ",(RL),"ohm")##source resistance
##h-parameters for CE transistor amplifier are as follows:
print'%s %.2f %s'%("hie = ",(hie),"ohm")##input resistance of CE transistor
print'%s %.2e %s'%("hre = ",(hre),"")##voltage gain of CE transistor
print'%s %.2f %s'%("hfe = ",(hfe),"")##current gain of CE transistor
print'%s %.2e %s'%("hoe = ",(hoe),"mho")##output conductance of CE transistor
##calculation for current gain:
Ai=-hfe/(1+(hoe*RL))
print'%s %.2f %s'%("Ai = -hfe/(1+(hoe*RL)) = ",(Ai),"")
##calculation for input impedence:
Ri = hie+(hre*Ai*RL)
print'%s %.2f %s'%("Ri = hie+(hre*Ai*RL) = ",(Ri),"ohm")
##calculation for voltage gain:
print("Av = Ai*RL/Ri")
Av = Ai*RL/Ri
print'%s %.2f %s'%(" = ",(Av),"")
##calculation for output impedence:
Ro = 1/((hoe - (hfe*hre)/(hie+Rs)))
print("Ro = 1/((hoe - (hfe*hre)/(hie+Rs)))")
print'%s %.2f %s'%(" = ",(Ro),"ohm")
##current gain with source impedence:
Ais=(Ai*Rs)/(Ri+Rs)
print'%s %.2f %s'%("Ais = (Ai*Rs)/(Ri+Rs)= ",(Ais),"")
##voltage gain with source impedence:
Avs = Av*Ri/(Ri+Rs)
print'%s %.2f %s'%("Avs = Av*Ri/(Ri+Rs) = ",(Avs),"")
## NOTE : calculation in the textbook for the above problem is wrong.
## while calculating Ri author has use "hie = 1.2*10^3" instead of ASSUMED9 value i.e., "hie = 1.0*10^3"
##Ex8_8
import math
Ai = -60.
hfe = 100.
hoe = 10.*10**-6
print'%s %.2f %s'%("hfe = ",(hfe),"")##forward current gain
print'%s %.2e %s'%("hoe = ",(hoe),"A/V")##output conductance
print'%s %.2f %s'%("Ai = ",(Ai),"")##current gain
RL = -(1./hoe)*(1.+(hfe/Ai))
RL = -(1./hoe)*(1.+(hfe/Ai))
print'%s %.2f %s'% (" ",(RL),"ohm") ##load resistance
##Ex8_9
import math
Ai = -60.
Ri = 2.0*10**3
RL = 15.*10**3
print'%s %.2f %s'%("Ai = ",(Ai),"")##current gain
print'%s %.2f %s'%("Ri = ",(Ri),"ohm")##input resistance
print'%s %.2f %s'%("RL = ",(RL),"ohm")##load resistance
Av = Ai*RL/Ri
print'%s %.2f %s'%("Av = Ai*RL/Ri = ",(Av),"")##voltage gain
##note : in textbook,
## author notify LOAD RESISTANCE as 'Rc' in question BUT 'RL' in solution.
## I have work with "load resistance notified as RL".
##Ex8_10
import math
Av = -200.
Ri = 10.*10**3
RL = 3.*10**3
Ai = Av*Ri/RL
print'%s %.2f %s'%("Av = ",(Av),"")##voltage gain
print'%s %.2f %s'%("Ri = ",(Ri),"ohm")##input resistance
print'%s %.2f %s'%("RL = ",(RL),"ohm")##load resistance
print'%s %.2f %s'%("Ai = Av*Ri/RL = ",(Ai),"")##current gain
## note : there are mis-printring in the textbook for the above problem regading formula and notations.
## answer in the textbook for above problem is wrong.
##Ex8_11
import math
Av = -250.
Ai = -50.
RL = 12.*10**3
print'%s %.2f %s'%("Av = ",(Av),"")##voltage gain
print'%s %.2f %s'%("Ai = ",(Ai),"")##current gain
print'%s %.2f %s'%("RL = ",(RL),"ohm")##load resistance
Ri = Ai*RL/Av
print'%s %.2f %s'%("Ri = Ai*RL/Av = ",(Ri),"ohm")##input resistance