# Chapter 3 - Bipolar Junction Transistor¶

## Example 3_1 Page No. 64¶

In :
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

Vcc = 15.00  volts
VBB = 1.00  volts
VBE = 0.70  volts
resistance,RB = 5000.00 ohm
resistance,RL = 650.00 ohm
Gain,Bf = 200.00
IB =(VBB-VBE)/RB = 6.00e-05  ampere
IC =IB*Bf= 0.01  ampere
IE = IB+IC=0.01  ampere
VCE =Vcc-IC*RL= 7.20  volts
VCB = VCE-VBE=6.50  volts
resistance,RB =(Vcc-VBE)/IB= 2.38e+05 ohm


## Example 3_2 Page No. 65¶

In :
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)," "

Vbe1 = 0.03  volts
Vbe2 = -0.03  volts
ib1 = 2.00e-05  ampere
ib2 = -2.00e-05  ampere
IBQ = 6.00e-05  ampere
ICP = 0.02  ampere
ICR = 0.01  ampere
VCEP = 5.00  volts
VCER = 9.00  volts
change_IC = 0.01  ampere
change_VCE = 4.00  volts
AV = 80.00
AI = 175.00


## Example 3_3 Page No. 68¶

In :
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"

ICQ = 0.01  ampere
B = 200.00
capacitance,Cbe = 1.00e-10  F
VT = 0.03  volts
gm =(ICQ/VT)= 0.46  A/V
hie =(B/gm)= 433.33  ohm
fT =((1/2)*(gm/Cbe)*(1/pi))= 7.35e+08  hertz


## Example 3_4 Page No. 71¶

In :
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

VCC = 20.00  volts
RL= 5000.00 ohm
RB = 9.65e+05 ohm
VBE = 0.70  volts
BF = 50.00
ICO = 1.00e-08  ampere
Vi = 0.00e+00  volts
IBQ = 2.00e-05  ampere
ICQ =BF*IBQ= 1.00e-03  ampere
VCEQ =VCC-ICQ*RL = 15.00  volts


## Example 3_5 Page No. 74¶

In :
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

BF1 = 100.00
VCC = 20.00  volts
resistance,RL= 5.00e+03 ohm
resistance,RB = 9.65e+05 ohm
VBE = 0.70  volts
ICO = 1.00e-08  ampere
Vi = 0  volts
IBQ = 2.00e-05  ampere
ICQ1 =BF1*IBQ= 2.00e-03  ampere
VCEQ1 =VCC-ICQ1*RL = 10.00  volts


## Example 3_6 Page No. 75¶

In :
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)


VBE2 = 0.50  volts
VCC = 20.00  volts
BF2 = 150.00
ICO2 = 5.00e-07  ampere
RB = 9.65e+05 ohm
RL= 5.00e+03 ohm
IBQ2 = (VCC-VBE2)/RB=2.02e-05  ampere
ICQ2 =BF2*IBQ2= 3.03e-03  ampere
dICQ2 =BF2*ICO2= 7.50e-05  ampere
ICQ3 =ICQ2+dICQ2= 3.11e-03  ampere
VCEQ3 =VCC-ICQ3*RL = 4.47  volts


## Example 3_7 Page No. 76¶

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


VCC = 20.00  volts
resistance,RL= 5000.00 ohm
resistance,R1 = 90000.00 ohm
resistance,R2 = 10000.00 ohm
resistance,Rc = 1000.00 ohm
VBEmax = 0.70  volts
VBEmin = 0.50  volts
BFmax = 150.00
BFmin = 50.00
ICOmax = 5.00e-07  ampere
ICOmin = 1.00e-08  ampere
VBB = 2.00  volts
RB = (R1*R2)/(R1+R2)=9000.00 ohm
ICmin = 0.00  ampere
VCEQmax =VCC-ICmin*RL = 14.58  volts
ICmax = 1.41e-03  ampere
VCEQmin =VCC-ICmax*RL = 12.95  volts
change_IC= 3.28e-04  ampere


## Example 3_8 Page No. 79¶

In :
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.

VCC = 20.00  volts
RL= 2000.00 ohm
R1 =R2= 100000.00 ohm
VBE = 0.70  volts
BF = 100.00
VBB = 10.00  volts
RB = (R1*R2)/(R1+R2)=50000.00 ohm
IC = 3.69e-03  ampere
VE = 7.38  volts
VB = 8.08  volts
VCB = 11.92  volts


## Example 3_9 Page No. 84¶

In :
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

VCC = 5.00  volts
RL= 250.00 ohm
RB =25000.00 ohm
VCS = 0.20  volts
BF = 200.00
VBS = 0.80  volts
VI = 5.00  volts
VCON = 0.30  volts
ICON = (VCC-VCON)/RL=0.02  ampere
IBON = (ICON)/BF=9.40e-05  ampere
IBS = (VI-VBS)/RB=1.68e-04  ampere
ICS = (VCC-VCS)/RL=1.92e-02  ampere
Bforced = ICS/IBS=114.29


## Example 3_10 Page No. 85¶

In :
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

TJmax= 175.00 degree celsius
theta= 0.50 degree celsius/mW
at 25 degree celsius,PDmax=(TJmax-25 )/theta = 300.00 mW
at 75 degree celsius,PDmax2= (TJmax-75)/theta = 200.00 mW


## Example 3_11 Page No. 85¶

In :
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

TJmax= 175.00  degree celsius
theta= 0.10  degree celsius/mW
at 25 degree celsius,PDmax=(TJmax-25 )/theta = 1500.00 mW
at 75 degree celsius,PDmax= (TJmax-75)/theta = 1000.00 mW


## Example 3_12 Page No. 86¶

In :
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

VBE = 0.70  volts
VCC = 10.00  volts
IREF =IQ= 0.01  ampere
R=(VCC-VBE)/(IREF)= 1860.00 ohm