from __future__ import division
Vcc=15
print "Vcc = %0.2f"%(Vcc)," volts" #initialization
VBB=1
print "VBB = %0.2f"%(VBB)," volts" #initialization
VBE=0.7
print "VBE = %0.2f"%(VBE)," volts" #initialization
RB=5*(10**3)
print "resistance,RB = %0.2f"%(RB)+ " ohm" #initialization
RL=650
print "resistance,RL = %0.2f"%(RL)+ " ohm" #initialization
Bf=200
print "Gain,Bf = %0.2f"%(Bf)+ " " #initialization
IB=(VBB-VBE)/RB #Formulae
print "IB =(VBB-VBE)/RB = %0.2e"%(IB)," ampere" #calculation
IC=IB*Bf #Formulae
print "IC =IB*Bf= %0.2f"%(IC)," ampere"#calculation
IE=IB+IC #Formulae
print "IE = IB+IC=%0.2f"%(IE)," ampere"#calculation
VCE=Vcc-IC*RL #Formulae
print "VCE =Vcc-IC*RL= %0.2f"%(VCE)," volts" #calculation
VCB=VCE-VBE #Formulae
print "VCB = VCE-VBE=%0.2f"%(VCB)," volts"#calculation
RB=(Vcc-VBE)/IB #Formulae
print "resistance,RB =(Vcc-VBE)/IB= %0.2e"%(RB)+ " ohm" #calculation
from __future__ import division
Vbe1=0.025
print "Vbe1 = %0.2f"%(Vbe1)," volts" # value of base-emitter voltage1
Vbe2=(-0.025)
print "Vbe2 = %0.2f"%(Vbe2)," volts" # value of base-emitter voltage2
ib1=20*10**(-6)
print "ib1 = %0.2e"%(ib1)," ampere" # value of base current1
ib2=(-20*10**(-6))
print "ib2 = %0.2e"%(ib2)," ampere"# value of base current2
IBQ=60*10**(-6)
print "IBQ = %0.2e"%(IBQ)," ampere" # operating point
ICP=15.5*10**(-3)
print "ICP = %0.2f"%(ICP)," ampere" # initialization
ICR=8.5*10**(-3)
print "ICR = %0.2f"%(ICR)," ampere" # initialization
VCEP=5
print "VCEP = %0.2f"%(VCEP)," volts" # value of collector-emitter voltage1
VCER=9
print "VCER = %0.2f"%(VCER)," volts" # value of collector-emitter voltage2
change_IC=ICP-ICR #change in collector current
print "change_IC = %0.2f"%(change_IC)," ampere"
change_VCE=VCER-VCEP #change in collector voltage
print "change_VCE = %0.2f"%(change_VCE)," volts"
change_VBE=Vbe1-Vbe2
change_IB=ib1-ib2
AV=(change_VCE/change_VBE) #formulae voltage gain
print "AV = %0.2f"%(AV)," "#voltage gain
AI=change_IC/change_IB #formulae current gain
print "AI = %0.2f"%(AI)," "
from math import pi
from __future__ import division
ICQ=12*10**(-3)
print "ICQ = %0.2f"%(ICQ)," ampere" # collector current
B=200
print "B = %0.2f"%(B)," " #BJT gain
Cbe=100*10**(-12)# capacitance
print "capacitance,Cbe = %0.2e"%(Cbe)," F "
VT=26*10**(-3)
print "VT = %0.2f"%(VT)," volts" # thermal voltage
gm=(ICQ/VT) #transconductance
print "gm =(ICQ/VT)= %0.2f"%(gm)," A/V"
hie=B/gm #forward resistance hybrid parameter
print "hie =(B/gm)= %0.2f"%(hie)," ohm"
fT=((1/2)*(gm/Cbe)*(1/pi)) #unity gain frequency formulae
print "fT =((1/2)*(gm/Cbe)*(1/pi))= %0.2e"%(fT)," hertz"
from __future__ import division
VCC=20
print "VCC = %0.2f"%(VCC)," volts" # collector supply voltage
VBB=VCC
RL=5*(10**3)
print "RL= %0.2f"%(RL)+ " ohm" #resistance
RB=965*(10**3)
print "RB = %0.2e"%(RB)+ " ohm" #initialization base resistance
VBE=(0.7)
print "VBE = %0.2f"%(VBE)," volts" # value of base-emitter voltage
BF=50
print "BF = %0.2f"%(BF)," " #BJT gain
ICO=10*10**(-9)
print "ICO = %0.2e"%(ICO)," ampere" # collector reverse bias current
Vi=0
print "Vi = %0.2e"%(Vi)," volts" # value of input
IBQ=(VCC-VBE)/RB #base current as operating point
print "IBQ = %0.2e"%(IBQ)," ampere"
ICQ=BF*IBQ #operating point (collector current)
print "ICQ =BF*IBQ= %0.2e"%(ICQ)," ampere" # calculation
VCEQ=VCC-ICQ*RL # collector-emitter voltage as operating point
print "VCEQ =VCC-ICQ*RL = %0.2f"%(VCEQ)," volts" #calculation
from __future__ import division
BF1=100
print "BF1 = %0.2f"%(BF1)," " #BJT gain
VCC=20
print "VCC = %0.2f"%(VCC)," volts" # collector supply voltage
VBB=VCC
RL=5*(10**3)
print "resistance,RL= %0.2e"%(RL)+ " ohm" #initialization
RB=965*(10**3)
print "resistance,RB = %0.2e"%(RB)+ " ohm" #initialization
VBE=(0.7)
print "VBE = %0.2f"%(VBE)," volts" # value of base-emitter voltage
ICO=10*10**(-9)
print "ICO = %0.2e"%(ICO)," ampere" # collector reverse bias current
Vi=0
print "Vi = %0.f"%(Vi)," volts" # value of input
IBQ=(VCC-VBE)/RB #base current as operating point
print "IBQ = %0.2e"%(IBQ)," ampere"
ICQ1=BF1*IBQ #operating point (collector current)
print "ICQ1 =BF1*IBQ= %0.2e"%(ICQ1)," ampere" # calculation
VCEQ1=VCC-ICQ1*RL # collector-emitter voltage as operating point
print "VCEQ1 =VCC-ICQ1*RL = %0.2f"%(VCEQ1)," volts" #calculation
from __future__ import division
VBE2=(0.5)
print "VBE2 = %0.2f"%(VBE2)," volts" # value of base-emitter voltage
VCC=20
print "VCC = %0.2f"%(VCC)," volts" # collector supply voltage
BF2=150
print "BF2 = %0.2f"%(BF2)," " #BJT gain
ICO2=500*10**(-9)
print "ICO2 = %0.2e"%(ICO2)," ampere" # collector reverse bias current
RB=965*(10**3)
print "RB = %0.2e"%(RB)+ " ohm" #initialization base resistance
RL=5*(10**3)
print "RL= %0.2e"%(RL)+ " ohm" # load resistance
IBQ2=(VCC-VBE2)/RB #base current as operating point
print "IBQ2 = (VCC-VBE2)/RB=%0.2e"%(IBQ2)," ampere"
ICQ2=(BF2*IBQ2) #operating point (collector current)
print "ICQ2 =BF2*IBQ2= %0.2e"%(ICQ2)," ampere" #
dICQ2=BF2*ICO2 # increase in reverse bias current
print "dICQ2 =BF2*ICO2= %0.2e"%(dICQ2)," ampere" #
ICQ3=ICQ2+dICQ2
print "ICQ3 =ICQ2+dICQ2= %0.2e"%(ICQ3)," ampere" # calculation
VCEQ3=VCC-ICQ3*RL # collector-emitter voltage as operating point
print "VCEQ3 =VCC-ICQ3*RL = %0.2f"%(VCEQ3)," volts" #calculation
#NOTE: Calculated ans for VCEQ3=4.4695596 volts but in book it is given as 4.625volts(due to approximations done in)
from __future__ import division
VCC=20
print "VCC = %0.2f"%(VCC)," volts" # collector supply voltage
RL=5*(10**3)
print "resistance,RL= %0.2f"%(RL)+ " ohm" #initialization
R1=90*(10**3)
print "resistance,R1 = %0.2f"%(R1)+ " ohm" #initialization
R2=10*(10**3)
print "resistance,R2 = %0.2f"%(R2)+ " ohm" #initialization
Rc=1*(10**3)
print "resistance,Rc = %0.2f"%(Rc)+ " ohm" # resistance at collector
VBEmax=(0.7)
print "VBEmax = %0.2f"%(VBEmax)," volts" # maximum base-emitter voltage
VBEmin=(0.5)
print "VBEmin = %0.2f"%(VBEmin)," volts" # minimum base-emitter voltage
BFmax=150
print "BFmax = %0.2f"%(BFmax)," " #BJT gain maximum
BFmin=50
print "BFmin = %0.2f"%(BFmin)," " #BJT gain minimum
ICOmax=500*10**(-9)
print "ICOmax = %0.2e"%(ICOmax)," ampere" # maximum collector reverse bias current
ICOmin=10*10**(-9)
print "ICOmin = %0.2e"%(ICOmin)," ampere" # minimum collector reverse bias current
VBB=(VCC*R2)/(R1+R2)
print "VBB = %0.2f"%(VBB)," volts" # Base supply voltage
RB=(R1*R2)/(R1+R2)
print "RB = (R1*R2)/(R1+R2)=%0.2f"%(RB)+ " ohm" # eqivalent base resistance
ICmin=((BFmin*(VBB-VBEmax)+(RB+Rc)*(1+BFmin)*ICOmin)/(RB+Rc*(1+BFmin))) # minimum collector current
print "ICmin = %0.2f"%(ICmin)," ampere"
VCEQmax=VCC-ICmin*RL # maximum collector-emitter voltage (d.c value)
print "VCEQmax =VCC-ICmin*RL = %0.2f"%(VCEQmax)," volts" #calculation
ICmax=((BFmax*(VBB-VBEmin)+(RB+Rc)*(1+BFmax)*ICOmax)/(RB+Rc*(1+BFmax))) # maximum collector current
print "ICmax = %0.2e"%(ICmax)," ampere"
VCEQmin=VCC-ICmax*RL # minimum collector-emitter voltage (d.c value)
print "VCEQmin =VCC-ICmax*RL = %0.2f"%(VCEQmin)," volts" #calculation
change_IC=ICmax-ICmin
print "change_IC= %0.2e"%(change_IC)," ampere" # extreme variation in collector current
# ERROR - NOTE: Extreme variation in collector current given in book is 0.397 mA but calculated correct ans is 0.3276 mA
from __future__ import division
VCC=20
print "VCC = %0.2f"%(VCC)," volts" # collector supply voltage
RL=2*(10**3)
print "RL= %0.2f"%(RL)+ " ohm" #resistance
R1=100*(10**3)
R2=R1
print "R1 =R2= %0.2f"%(R1)+ " ohm" #resistance
VBE=(0.7)
print "VBE = %0.2f"%(VBE)," volts" # base-emitter voltage
BF=100
print "BF = %0.2f"%(BF)," " #BJT gain
ICO=0
VBB=(VCC*R2)/(R1+R2)
print "VBB = %0.2f"%(VBB)," volts" # Base supply voltage
RB=(R1*R2)/(R1+R2)
print "RB = (R1*R2)/(R1+R2)=%0.2f"%(RB)+ " ohm" # eqivalent base resistance
IC=((BF*(VBB-VBE))/(RB+RL*(1+BF))) # collector current
print "IC = %0.2e"%(IC)," ampere"
VE=IC*RL
print "VE = %0.2f"%(VE)," volts" # emitter voltage
VB=VBE+VE
print "VB = %0.2f"%(VB)," volts" # base voltage
VCB=VCC-VB
print "VCB = %0.2f"%(VCB)," volts" # collector-base voltage
#hence BJT in active region.
from __future__ import division
VCC=5
print "VCC = %0.2f"%(VCC)," volts" # collector supply voltage
RL=250
print "RL= %0.2f"%(RL)+ " ohm" #initialization
RB=25*10**(3)
print "RB =%0.2f"%(RB)+ " ohm" # base resistance
VCS=(0.2)
print "VCS = %0.2f"%(VCS)," volts" # voltage
BF=200
print "BF = %0.2f"%(BF)," " #BJT gain
VBS=(0.8)
print "VBS = %0.2f"%(VBS)," volts" # base-emitter voltage for BJT switch
VI=5
print "VI = %0.2f"%(VI)," volts"# input voltage
VCON=0.3
print "VCON = %0.2f"%(VCON)," volts"
ICON=(VCC-VCON)/RL
print "ICON = (VCC-VCON)/RL=%0.2f"%(ICON)," ampere"#collector current for saturated BJT
IBON=(ICON)/BF
print "IBON = (ICON)/BF=%0.2e"%(IBON)," ampere"#Base current for saturated BJT
IBS=(VI-VBS)/RB
print "IBS = (VI-VBS)/RB=%0.2e"%(IBS)," ampere"#Base-emitter current for saturated BJT
ICS=(VCC-VCS)/RL
print "ICS = (VCC-VCS)/RL=%0.2e"%(ICS)," ampere"#Collector-emitter current for saturated BJT
Bforced=ICS/IBS
print "Bforced = ICS/IBS=%0.2f"%(Bforced)," " #BJT forced gain
#IBS>>IBON hence BJT in saturation
from __future__ import division
TJmax=175
print "TJmax= %0.2f"%(TJmax),"degree celsius" #maximum allowed junction temperature
theta=0.5
print "theta= %0.2f"%(theta),"degree celsius/mW " #thermal resistances b/w junction to ambient
change_T=TJmax-25#temperature difference
PDmax=change_T/theta
print "at 25 degree celsius,PDmax=(TJmax-25 )/theta = %0.2f"%(PDmax)+ " mW " #maximum allowed power dissipation at TA=25 degree celsius
change_T=TJmax-75
PDmax2=change_T/theta
print "at 75 degree celsius,PDmax2= (TJmax-75)/theta = %0.2f"%(PDmax2)+ " mW " #maximum allowed power dissipation at TA=75 degree celsius
from __future__ import division
TJmax=175
print "TJmax= %0.2f"%(TJmax)," degree celsius" #maximum allowed junction temperature
theta=0.1
print "theta= %0.2f"%(theta)," degree celsius/mW " #thermal resistances b/w junction to ambient
change_T=TJmax-25 #temperature difference
PDmax=change_T/theta
print "at 25 degree celsius,PDmax=(TJmax-25 )/theta = %0.2f"%(PDmax)+ " mW " #maximum allowed power dissipation at TA=25 degree celsius
change_T=TJmax-75 #temperature difference
PDmax=change_T/theta
print "at 75 degree celsius,PDmax= (TJmax-75)/theta = %0.2f"%(PDmax)+ " mW " #maximum allowed power dissipation at TA=75 degree celsius
from __future__ import division
VBE=(0.7)
print "VBE = %0.2f"%(VBE)," volts" # value of base-emitter voltage
VCC=10
print "VCC = %0.2f"%(VCC)," volts" # collector supply voltage
IREF=5*10**(-3)
print "IREF =IQ= %0.2f"%(IREF)," ampere" # current mirror source current
R=(VCC-VBE)/(IREF)# formulae
print "R=(VCC-VBE)/(IREF)= %0.2f"%(R)+ " ohm" #resistance