# comman base dc current gain
import math
#Variable Declaration
Ic=2.10*10**-3 # collector current in ampere
Ie=2.18*10**-3 # emitter current in ampere
#Calculations
alfa=Ic/Ie
#Result
print("comman base dc current gain = %f"%alfa)
#Different values used for calculations in the book
# Base Current
import math
#Variable Declaration
alfa= 0.987 # Common base D.C. Current Gain
Ie= 10.0 # in Milli Ampere
#Calcualtions
Ic= alfa*Ie # Collector Current
Ib=Ie-Ic # Base Current in Mili Ampere
#Result
print("collector current (in mA) = %.2f"%Ic)
print("base current (in mA) = %.2f"%Ib)
# Calculate base current and collector current
import math
#Variable Declaration
alfa= 0.967 # Common base D.C. Current Gain
Ie= 10.0 # in Milli Ampere
#Calculations
Ic= alfa*Ie # Collector Current
Ib=Ie-Ic # Base Current in Mili Ampere
#Result
print("collector current (in mA) = %.2f"%Ic)
print("base current (in mA) = %.2f"%Ib)
# Calculate base current and collector current
import math
#Variable Declaration
Beta=100.0 # Common Emitter D.C. Current gain
Ie=10.0 # Emitter current in mili ampere
#Calculations
alfa= (Beta/(Beta+1)) # Common Base D.C. Current gain
Ic= alfa*Ie # Collector current in milli ampere
Ib=Ie-Ic # Base Current in milli ampere
#Result
print("collector current (in mA) = %.2f"%Ic)
print("base current (in mA) = %.2f"%Ib)
# Answer in the book is wrong
# Calculate Common Emitter D.C. Current gain
import math
#Variable Declaration
alfa=0.950 # Common base D.C. Current gain
#Calculations
beta= (alfa/(1-alfa))
#Result
print("Common Emitter D.C. Current gain = %.f"%beta)
# Calculate Common Base D.C. Current gain
import math
#Variable Declaration
Beta=100.0 #Common emitter D.C. Current gain
#Calculations
alfa= (Beta/(1+Beta))
#Result
print("Common Base D.C. Current gain = %.2f"%alfa)
# Calculate base current and collector current
import math
#Variable Declaration
Beta=100 # Common Emitter D.C. Current gain
Ie=10.0 # Emitter current in mili ampere
#Calculation
Ib=(Ie/(1+Beta)) # Emitter current in mili amperen mA
Ic= Ie-Ib # Collector current in mili amperen mA
#Result
print("Base current (in mA) = %.3f"%Ib)
print("Collector current (in mA) = %.3f"%Ic)
#Answer in the book is incorrect
# Calculate the collector to emitter voltage(Vce) and Collector current (Ic)
import math
#Variable Declaration
Vcc= 12.0 # as Ic=0 so Vce=Vcc (In volts)
Rc= 3.0 # Collector Resistance in killo oms
#Calcuations
Ic=Vcc/Rc # Collector Current in Amperes
Vce=Vcc
#Result
print("Colletor to emitter voltage (in volts) = %.f"%Vce)
print(" Collector current (in mA) = %.f"%Ic)
# Calculate oerating point
import math
#Variable Declaration
Vcc= 6.0 # Colector voltage in volts
Rb= 530.0 # in kilo ohms
Beta=100.0 # Common emitter D.C. Current gain
Rc=2.0 # Collector resistance in killo ohms
Vbe= 0.7 # Base to emitter voltage in volts
#Calculations
Ib= ((Vcc-Vbe)/Rb) # in micro amperes
Ic=Beta*Ib # in milli ampere
Vce= Vcc-(Ic*Rc) # Colector to emitter voltage in volts
#Result
print("Operating point is (Vce,Ic):")
print("Vce = %.f V\t Ic = %.f micro-A"%(Vce,Ic))
# Calculate stability factor
import math
#Variable Declaration
Beta=100.0 # Common emitter D.C. Current gain
#Calculations
S=1+Beta
#Result
print("The Stability factor = %.f"%S)
# Calculate base current
import math
#Variable Declaration
Vcc=20.0 # Colector voltage in volts
Rb= 200.0 # in kilo ohms
Beta=75.0 # Common emitter D.C. Current gain
Rc=0.8 # Collector resistance in killo ohms
Vbe= 0.0 # Base to emitter voltage in volts
#Calcualtions
Ib=Vcc/Rb
#Result
print("Base current in micro-A = %.1f"%(Ib*10**3))
# Calculate collector current
import math
#Variable Declaration
Vcc=20.0 # Colector voltage in volts
Rb= 200.0 # in kilo ohms
Beta=75.0 # Common emitter D.C. Current gain
Rc=0.8 # Collector resistance in killo ohms
Vbe= 0.0 # Base to emitter voltage in volts
Ib=0.1 # Base current in mA
#Cacualtions
Ic=Beta*Ib # Collector current in mA
#Result
print("Collector current in mA = %.1f"%Ic)
# Calculate collector TO emitter voltage
import math
#Variable Declaration
Vcc=20.0 # Colector voltage in volts
Rb= 200.0 # in kilo ohms
Beta=75.0 # Common emitter D.C. Current gain
Rc=0.8 # Collector resistance in killo ohms
Vbe= 0.0 # Base to emitter voltage in volts
Ib=0.1 # Base current in mA
Ic=7.5 # Base current in mA
#Calculations
Vce=Vcc- (Ic*Rc)
#Result
print("Collector to emitter voltage in volts = %.f"%Vce)
# Calculate collector TO emitter voltage
import math
#Variable Declaration
Vcc=20.0 # Colector voltage in volts
Rb= 200.0 # in kilo ohms
Beta=75.0 # common emitter D.C. Current gain
Rc=0.8 # Collector resistance in killo ohms
Vbe= 0.0 # Base to emitter voltage in volts
#Calculations
S=1+Beta
#Resut
print("The Stability factor = %.f"%S)
# Calculate base resistance , Voltage between collector & ground and Stability factor
import math
#Variable Declaration
Vcc=12.0 # Colector voltage in volts
Ib= 0.3 # in mili ampere
Beta=100.0 # Common emitter D.C. Current gain
Rc=0.3 # Collector resistance in killo ohms
#Calaculations
Rb=Vcc/Ib
Ic= Beta*Ib
Vce=Vcc -(Ic*Rc)
S=1+Beta
#Result
print("Base resistance in killo ohms = %.f"%Rb)
print("Collector to ground voltgae in volts = %.f"%Vce)
print("The Stability factor = %.f"%S)
# Calculate base current , Collector current and Collector to emitter voltage
import math
#Variable Declaration
Vcc=20.0 # Colector voltage in volts
Rb= 400.0 # in KILLO OHMS
Beta=100.0 # Common emitter D.C. Current gain
Rc=2.0 # Collector resistance in killo ohms
Re=1.0 # Emitter resistance in killo ohms
#Calcualtions
Ib= Vcc / (Rb + (Beta*Re))
Ic= Beta*Ib
Vce=Vcc -(Ic*(Rc+Re))
#Result
print("Base current in mA = %.2f"%Ib)
print("Collector current in mA = %.f"%Ic)
print("Collector to ground voltgae in volts = %.f"%Vce)
# Calculate Collector current and Collector to emitter voltage
import math
#Variable Declaration
Vcc=25.0 # Colector voltage in volts
Vbe=0.7 # Base to emitter voltage in volts
Rb= 180.0 # in KILLO OHMS
Beta=80.0 # Common emitter D.C. Current gain
Rc=0.82 # Collector resistance in killo ohms
Re=0.2 # Emitter resistance in killo ohms
#Calculations
Ic= (Vcc-Vbe)/(Re + (Rb/Beta))
Ic = math.floor(Ic*10)/10
Vce=Vcc -(Ic*(Rc+Re))
#Result
print("Collector current in mA = %.1f"%Ic)
print("Collector to ground voltgae in volts = %f"%Vce)
#Answer for Vce is incorrect in the book
# Calculate Collector current , Collector to emitter voltage and stability factor
import math
#Variable Declaration
Vcc=20.0 # Colector voltage in volts
Vbe=0.7 # Base to emitter voltage in volts
Rb= 200.0 # in KILLO OHMS
Beta=100.0 # Common emitter D.C. Current gain
Rc=20.0 # Collector resistance in killo ohms
#Calculations
Ic= (Vcc-Vbe)/(Rc + (Rb/Beta));
Vce=Vcc -(Ic*Rc);
S=(1+Beta)/(1+Beta*(Rc/(Rc+Rb)));
#Result
print("Collector current in mA = %.3f"%Ic)
print("Collector to ground voltgae in volts = %.2f"%(math.ceil(Vce*100)/100))
print("The Stability factor = %.3f"%S)
# Calculate base current , Collector current , Collector to emitter voltage and stability factor
import math
#Variable Declaration
Vcc=10.0 # Colector voltage in volts
Vbe=0.0 # Base to emitter voltage in volts
Rb= 100.0 # in KILLO OHMS
Beta=100.0 # Common emitter D.C. Current gain
Rc=10.0 # Collector resistance in killo ohms
#Calcualtions
Ib= (Vcc-Vbe)/(Rb+ Beta*Rc)
Ic= Beta * Ib
Vce=Vcc -(Ic*Rc)
S=(1.0+Beta)/(1.0+Beta*(Rc/(Rc+Rb)))
#Result
print("base current = %.f micro-A"%(Ib*1000))
print("Collector current = %.1f mA"%Ic)
print("Collector to ground voltgae = %.1f V"%(math.ceil(Vce)))
print("The Stability factor = %.3f"%S)
#Answer for stability is wrong in the book
# Calculate emitter current , Collector current and Collector to emitter voltage
import math
#Variable Declaration
Vcc=10.0 # Colector voltage in volts
Vbe=0.7 # Base to emitter voltage in volts
Vee=10.0 # emitter voltage in volts
Rb= 50.0 # in KILLO OHMS
Beta=100.0 # Common emitter D.C. Current gain
Rc=1.0 # Collector resistance in killo ohms
Re=5.0 # Emitter resistance in killo ohms
#Calculations
Ie= (Vee-Vbe)/Re
Ic= Ie
Vce1=Vcc -(Ic*Rc)
Ve=-Vbe
Vce=Vce1-Ve
#Result
print("Emitter Current in mA = %.2f"%Ie)
print("Collector current in mA = %.2f"%Ic)
print("Collector to ground voltgae in volts = %.2f"%Vce)
# Calculate the change in q point
import math
#Variable Declaration
Vcc=20.0 # Colector voltage in volts
Vbe1=0.7 # Base to emitter voltage in volts
Vee=20.0 # emitter voltage in volts
Rb= 10.0 # in KILLO OHMS
Beta1=50.0 # Common emitter D.C. Current gain
Rc=5.0 # Collector resistance in killo ohms
Re=10.0 # Emitter resistance in killo ohms
Vbe2=0.6 # Base to emitter voltage in volts
Beta2=100.0 # Common emitter D.C. Current gain
#Calculation
Ie1= (Vee-Vbe1)/(Re+(Rb/Beta1))
Ic1=Ie1
Vce1a=Vcc -(Ic1*Rc)
Ve=-Vbe1
Vce1=Vce1a-Ve
Vce1 = math.ceil(Vce1*100)/100
Ie2= (Vee-Vbe2)*10**3/(Re*10**3+(Rb*10**3/Beta2))
Ie2 = math.ceil(Ie2*1000)/1000
Ic2=Ie2
Vce2a=Vcc -(Ic2*Rc)
Ve=-Vbe2
Vce2=Vce2a-Ve
detaIc= ((Ie2-Ie1)/Ie1)*100
detaVce=((Vce1-Vce2)/Vce1)*100
#Result
print("Emitter Current in first case,Ie = %.3f mA"%Ie1)
print("Collector-to-emitter voltgae in first case,Vce = %.2f V"%Vce1)
print("Emitter Current in second case, Ie = %.3f mA"%Ie2)
print("Collector-to-emitter voltgae in 2nd case, Vce = %.3f V"%Vce2)
print("Change in collector current = %.2f%%"%(math.ceil(detaIc*100)/100))
print("Change in collector to emitter voltage = %.2f%%"%detaVce)
# Calculate dynamic input resistance
import math
#Variable Declaration
deltaVbe=200.0 # in milli volts
deltaIe=5.0 # in milli ampere
#Calculations
Ri=deltaVbe/deltaIe
#Result
print("Dyanamic input resistance is (in ohms) = %.f"%Ri)
# Transistor parameters
import math
#Variable Declaration
Vcc=15.0 # Colector voltage in volts
Rb= 180.0 # in kilo ohms
Beta=100.0 # Common emitter D.C. Current gain
Rc=1.5 # Collector resistance in killo ohms
Vbe= 0.7 # Base to emitter voltage in volts
#Calculations
Ib= ((Vcc-Vbe)/Rb) # in milli amperes
Ic=Beta*Ib # in milli ampere
Vce= Vcc-(Ic*Rc) # Colector to emitter voltage in volts
Vc=Vce
Vb=Vbe
Vcb=Vc-Vb
#Result
print("base current = %.2f micro-A "%(Ib*10**3))
print("Collector current = %.2f mA"%Ic)
print("Collector to emitter voltage = %.1f V"%Vce)
print("Collector voltage = %.1f V"%Vc)
print("Base voltage = %.1f V"%Vb)
print("Collector to base voltage = %.1f V"%Vcb)
# Operating point , stability factor
import math
#Variable Declaration
Vcc=10.0 # Colector voltage in volts
Rb= 930.0 # in kilo ohms
Beta=100.0 # Common emitter D.C. Current gain
Rc=4.0 # Collector resistance in killo ohms
Vbe= 0.7 # Base to emitter voltage in volts
Ib= ((Vcc-Vbe)/Rb)# in milli amperes
Ic=Beta*Ib # in milli ampere
Vce= Vcc-(Ic*Rc) # Colector to emitter voltage in volts
S=(1+Beta)
#Result
print("Collector to emitter voltage In Volts = %.f"%Vce)
print("Collector current in milli Ampere = %.f"%Ic)
print("The Stability factor = %.f"%S)
# Base Resistance , stability factor
import math
#Variable Declaration
Vcc=20.0 # Colector voltage in volts
Beta=100.0 # Common emitter D.C. Current gain
Rc=1.0 # Collector resistance in killo ohms
Vce=4.0 # Collector to emitter voltage in volts
#Calculations
Ic= ((Vcc-Vce)/Rc) # in milli amperes
Ib=Ic/Beta # in milli ampere
Rb=Vce/Ib # in Killo ohms
x = math.floor((1+Beta*(Rc/(Rc+Rb)))*100)/100
S=math.floor((1+Beta)*100/x)/100
#Result
print("Base resistance = %.f k-ohm"%Rb)
print("The Stability factor = %.2f"%S)
# Quiescent , stability factor
import math
#Variable declaration
Vcc=10.0 # Colector voltage in volts
Beta=50.0 # Common emitter D.C. Current gain
Rc=2.0 # Collector resistance in killo ohms
Rb= 100.0 # in kilo ohms
Vbe=0.0 # Base to emitter voltage in volts
#Calculations
Ic= (Vcc-Vbe)/(Rc+(Rb/Beta)) # in milli amperes
Ib=Ic/Beta # in milli ampere
Vce= Vcc-(Ic*Rc) # Colector to emitter voltage in volts
S=(1+Beta)/(1+((Beta*Rc)/(Rc+Rb)))
#Result
print("Operating point is (Vce,Ic): ")
print("Colector to emitter voltage = %.f V"%Vce)
print("Collector current = %.1f mA"%Ic)
print("The Stability factor = %.2f"%S)
#Answer for stability factor is wrong in the book
# Collector to emitter bias voltage
import math
#Variable declaration
Vcc=20.0 # Colector voltage in volts
Beta=100 # Common emitter D.C. Current gain
Rc=2.0 # Collector resistance in killo ohms
Rb= 100.0 # in kilo ohms
Vbe=0.7 # Base to emitter voltage in volts
Ic=10.0 # in milli amperes
#Calculations
Ib=Ic/Beta # in milli ampere
Vce= Vbe+(Ib*Rb) # Colector to emitter voltage in volts
#Result
print("Colector to emitter bias voltage = %.1f V"%Vce)
# Base Currecnt ,Collector current
import math
#Variable declaration
Icbo=0.0 # collecttor to base leakage current
Vcc=9.0 # Colector voltage in volts
Beta=100.0 # Common emitter D.C. Current gain
Vce=5.0 # Collector to emitter voltage in volts
Ic=0.2 # in milli amperes
Rc=(Vcc-Vce)/Ic # Collector Reesistance in ohms
Ib=Ic/Beta # in milli ampere
Rb=Vce/Ib # Base resistance in ohms
#Result
print("Collector Resistance = %.f ohm"%Rc)
print("Base Resistance = %.1f k-ohm"%(Rb/1000))
# Base Resistance , stability factor
import math
#Variable declaration
Vcc=24.0 # Colector voltage in volts
Beta=45.0 # Common emitter D.C. Current gain
Rl=10.0 # Collector resistance in killo ohms
Re=0.27 # Emitter resistance in killo ohms
Vce=5 # Collector to emitter voltage in volts
Vbe=0.6 # Base to emitter voltage in volts
#Calculations
Ib=(Vcc-Vce)/((1+Beta)*(Rl+Re)) # in milli ampere
Ic=Ib/Beta # in micro ampere
R=(Vce-Vbe)/Ib # Resistance in killo ohms
x = math.floor((1+Beta*(Re/(Re+R)))*100)/100
S=(1+Beta)/x
#Result
print("Base resistance = %.f k-ohm"%(math.ceil(R)))
print("The Stability factor = %.2f"%S)
# Quiescent , stability factor
import math
#Variable declaration
Vcc=16.0 # Colector voltage in volts
alfa=0.985
Rc=3.0 # Collector resistance in killo ohms
Re= 2.0 # in kilo ohms
R1= 56.0 # in kilo ohms
R2= 20.0 # in kilo ohms
Vbe=0.3 # Base to emitter voltage in volts
#Calculations
Beta= round(alfa/(1-alfa))
Vb=Vcc * (R2/(R1+R2)) # vOLTAGE AT BASE
Vb = math.floor(Vb*100)/100
Ic= (Vb-Vbe)/Re # in milli amperes
Ib=Ic/Beta # in milli ampere
Vce= Vcc-(Ic*(Rc+Re)) # Colector to emitter voltage in volts
Rth=math.floor((R1*R2)*100/(R1+R2))/100
S=((1+Beta)*(1+(Rth/Re)))/(1+Beta+(Rth/Re))
#Result
print("Operating point is (Vce,Ic): ")
print("Colector to emitter voltage = %.3f V"%Vce)
print("Collector current = %.3f mA"%Ic)
print("The Stability factor = %.2f"%S)
#Answer for Ic is wrong and hence the Vce. Also answer for stability factor is wrong.
# Find R1,R2 & Re
import math
#Variable declaration
Vcc=10.0 # Colector voltage in volts
Beta=50.0 # Common emitter D.C. Current gain
Rc=2.0 # Collector resistance in killo ohms
Vce=4.0 # Collector to emitter voltage in volts
Vbe=0.3 # Base to emitter voltage in volts
Ic=2.0 # Collector current in milli Ampere
#Calculations
Ib=Ic/Beta # Base current in milli ampere
I1=10*Ib
Ie=Ic # Emitter current in mili ampere
Re=(Vcc-Ic*Rc-Vce)/Ic# Emiier Resistance
V2=Vbe+Ic*Re # Voltage across R2
R2=V2/I1
R1=25-R2
#Result
print("Resistance, R1 = %.2f k-ohm"%R1)
print("Resistance, R2 = %.2f k-ohm"%R2)
print("Emitter Resistance, Re = %.1f k-ohm"%Re)
#Answer for R2 is wrong in the book
# Find R
import math
#Variable declaration
Vcc=24.0 # Colector voltage in volts
Beta=45.0
Rc=10.0 # Collector resistance in killo ohms
Re= 0.27 # in kilo ohms
Vce=5.0 # Collector to emitter voltage in volts
Vbe=0.6 # Base to emitter voltage in volts
#Calculations
Ib=(Vcc-Vce)/((1+Beta)*(Rc+Re))
Ic=Ib/Beta
R=(Vce-Vbe)/Ib
#Result
print("Base resistance = %.f k-ohm"%(math.ceil(R)))
# Ic,Vce
import math
#Variable declaration
Vcc=22.0 # Colector voltage in volts
Beta=40.0
Rc=10.0 # Collector resistance in killo ohms
Re= 1.5 # in kilo ohms
R1= 40.0 # in kilo ohms
R2= 4.0 # in kilo ohms
Vbe=0.5 # Base to emitter voltage in volts
#Calculations
Vb=Vcc * (R2/(R1+R2)) # VOLTAGE AT BASE
Ic= (Vb-Vbe)/Re # in milli amperes
Ib=Ic/Beta # in milli ampere
Vce= Vcc-(Ic*(Rc+Re)) # Colector to emitter voltage in volts
#Result
print("Colector to emitter voltage = %.1f V"%Vce)
print("Collector current = %.f mA"%Ic)
#Answer for Vce is wrong in the book
# Voltage across Re
import math
#Variable declaration
Vcc=20.0 # Colector voltage in volts
Beta=50.0
R1= 60.0 # in kilo ohms
R2= 30.0 # in kilo ohms
Vbe=0.6 # Base to emitter voltage in volts
#Calculations
Vb=Vcc * (R2/(R1+R2))
Ve=Vb-Vbe
#Result
print("voltage across Re = %.2f V"%Ve)
# Voltage across Re
import math
#Variable declaration
Vcc=10.0 # in volts
Rb=200.0 # Base resistance in killo ohms
Vbe=0.8 # Base to emitter voltage in volts
Beta=100.0
Vce=0.2 # Collector to emitter voltage in volts
#Calculations
Ib=5/Rb # Base current in milli ampere
Ic=Beta*Ib # Collector current in milli ampere
Rc= (Vcc-Vce)/Ic # Resistance
#Result
print("Collector resistance = %.2f k-ohm"%Rc)
#Cut off,Vc & Re
import math
#Variable declaration
Vcc=10.0 # in volts
Rc=3.0 # Collector resistance in killo ohms
Rl=0.5 # in kilo ohms
Rb=7.0 # in kilo ohms
Beta=100.0 # Common emitter D.C. Current gain
Vbe=0.8 # Base to emitter voltage in volts
Ic=2.78 # in mA Applying KVL
Ib=0.1 # in mA Applying KVL
#Calcualtions
Ibmin=Ic/Beta
Vc=Vbe # in saturation region
Vce=Vc-Rl*(Ic+Ib)
Re=((Vcc-Vce)/Ic)-Rc
#Result
print("Base current = %.1f mA"%Ib)
print("Minimum Base current = %.4f mA"%Ibmin)
print("\nAs Base current is more than minimum base current so it is in saturation region")
print("\nEmitter resistance = %.f ohm"%(Re*1000))
# Beta ,Vcc & Rb
import math
#Variable declaration
Rc=2.7 # Collector resistance in killo ohms
Re=0.68 # Collector resistance in killo ohms
Ib=0.02 # Base Current in mA
Vce=7.3 # Collector to emitter voltage in volts
Vbe=0.0 # Base to emitter voltage in volts
Ve=2.1 # Emitter Voltage
#Calculations
Ie= Ve/Re # Emiiter Current in mA
Ic=Ie
Beta=Ic/Ib # Common emitter D.C. Current gain
Vcc= Vce+Ic*(Rc+Re) # Supply Voltage
Vcc = math.floor(Vcc*10)/10
Rb=(Vcc-Ve)/Ib # Base resistance in Killo ohms
#Result
print("Common emitter D.C. Current gain (unitless) = %.f"%Beta)
print("Supply Voltage = %.1f V"%Vcc)
print("base resistance = %.f k-ohm"%Rb)
# Ic & Vce
import math
#Variable declaration
Vcc=18 # Colector voltage in volts
Rc=2.2 # Collector resistance in killo ohms
Rb=510.0 # Base resistance in killo ohms
Re=1.8 # Emitter resistance in killo ohms
Beta=90.0 # Common emitter D.C. Current gain
#Calculations
Ib=Vcc/(Rb+Beta*(Rc+Re)) # Base Current in mA
Ib = math.floor(Ib*100)/100
Ic=Beta*Ib # Collector current in mA
Beta=Ic/Ib # Common emitter D.C. Current gain
Vce= Ib*Rb # Collector to emitter voltage in volts
#Result
print("Colector to emitter voltage, Vce = %.1f V"%Vce)
print("Collector current, Ic = %.1f mA"%(math.floor(Ic*10)/10))
# Base current
import math
#Variable declaration
Ie=10.0 # Emitter current in mA
Ic=9.95 # Collector current in mA
#Calcualtions
Ib=Ie-Ic # Base Current in mA
#Result
print("Base Current = %.2f mA"%Ib)
# Ic,Vc,Ve & Vce
import math
#Variable declaration
Vcc=30.0 # Colector voltage in volts
Beta=100.0
Rc=6.2 # Collector resistance in killo ohms
Re=1.5 # Emitter resistance in killo ohms
Rb=690.0 # Base resistance in killo ohms
Vbe=0.7 # Base to emitter voltage in volts
Ib= (Vcc-Vbe)/(Rb+(1+Beta)*Rc+(1+Beta)*Re)
Ic=math.ceil(Ib*Beta) # in milli ampere
Ie=Ib*(1+Beta) # in milli ampere
Vce=Vcc-Ve-(Ic+Ib)*Rc
Vce = math.ceil(Vce*100)/100
Vc=Vce+Ve
print("Collector current, Ic = %.f mA"%Ic)
print("emitter voltage, Ve = %.2f V"%Ve)
print("Colector to emitter voltage, Vce = %.2f V"%Vce)
print("collector voltage = %.2f V"%Vc)
# R1,Rc & S
import math
#Variable declaration
Vcc=16.0 # Colector voltage in volts
alfa=0.985
Ieq=2.0 # Emiier current in mA
R2=30.0 # resistance in killo ohms
Re=1.0 # Emitter resistance in killo ohms
Vbe=0.2 # Base to emitter voltage in volts
Vceq=6.0 # Collector to emitter voltage in volts
#Calculations
Beta= alfa/(1-alfa)
Icq=alfa*Ieq
Rc=(Vcc-Vceq-Ieq*Re)/Icq
Ir1=((Ieq*Re+Vbe)/R2)+Icq/Beta
R1=(Vcc-Vbe-(Ieq*Re))/Ir1
Rb= (R1*R2)/(R1+R2)
S=(1+Beta)/(1+Beta*(Re/(Re+Rb)))
#Result
print("Collector resistence, Rc = %.2f k-ohm"%Rc)
print("Resistance, R1 = %.2f k-ohm"%(math.floor(R1*100)/100))
print("The Stability factor = %.2f"%(math.floor(S*100)/100))
# baising component
import math
#Variable declaration
Vcc=12.0 # Colector voltage in volts
Beta=180.0
Ieq=2.0 # Emiier current in mA
Rc=1.0 # Collector resistance in killo ohms
Vbe=0.6 # Base to emitter voltage in volts
Vceq=6.0 # Collector to emitter voltage in volts
#Calculations
Ic= (Vcc-Vceq)/Rc
Ib=Ic/Beta
Rb=(Vcc-Vbe)/Ib
#Result
print("Collector current in fixed bias case = %.f mA"%Ic)
print("Base current in fixed bias case = %.2f mA"%(Ib*10**3))
print("Base resistance in fixed bias case = %.f k-ohm"%Rb)
# baising component
import math
#Variable declaration
Vb=1.6 # Base voltage
Ve=1.0 # emitter voltage
Vcc=12.0 # Collector voltage in volts
Beta=180.0
Ieq=2.0 # Emiier current in mA
Rc=1.0 # Collector resistance in killo ohms
Vbe=0.6 # Base to emitter voltage in volts
Vceq=6.0 # Collector to emitter voltage in volts
#Calculations
Ic= (Vcc-Vceq-Ve)/Rc
Ib=math.ceil(Ic*10**5/Beta)*1000/10**5
Ie=Ic+Ib*10**-3 # emitter current in milli ampere
Re= (Ve/(Ie*10**-3)) # emitter resistance in killo ohms
Ir2= 10*Ib
R2= (Ve+Vbe)/(Ir2*10**-6)
Ir1=Ir2+Ib
R1=((Vcc-Vb)/(Ir1*10**-3))
#Result
print("Emitter Current, Ie = %.3f mA"%(math.floor(Ie*1000)/1000))
print("Resistance, Re = %.1f ohm"%(Re))
print("Resistance, R1 = %.2f k-ohm"%(R1))
print("Resistance, R2 = %.1f ohm"%(R2))
# Stability factor
import math
#Variable declaration
Beta=180.0 # Common emitter D.C. Current gain
Re=1.0 # Collector resistance in killo ohms
R1=5.76 # resistance in killo ohms
R2=34.67 # resistance in killo ohms
#Calculations
S=1+Beta
#Result
print("Stability factor in fixed bias case is %.f"%S)
# Stability factor
import math
#Variable declaration
Beta=180.0 # Common emitter D.C. Current gain
Re=0.199 # Collector resistance in killo ohms
R1=5.76 # resistance in killo ohms
R2=34.67 # resistance in killo ohms
#Calculations
Rb=math.floor((R1*R2)*100/(R1+R2))/100
S=(1+Beta)/(1+(Beta*(Re/(Re+Rb))))
#Result
print("Stability factor in self bias case is %.2f"%S)
# Stability factor
import math
#Variable declaration
R1=500.0 # Resistance in killo ohms
Rc=500.0 # Collector resistance in killo ohms
R2=5000.0 # Resistance in killo ohms
Vcc=20.0 # Colector voltage in volts
Beta=75.0
Rc=6.2 # Collector resistance in killo ohms
Re=90.0 # Emitter resistance in ohms
Rb=690.0 # Base resistance in killo ohms
Vbe=0.7 # Base to emitter voltage in volts
#Calculations
Rb=((R1*R2)/(R1+R2))
Vb=Vcc * (R1/(R1+R2))# VOLTAGE AT BASE
Icbo=0.02 # Collector to base leakage current in mA
Sre= (Beta/(Rb+Re*Beta)**2)*(Icbo*10**-6*Rb-Beta*(Vb+Rb*Icbo*10**-6-Vbe))
#Result
print("Stability factor = %.3f * 10^-4 A/ohms"%(Sre*10**4))
# Change in Icq
import math
#Variable declaration
R1=500.0 # Resistance in killo ohms
Rc=500. # Collector resistance in killo ohms
R2=5000.0 # Resistance in killo ohms
Vcc=20.0 # Colector voltage in volts
Beta=75.0
Rc=6.2 # Collector resistance in killo ohms
Re=90.0 # Emitter resistance in ohms
Vbe=0.7 # Base to emitter voltage in volts
#Calculations
Rb=((R1*R2)/(R1+R2))
Vb=Vcc * (R1/(R1+R2)) # VOLTAGE AT BASE
Icbo=0.02 # Collector to base leakage current in mA
Sre= (Beta/(Rb+Re*Beta)**2)*(Icbo*10**-6*Rb-Beta*(Vb+Rb*Icbo*10**-6-Vbe))
DeltaRe= 110-90 # Change in ohms
DeltaIcq= Sre*DeltaRe # Change in Icq
#Result
print("Change in Icq = %.3f mA"%(DeltaIcq*1000))
# R1 & R2
import math
#Variable declaration
Vcc=5.0 # Colector voltage in volts
Beta=100.0
Vce=2.5 # Collector to emitter voltage in volts
Vbe=0.6 # Base to emitter voltage in volts
R4=0.3 # Resistance in killo ohms
R2=10.0 # Resistance in killo ohms
Ic=1.0 # Collector current in mA
#Calculations
Vr4=(1+(1/Beta))*Ic*R4
Vcn= Vce-Vr4
R3=(Vcc-Vcn)/Ic
Rb=8.03
R1=(Rb*R2)/(R2-Rb)
#Result
print("Resistance, R1 = %.f k-ohm"%(math.floor(R1)))
print("Base Resistance = %.2f k-ohm"%Rb)
# Re , S
import math
#Variable declaration
Vcc=12.0 # Colector voltage in volts
Beta=50.0
Vce=2.5 # Collector to emitter voltage in volts
Vbe=0.7 # Base to emitter voltage in volts
Re= 2.57 # Emitter resistance in killo ohms
Rc=4.2 # Collector resistance in killo ohms
#Calculation
Ic=14/(Rc+(1+(1/Beta)*Re))
Ib= (6-Vbe-Ic*Re)/Re
DeltaIb= -1 # Change in base Current
S= (1+Beta)/(1+Beta)
#Result
print("Resistance, Re = %.2f k-ohm"%Re)
print("Stability Factor = %.f"%S)
# Icq
import math
#Variable declaration
T2=20.0 # Temperature in degree celsius
T1=0.0 # Temperature in degree celsius
Vcc=15.0 # Colector voltage in volts
Beta=75.0
Vce=2.5 # Collector to emitter voltage in volts
Vbe1=0.7 # Base to emitter voltage in volts
Rb= 50.0 # Emitter resistance in killo ohms
Rc=3.0 # Collector resistance in killo ohms
Re=1.0 # Collector resistance in killo ohms
#Calculation
Ib= ((6-Vbe1)/(Rb+(1+Beta)*Re))*10**3 # Base Current in Micro Amperes
Ic= Beta*Ib*10**-3 # Colectore Current in Milli Ampere
Icbo1=0.5 # Collector to base leakage current in Micrometer
Icbo2=Icbo1*2**((T2-T1)/10) # Collector to base leakage current in Micrometer when temperature 20 degree celsius
Vbe2=Vbe1-2*T2*10**-3 # base to emitter voltage when temperature is 20 degree celsius
Ib1=((6-Vbe2)/(Rb+(1+Beta)*Re))*10**3 # Base Current in Micro Amperes at 20 degree celsius
Ib1 = math.ceil(Ib1*10)/10
Ic1=(Beta*(Ib*10**-3)) # Colectore Current in Milli Ampere
#Result
print("Base Current = %.f micro-A"%Ib)
print("Collector current = %.2f mA"%Ic)
print("Collector to base leakage current when T=20 degree celsius = %.f micro-A"%Icbo2)
print("Base to emitter voltage when T=20 degree celsius = %.2f V"%Vbe2)
print("Base Current when T=20 degree celsius = %.1f micro-A"%Ib1)
print("Collector current when T=20 degree celsius = %.2f mA"%Ic1)
# (a)quiescent current (b) drift in quiescent current
import math
#Variable declaration
Beta1=50.0 # gain at 25 degree celsius temperture
Beta2=200.0 # gain at 75 degree celsius temperture
Rb=1.0 # base resistance in killo ohms
Re=0.1 # emitter resistance in ohms
Ico1=0.01 # leakage current at 25 degree celsius temperture in micro ampere
Ico2=0.045 # leakage current at 75 degree celsius temperture in micro ampere
Vbe1=0.7 # base to emitter voltage 25 degree celsius temperture in micro ampere
Vbe2=0.575 # base to emitter voltage 75 degree celsius temperture in micro ampere
#Calculations
dBeta=Beta2-Beta1 # Change in gain
dIco=Ico2-Ico1 # change in leakage current
dVbe=Vbe2-Vbe1 # change in base to emitter voltage
Ib= (1-Vbe1)/(Rb+(1+Beta1)*Re) # Base current in micro ampere
Ic=Beta1*Ib # Collector current in milli ampere
S=((1+Beta1)*(1+(Rb/Re)))/(1+Beta1+(Rb/Re))
S1=-(Beta1/Re*10**-3)/(1+Beta1+(Rb/Re)) # stability factor
S2=(S*Ic*10**-3)/(Beta1*(1+Beta1)) # stability factor
dIc= ((S*dIco*10**-6)+(S1*dVbe)+(S2*dBeta))*10**3
Icn= Ic+dIc # new collector current in milli ampere
#Result
print("Quiescent current is %.2f mA"%Ic)
print("Quiescent current drift at temperature 75 degree celsius is %.3f mA"%dIc)
print("New quiescent current is %.1f mA"%Icn)
# R1,R2 ,Re
import math
#Variable declaration
Vbe=0.2
Vcc=16.0 # collector voltage in volts
Rc=1.5 # clollector resistance in killo ohms
S=12.0 # stability factor
Vce=8.0 # Collector to emitter voltage
Ic=4.0 # in milli amperes
Beta=50.0 # gain
S1=3.0 # REDUCED STABILITY FACTOR
#Calcualtions
Ib=(Ic*10**-3)/Beta # Base current in micro ampere
Re=(Vcc-Vce-(Rc*10**3*Ic*10**-3))/(Ic*10**-3+Ib) # emitter resistance in ohms
Rb=round(((11*(1+Beta))/(Beta-11))*Re*10**-3) # base resistance in killo ohms
Vb= (Ib*Rb*1000)+Vbe+((Ic*10**-3)+(Ib*10**-6))*Re# voltage is R2
R1=Vcc*Rb/2.76 #Vb = 2.76 # resistance in killo ohms
R1= math.ceil(R1*10)/10
R2=R1*Rb/(R1-Rb) # RESISTANCE IN KILLO OHMS
#Result
print("Emitter Resistance,Re = %.2f k-ohm"%(Re*10**-3))
print("Resistance, R1 = %.1f k-ohm"%R1)
print("Resistance, R2 = %.2f k-ohm"%(math.floor(R2*100)/100))
# R1,R2 ,Re
import math
#Variable declaration
Vbe=0.2
Vcc=16.0 # collector voltage in volts
Rc=1.5 # clollector resistance in killo ohms
S=12.0 # stability factor
Vce=8.0 # Collector to emitter voltage
Ic=4.0 # in milli amperes
Beta=50.0 # gain
Ib=(Ic*10**-3)/Beta # Base current in micro ampere
S1=3.0 # REDUCED STABILITY FACTOR
#Calcualtions
Re=(Vcc-Vce-(Rc*10**3*Ic*10**-3))/(Ic*10**-3+Ib) # emitter resistance in ohms
Rb=math.floor(((2*(1+Beta))/(Beta-2))*Re*10**-3) # base resistance in killo ohms
Vr2= Vbe+(Ic+Ib*10**3)*Re*10**-3 # voltage is R2
R1=math.floor((Rb)/x) # resistance in killo ohms
R2=(Rb*R1)/(R1-Rb) # RESISTANCE IN KILLO OHMS
Rb1=((3*(1+Beta))/(Beta-3))*Re*10**-3 # EFFECT OF REDUCING STABILITY FACTOR ON BASE RESISTANCE
#Result
print("Emitter Resistance = %.2f k-ohm"%(Re*10**-3))
print("Resistance, R1 = %.f k-ohm"%R1)
print("Resistance, R2 = %.2f k-ohm"%(math.floor(R2*100)/100))
# R1,R2 ,Re
import math
#Variable declaration
Vbe=0.2
Vcc=20.0 # collector voltage in volts
Rc=2.0 # clollector resistance in killo ohms
S=10.0 # stability factor
Vce=10.0 # Collector to emitter voltage
Ic=4.0 # in milli amperes
Beta=50.0 # gain
S1=3.0 # REDUCED STABILITY FACTOR
#Calcualtions
Ib=(Ic*10**-3)/Beta # Base current in micro ampere
Re=(Vcc-Vce-(Rc*10**3*Ic*10**-3))/(Ic*10**-3+Ib) # emitter resistance in ohms
Re = math.ceil(Re*10)/10
Rb=math.ceil(((9*(1+Beta))*1000/(Beta-9))*Re*10**-3)/1000# base resistance in killo ohms
Vr2= Vbe+(Ic+Ib*10**3)*Re*10**-3 # voltage is R2
x=(Vr2/Vcc) # Voltage
R1=(Rb)/x # resistance in killo ohms
R2=(x*R1)/(1-x) # RESISTANCE IN KILLO OHMS
Rb1=((3*(1+Beta))/(Beta-3))*Re*10**-3 # EFFECT OF REDUCING STABILITY FACTOR ON BASE RESISTANCE
#Result
print("Emitter resistance = %.1f ohm"%Re)
print("Resistance R1 = %.2f k-ohm"%R1)
print("Resistance R2 = %.2f k-ohm"%R2)
print("Base resistance effect of reducing stability factor reduces input impedence = %f k-ohm"%Rb1)
#Answer for R1 and base resistor do not match with the book
# R1,R2 ,Re
import math
#Variable declaration
S=2.0 # stability factor
Vbe=0.8
Vcc=20.0 # collector voltage in volts
Rc=5.0 # collector resistance in killo ohms
Vce=11.5 # Collector to emitter voltage
Ic=1.5 # in milli amperes
Beta=50.0 # gain
#Calculations
Ib=(Ic*10**-3)/Beta # Base current in micro ampere
Re=(Vcc-Vce-(Rc*10**3*Ic*10**-3))/(Ic*10**-3+Ib)# emitter resistance in ohms
Rb=(((1+Beta))/(Beta-1))*Re # base resistance in killo ohms
Vr2= Vbe+(Ic+Ib*10**3)*Re*10**-3 # voltage is R2
x=(Vr2/Vcc) # Voltage
R1=math.floor(((Rb)/x)*10**-3*100)/100 # resistance in killo ohms
R2=((x*R1)/(1-x))*10**3 # RESISTANCE IN KILLO OHMS
#Result
print("Emitter resistance = %.1f ohm"%(Re))
print("Resistance R1 = %.2f k-ohm"%R1)
print("Resistance R2 = %.1f k-ohm"%R2)
# Ai,Ri,Av
import math
#Variable declaration
Rs=800.0 # Internal resistance in ohms
Rl=1000.0 # Load resistance in ohms
# H-paramters are
Hie=1.0 # in killo ohms
Hre=2*10**-4
Hfe=50
Hoe=25*10**-6 # in ampere per volt
#Calcualtions
Ai= -Hfe/(1+Hoe*Rl) # Current gain
Ri= Hie*10**3-((Hfe*Hre)/(Hoe+(1/Rl))) # Input resistance in ohms
Ri = math.floor(Ri*100)/100
Av= Ai*(Rl/Ri) # Voltage Gain
#Result
print("Current gain = %.2f"%Ai)
print("Input resistance = %.2f ohm"%Ri)
print("Voltage gain = %.2f"%Av)
# Ai,Ri,Av,Ro
import math
#Variable declaration
Rl=1.2*10**3 # Load resistance in ohms
# H-paramters are
Hib=28.0 # in ohms
Hrb=5*10**-4
Hfb=-0.98
Hob=0.34*10**-6 # in ampere per volt
#Calculations
Ai= -Hfb/(1+Hob*Rl) # Current gain
Ai = math.ceil(Ai*100)/100
Ri= Hib+(Hrb*Ai*Rl) # Input resistance in ohms
Av= round(Ai*(Rl/Ri)) # Voltage Gain
dh=(Hib*Hob)-(Hrb*Hfb)
Ro=(Hib/dh)*10**-3 # Output resistance in killo ohms
#Result
print("Current gain = %.2f"%Ai )
print("Input resistance = %.1f ohm"%Ri)
print("Voltage gain = %.f"%Av)
print("Ouput resistance = %.f k-ohm"%Ro)
# Ai,Ri,Av,Avs,Ais
import math
#Variable declaration
Rl=1000.0 # Load resistance in ohms
Rs=1200.0 # Internal Resistance
# H-paramters are
Hib=22.0 # in ohms
Hrb=3*10**-4
Hfb=-0.98
Hob=0.5*10**-6 # in ampere per volt
#calculations
Ai= -Hfb/(1+Hob*Rl) # Current gain
Ai = math.ceil(Ai*100)/100
Ri= Hib+(Hrb*Ai*Rl) # Input resistance in ohms
Ri = math.ceil(Ri*10)/10
Av=(Ai*(Rl/Ri)) # Voltage Gain
dh=(Hib*Hob)-(Hrb*Hfb)
Avs=(Av*Ri)/(Ri+Rs) # Overall Voltage gain
Ais=(Ai*Rs)/(Ri+Rs) # Overall Current gain
#Result
print("Current gain = %.2f"%Ai)
print("Input resistance = %.1f ohm"%Ri)
print("Voltage gain = %.3f"%Av)
print("Overall Voltage gain = %.3f"%Avs)
print("Overall Current gain = %.3f"%Ais)
# Ai,Ri,Av,Ro
import math
#Variable declaration
Rl=5000.0 # Load resistance in ohms
Rs=1000.0 # Source internal resistance
R1=10.0 # Resistance in killo ohms
R2=10.0 # Resistance in killo ohms
Re=5*10**3 # Emitter resistance in ohms
# H-paramters are
Hic=2000.0 # in killo ohms
Hrc=1.0
Hfc=-51.0
Hoc=25*10**-6 # in ampere per volt
#Calculations
Ai= -Hfc/(1+Hoc*Rl) # Current gain
Ai = math.floor(Ai*10)/10
Ri= (Hic+(Hrc*Ai*Rl)) # Input resistance in ohms
Ri = Ri/1000 # in Killo ohm
Z1= (R1*R2)/(R1+R2)
Zi=(Ri*Z1)/(Ri+Z1) # input resistance of amplifier stage in killo ohms
Av=round((Ai*(Rl/Ri))*10**-3)# Voltage Gain
Ro=-(Rs+Hic)/Hfc # Output resistance in ohms
Ro = math.floor(Ro*10)/10
Zo= (Ro*Re)/(Ro+Re) # output resistance of amplifier stage in ohms
#Result
print("Current gain = %.1f"%Ai)
print("Input resistance = %.f k-ohm"%(Ri))
print("Voltage gain = %.f"%Av)
print("input resistance of amplifier stage = %.1f k-ohm"%Zi)
print("Output resistance = %.1f ohm"%Ro)
print("output resistance of amplifier stage= %.1f ohm"%Zo)
#Answer for Zo is wrong in the book
# Ai,Ri,Av,Z0
import math
#Variable declaration
R1=20.0 # Resistance in killo ohms
R2=10.0 # Resistance in killo ohms
Rc=5.0 # collector resistance in killo ohms
R=10.0 # resistance in killo ohms
Rs=800.0 # Internal resistance in ohms
# H-paramters are
Hie=1.5 # in killo ohms
Hre=5*10**-3
Hfe=50.0
Hoe=2*10**-6 # in micro ampere per volt
Ai= -Hfe # Current gain
Ri= Hie # Input resistance in ohms
#Calculations
Rl=(Rc*R)/(Rc+R) # Load resistance in killo ohms
Rl= math.floor(Rl*10)/10
Z1= (R1*R2)/(R1+R2)
Zi=(Ri*Z1)/(Ri+Z1) # input resistance of amplifier stage in killo ohms
Av= (Ai*(Rl/Ri))# Voltage Gain
Ro=(1/Hoe) # output resistane in killo ohms
Zo=(Ro*Rl)/(Ro+Rl) # output resistance of amplifier stage in ohms
#Result
print("Current gain = %.f"%Ai)
print("input resistance of amplifier = %.2f k-ohm"%Zi)
print("Voltage gain = %.f"%Av)
print("output resistance of amplifier = %.1f ohm"%Zo)
# Ai,Ri,Av
import math
#Variable declaration
Rs=0.5 # Internal resistance in killo ohms
Rl=5000.0 # Load resistance in ohms
# H-paramters are
Hie=1000.0 # in ohms
Hfe=50.0
Hoe=25*10**-6 # in ampere per volt
#Calculations
Ai= (1+Hfe)/(1+Hoe*Rl)# Current gain
Ai = math.floor(Ai*100)/100
Ri= Hie+(Ai*Rl) # Input resistance in ohms
Ri = math.floor(Ri/100)*100
Av= (Ai*Rl)/Ri # Voltage Gain
#Result
print("Current gain = %.2f"%Ai)
print("Input resistance = %.1f k-ohm"%(Ri/1000))
print("Voltage gain = %.4f"%Av)
# Ai,Ri,Av
import math
#Variable declaration
Rs=1.0 # Internal resistance in ohms
Rl=1600.0 # Load resistance in ohms
# H-paramters are
Hie=1100.0 # in ohms
Hfe=2.5*10**-4
Hoe=25*10**-6 # in ampere per volt
#Calcualtions
Ai= -Hfe/(1+Hoe*Rl) # Current gain
Ri= round(Hie+(Ai*Rl)) # Input resistance in ohms
Av= Ai*(Rl/Ri) # Voltage Gain
Av = math.ceil(Av*10**6)/100
Ai = math.ceil(Ai*10**5)/10
Pg=Ai*Av
#Result
print("Current gain = %.1f * 10^-4"%(Ai))
print("Input resistance = %.f k-ohm"%Ri)
print("Voltage gain = %.2f * 10^-4"%Av)
print("Power gain = %.2f *10^-8"%(math.floor(Pg*100)/100))
# Icq,Vcq
import math
#Variable declaration
Vbe=0.0
Vcc=18.0 # collector voltage in volts
R1=510.0 # resistance in killo ohms
R2=510.0 # resistance in killo ohms
Rc=9.1 # clollector resistance in killo ohms
Re=7.5 # emitter resistance in killo ohms
Rs=1.0 # Internal resistance in ohms
Rl=1600.0 # Load resistance in ohms
# H-paramters are
Hie=1100.0 # in ohms
Hfe=2.5*10**-4
Hoe=25*10**-6 # in ampere per volt
#Calculations
Vb=Vcc * (R2/(R1+R2)) # vOLTAGE AT BASE
Ic= (Vb-Vbe)/Re # in milli amperes
Vce= Vcc-(Ic*(Rc+Re)) # Colector to emitter voltage in volts
Ai= -Hfe/(1+Hoe*Rl) # Current gain
Ri= round(Hie+(Ai*Rl)) # Input resistance in ohms
Av= Ai*(Rl/Ri) # Voltage Gain
#Result
print("Colector to emitter voltage = %.1f V"%Vce)
print("Collector current = %.1f mA"%Ic)
# Av,Ri
import math
#Variable declaration
Vbe=0.0
Vcc=18.0 # collector voltage in volts
R1=510.0 # resistance in killo ohms
R2=510.0 # resistance in killo ohms
Rc=9.1 # clollector resistance in killo ohms
Re=7.5 # emitter resistance in killo ohms
Rs=1.0 # Internal resistance in ohms
Rl=1600.0 # Load resistance in ohms
# H-paramters are
Hie=1.0 # in killo ohms
Hfe=50.0
Hoe=0.0 # in ampere per volt
#Calculations
Vb=Vcc * (R2/(R1+R2)) # VOLTAGE AT BASE
Ic= (Vb-Vbe)/Re # in milli amperes
Vce= Vcc-(Ic*(Rc+Re)) # Colector to emitter voltage in volts
Ai=-Hfe # current gain
Ri=Hie # Input resistance in ohms
Z1= (R1*R2)/(R1+R2)
Zi=(Ri*Z1)/(Ri+Z1) # input resistance of amplifier stage in killo ohms
Av= Ai*(Rc/Ri) # Voltage Gain
#Result
print("input resistance of amplifier stage = %.2f k-ohm"%(math.floor(Zi*100)/100))
print("Voltage gain is %.f"%Av)
# resitive paramters
import math
#Variable declaration
Ic= 5.0 # in milli amperes
Vt=26.0 # voltage
# H-paramters are
hie=1.0 # in killo ohms
hfe=100.0
hoe=4*10**-5 # in ampere per volt
hre=10**-4
#Calculations
gm=math.floor(Ic*1000/Vt)/1000# transconductance
rbe= hfe/gm # in ohms
rbb=hie*10**3-rbe # in ohms
rbc=(rbe/(hre)*10**-6) # in mega ohms
gce1=hoe-(1+hfe)*(1/(rbc*10**6))
rce=(1/gce1)*10**-3 #in killo ohms
#Result
print("transconductance = %.3f mho"%gm)
print("Rbe = %.f ohm"%rbe)
print("Rbb = %.f ohm"%rbb)
print("Rbc = %.2f Mega ohm"%rbc)
print("gce1= %.2f * 10^-5 mho"%(gce1*10**5))
print("Rce = %.1f killo ohm"%rce)
#Answer for Rbe is wrong in the book and hence for Rbb and Rbc
# ressitive paramters
import math
#Variable declaration
Ic= 1.0 # in milli amperes
Vt=26.0 # volatge
ft=80.0 # frequency in mega hertz
Cbc=12 # in pico farad
# H-paramters are
hie=6.0 # in killo ohms
hfe=224.0
#Calculations
gm=Ic/Vt # transconductance
rbe= hfe/gm # in ohms
rbb=hie*10**3-rbe
Cbe= (((gm)/(2*math.pi*ft*10**6))-Cbc*10**-12)*10**12
#Result
print("transconductance = %.2f m-mho"%(gm*1000))
print("Rbe = %.3f k-ohm"%(rbe/1000))
print("Rbb = %.f ohm"%rbb)
print("Cbe = %.1f pF"%Cbe)
# alpha ,beta and cut off frequencies
import math
#Variable declaration
Cbc=12.0 # in pico farad
# H-paramters are
hie=6.0 # in killo ohms
hfe=224.0
gm=38.0 # transconductance
rbe=5.9 # in killo ohms
rbb=100.0 # in ohms
Cbe= 63.0 # in pico farad
#Calculations
falpha= ((hfe)/(2*math.pi*rbe*10**3*Cbe*10**-12))*10**-6
fbeta= ((1)/(2*math.pi*rbe*10**3*(Cbe+Cbc)*10**-12))*10**-6
ft= ((gm*10**-3/(2*math.pi*(Cbe+Cbc)*10**-12)))*10**-6
#Result
print("F_alfa = %.1f MHz"%falpha)
print("F_beta = %.3f MHz"%(math.floor(fbeta*1000)/1000))
print("F_t = %.2f MHz"%(math.floor(ft*100)/100))
# ressitive paramters
import math
#Variable declaration
Ic= 2.6 # in milli amperes
Vt=26.0 # volatge
ft=500.0 # frequency in mega hertz
Cbc=3.0 # in pico farad
rbb=100.0 # in ohms
rbe=1.0 # IN KILLO OHMS
#calculations
gm=Ic/Vt # transconductance
Beta= gm*rbe*10**3
Cbe= (((gm)/(2*math.pi*ft*10**6))-Cbc*10**-12)*10**12
#Result
print("transconductance = %.1f mho"%gm)
print("Cbe = %.2f pF"%Cbe)
#Answer for Cbe is slightly different than book
# h-parameters and hybrid parameters
import math
#Variable declaration
# H-paramters are
hie=1100.0 # in killo ohms
hre=2.5*10**-4
hfe=50.0
hoe=2.5*10**-5 # in ampere per volt
rbb=100.0
#Calculations
hic=hie
hrc=1-hre
hfc=-(1+hfe)
hoc=hoe
hib=(hie/(1+hfe))
hrb= ((hie*hoe)/(1+hfe))-hre
hob=(hoe/(1+hfe))
rbe=(hie-rbb)*10**-3 # in killo ohms
rbc= ((hie-rbb)/hre)*10**-6
gm= ((hfe/(hie-rbb)))
x=hoe-((hfe*hre)/(hie-rbb))
rce=1/(1.25*10**-2)
#Result
print("\nH-parameters for common collector configuration are:")
print("hic = %.f ohm\nhrc = %.f\nhfc = %.f\nhoc = %.1f*10^-5 mho"%(hie,hrc,hfc,hoc*10**5))
print("\nH-parameters for common collector configuration are:")
print("hib = %.2f ohm\nhrb = %.1f*10^4\nhob = %.1f*10^-6 mho"%(hib,hrb*10**4,hob*10**6))
print("\nhybrid pie paramtere are:")
print("rbe(in killo ohms) = %.f\nrbc(mega ohms)\t = %.f\ntransconductance(mho)= %.f\nrce(in killo ohms) = %.f"%(rbe,rbc,gm,rce))
# hybrid parameters
import math
#Variable declaration
Ic= 10.0 # in milli amperes
Vt=26.0 # volatge
ft=500.0 # frequency in mega hertz
Cbc=3.0 # in pico farad
gm=Ic/Vt # transconductance
# H-paramters are
hie=500.0 # in killo ohms
hfe=100.0
hre=0.1
hoe=4*10**-5 # in ampere per volt
#Calculations
rbe=hfe/gm # in ohms
rbc= ((rbe)/hre)*10**-3
x=hoe-((hfe*10**-4)/(rbe))
rce=(1/(x*10**-2))*10**-5
Cbe=(((gm)/(2*math.pi*ft*10**6))*10**13-Cbc)
#Result
print("transconductance = %.3f mho"%gm)
print("(rbe) = %.f ohm"%rbe)
print("(rbc) = %.1f Mega-ohm"%rbc)
print("(rce) = %.f k-ohm"%rce)
print("(Cbe) = %.f pF"%Cbe)
# hybrid parameters
import math
#Variable declaration
Ai=10.0 # current gain
Vce=10.0
Ic= 10.0 # in milli amperes
Vt=26.0 # volatge
f=10.0 # frequency in mega hertz
Cbc=3.0 # in pico farad
gm=Ic/Vt # transconductance
# H-paramters are
hie=500.0 # in ohms
hfe=100.0
#Calculations
rbe= hfe/gm
rbb= hie-rbe
Ft= Ai*f
fb= Ft/hfe
Ce=((gm/(2*math.pi*Ft*10**6))-Cbc*10**-12)*10**12
#Result
print("(gm) = %.1f mS"%(gm*10**3))
print("(rbe) = %.f ohm"%rbe)
print("(rbb) = %.f ohm"%rbb)
print("(ft) = %.f MHz"%Ft)
print("(fb) = %.f MHz"%fb)
print("(Ce) = %.f p-F"%Ce)
# mid band voltage gain and cut off frequency
import math
#Variable declaration
Rs=1.0
ft=500.0 # frequency in mega hertz
Cbc=5.0 # in pico farad
# H-paramters are
hie=500.0
hfe=100.0
rbe= 900.0
rbb= 100.0
Rl=500.0 # load resistance in ohms
#Calculations
gm=hfe/rbe # in mho
Av=((-gm*Rl)) # voltage gain
Avs= ((Av*rbe)/(Rs*10**3+rbb+rbe))
fb= ft/hfe
#Result
print("mid band voltage gain is %.f"%Avs)
print("Fb = %.f MHz"%fb)
# mid band voltage gain and cut off frequency
import math
#Variable declaration
Rs=1.0
ft=500.0 # frequency in mega hertz
Cbc=5.0 # in pico farad
# H-paramters are
gm=100.0 # in mho
hfe=100.0
rbb= 100.0
Rl=500.0 # load resistance in ohms
#Calculations
rbe=hfe/(gm*10**-3)
Av=((-gm*10**-3*Rl))
Avs= ((Av*rbe)/(Rs*10**3+rbb+rbe))
fb= ft/hfe
#Result
print("mid band voltage gain is %.2f"%Avs)
print("Fb = %.f MHz"%fb)
# resonant frequency and voltage drop
import math
#Variable declaration
L=100.0 # in micro henry
C=253.3 # in micro farad
R=15.7 # in ohms
V=0.157
#Calculations
fr=((1/(2*math.pi*math.sqrt(L*10**-6*C*10**-12))))*10**-6 # resonant frequency in mega hertz
Ir=V/R
Vr=V
Vl=Ir*(2*math.pi*fr*10**6*L*10**-6)
Xc= (1/(2*math.pi*fr*10**6*C*10**-12))
Vc= Ir*Xc
Q=((2*math.pi*fr*10**6*L*10**-6)/R)
#Result
print("resonant frequency = %.f MHz"%fr)
print("Voltage drop across resitor = %.3f V"%Vr)
print("Voltage drop across inductor = %.3f V"%Vl)
print("Voltage drop across capacitor = %.3f V"%Vc)
print("Quality factor of coil = %.f"%Q)
# resonant frequency ,impedence,Q-factor,Bnadwidth,line current and resonant frequency
import math
#Variable declaration
V=10.0
L=1.2 # in micro henry
C=200.0 # in micro farad
R=8.0 # in ohms
#Calculations
fr=(1/(2*math.pi))*(math.sqrt((1/(L*10**-3*C*10**-12))-(R**2/(L*10**-3)**2))*10**-3) # resonant frequency in killo hertz
Zr=(L*10**-3)/(C*10**-9*R) # IN KILLO OHMS
Q=((2*math.pi*fr*10**6*L*10**-6)/R)
BW=fr/Q
Ir=(V/Zr)*10**3
fr1=((1/(2*math.pi*math.sqrt(L*10**-3*C*10**-12))))*10**-3 #resonant frequency in mega hertz
#Result
print("resonant frequency = %.3f kHz"%fr)
print("Impedence is %.f k-ohm"%Zr)
print("bandwidth is %.2f kHz"%BW)
print("line current is %.2f micro-A"%Ir)
print("Quality factor of coil is %.1f"%Q)
print("resonant frequency neglecting resistance = %.3f kHz"%(math.floor(fr1*1000)/1000))
# resonant frequency ,impedence,Q-factor,Bnadwidth
import math
#Variable declaration
V=10.0
L=150.0 # in micro henry
C=100.0 # in micro farad
R=5 # in ohms
#Calculations
fr=((1/(2*math.pi*math.sqrt(L*10**-6*C*10**-12))))*10**-3 # resonant frequency in killo hertz
Zr=(L*10**-3)/(C*10**-9*R) # IN KILLO OHMS
Q=((2*math.pi*fr*10**6*L*10**-6)/R)*10**-3
BW=(fr/Q)
#Result
print("resonant frequency = %.1f kHz"%fr)
print("Impedance is %.f k-ohm"%(Zr*10**-3))
print("Quality factor of coil is %.f"%Q)
print("bandwidth = %.1f kHz"%BW)
# Q FACTOR
import math
#Variable declaration
fr=1600.0 # resonant frequency in killo hertz
BW=10.0 # In kill hertz
#Calculations
Qr=fr/BW
#Result
print("value of quality factor is %.f"%Qr)
# Q FACTOR
import math
#Variable declaration
fr=2*10**6 # resonant frequency in hertz
BW=50*10**3 # hertz
#Calcualtions
Qr=fr/BW
#Result
print("value of quality factor is %.f"%Qr)
# parallel impedence
import math
#Variable declaration
fr=455.0*10**3 # resonant frequency in hertz
BW=10.0*10**3 # hertz
Xl=1255.0 # inductive reactance in ohm
#Calculations
Qr=fr/BW
R=Xl/Qr
L=Xl/(2*math.pi*fr)
C=1/(2*math.pi*fr*Xl)
Zp=(L/(C*R))*10**-3
#Result
print("value of quality factor is %.1f"%Qr)
print("resisitance = %.1f ohm"%R)
print("inductance = %.3f * 10^-3 H"%(L*1000))
print("capacitor = %.1f * 10^-12 F"%(C*10**12))
print("parallel impedence = %.f k-ohm"%Zp)