Chapter 7 , Transistor Amplifiers , Biasing and Thermal Stabilization

Example 7.1 , Page Number 230

In [4]:
#Variables

VCC = 10                     #Collector supply voltage (in volts)
RC = 3.0 * 10**3             #Collector load resistance (in ohm)
Vknee = 1                    #Knee voltage for silicon transistor (in volts)
beta = 100                   #Current gain
ICperVBE = 4.0 * 10**-3      #Change in IC per volt change in VBE (in Ampere per volt)

#Calculation

VCmax = VCC - Vknee          #Maximum voltage drop across resistance RC (in volts)
ICmax = VCmax/RC             #Maximum allowable collector current (in Ampere)
ICzero = ICmax/2             #Zero signal collector current (in Ampere)
IBmax = ICmax/beta           #Maximum base current (in Ampere)
VBE = ICmax/ICperVBE         #Base-emitter voltage (in volts)

#Result

print "Maximum collector current that can be allowd during any part of the input signal is ",ICmax* 10**3,"mA."
print "Minimum zero signal collector current required : ",ICzero*10**3,"mA."
print "Maximum base current ",IBmax*10**3,"mA."
print "Signal voltage (VBE) : ",VBE,"V."
 Maximum collector current that can be allowd during any part of the input signal is  3.0 mA.
Minimum zero signal collector current required :  1.5 mA.
Maximum base current  0.03 mA.
Signal voltage (VBE) :  0.75 V.

Example 7.2 , Page Number 232

In [7]:
import math
import numpy
%matplotlib inline
from matplotlib.pyplot import plot,title,xlabel,ylabel,ylim,xlim,annotate

#Variables

VCC = 20                        #Collector supply voltage (in volts)
RC = 2.0 * 10**3                #Collector load ressitance (in ohm)
RE = 3.0 * 10**3                #Emitter resistance (in ohm)  
IC = 0                          #Collector current at saturation point (in Ampere)
VCE1 = 0                        #Collector-to-emitter voltage at cut-off point (in volts)  

#Calculation

VCE = VCC - IC*(RC + RE)        #Collector-to-emitter voltage (in volts)
IC1 = VCC/(RC + RE)             #Cut-off point collector current (in Ampere)

#Result

print "Following is the graph showing necessary details : "

#Graph

x = numpy.linspace(0,20,100)
y1 = numpy.linspace(0,2,100)
x1 = numpy.linspace(0,10,100)
plot(x,4-4.0/20*x,'b')
plot(x1,2+x1-x1,'--',color='g')
plot(10+y1-y1,y1,'--',color='g')
annotate('Q - POINT',xy=(10,2))
xlim(0,30)
ylim(0,6)
title("DC Load line")
xlabel("-VCE in Volts->")
ylabel("-IC in mA->")
Following is the graph showing necessary details : 
Out[7]:
<matplotlib.text.Text at 0x63c07b0>

Example 7.3 , Page Number 237

In [8]:
#Variables

VCC = 6                        #Collector supply voltage (in volts)
VBE = 0                        #Emitter-to-base voltage (in volts)
RB = 1.0 * 10**6               #base resistance (in ohm)
beta = 100                     #Current gain in CE  
RC = 5 * 10**3                 #Collector resistance (in ohm)

#Calculation

IB = VCC/RB                    #Base current (in Ampere)
IC = beta*IB                   #Collector current (in Ampere)
VCE = VCC - IC*RC              #Collector-to-emitter voltage (in volts) 

#Result

print "Q-point will be ICQ = ",IC * 10**3,"mA and VCEQ = ",VCE,"V."
Q-point will be ICQ =  0.6 mA and VCEQ =  3.0 V.

Example 7.4 , Page Number 237

In [12]:
#Variables

VCC = 12                       #Collector supply voltage (in volts)
VBE = 0.7                      #Emitter-to-base voltage (in volts)
RB = 1130.0 * 10**3            #base resistance (in ohm)
beta = 100                     #Current gain in CE  
RC = 4 * 10**3                 #Collector resistance (in ohm)

#Calculation

IB = (VCC-VBE)/RB              #Base current (in Ampere)
IC = beta * IB                 #Collector current (in Ampere)
VCE = VCC - IC*RC              #Collector-to-emitter voltage (in volts)
VC = VCE                       #Collector voltage (in volts)
VB = VBE                       #Base voltage (in volts)
VCB = VC - VB                  #Collector-to-base voltage (in volts)
S = beta + 1                   #Stability factor  

#Result

print "Base current : ",IB*10**6,"micro-A."
print "Collector current : ",IC * 10**3,"mA."
print "VC : ",VC,"V.\nVB : ",VB,"V.\nVCB : ",VCB,"V."
print "Operating point is ICQ : ",IC*10**3,"mA and VCEQ : ",VC,"V."
print "Stability factof : ",S,"."
Base current :  10.0 micro-A.
Collector current :  1.0 mA.
VC :  8.0 V.
VB :  0.7 V.
VCB :  7.3 V.
Operating point is ICQ :  1.0 mA and VCEQ :  8.0 V.
Stability factof :  101 .

Example 7.5 , Page Number 237

In [14]:
#Variables

dIC = 1.6 * 10**-3                #Change in collector current (in Ampere)
dt = 30                           #Change in temperature (in Celsius degree)
ICO = 1.7 * 10**-6                #Reverse saturation current change (in Ampere per Celsius-degree)

#Calculation

dICO = dt*ICO                     #Change in reverse saturation current (in Ampere) 
S = dIC/dICO                      #Stability factor  

#Result
print "Stability factor : ",round(S,2),"."
Stability factor :  31.37 .

Example 7.6 , Page Number 237

In [17]:
#Variables

VBB = 10.0                        #Base supply voltage (in volts)
VBE = 0.7                         #Base-to-emitter voltage (in volts)
RB = 330 * 10**3                  #Base resistance (in ohm)

#Calculation

IB = (VBB - VBE)/RB               #Base current (in Ampere)

#Result

print "Base current : ",round(IB*10**6,1),"micro-A."
Base current :  28.2 micro-A.

Example 7.7 , Page Number 238

In [24]:
import math
import numpy
%matplotlib inline
from matplotlib.pyplot import plot,title,xlabel,ylabel,ylim,xlim

#Variables

VCC = 20                         #Collector supply voltage (in volts)
RC = 3.3 * 10**3                 #Collector resistance (in ohm)

#Calculation

IC = VCC/RC                      #Collector current at cut-off point (in Ampere)
VCE = 0                          #Collector-to-emitter voltage at cut-off point (in volts) 
VCE1 = VCC                       #Collector-to-emitter voltage at saturation point (in volts)
IC1 = 0                          #Collector current at saturation point (in Ampere)

#Result

print "Cut-off point : (0,",round(IC*10**3,2),"mA)."
print "Saturation point : (",VCE1,"V ,0)."

#Graph

x = numpy.linspace(0,20,100)
plot(x,6-6.0/20*x,'b')
xlim(0,30)
ylim(0,10)
title("DC Load line")
xlabel("-VCE in Volts->")
ylabel("-IC in mA->")
Cut-off point : (0, 6.06 mA).
Saturation point : ( 20 V ,0).
Out[24]:
<matplotlib.text.Text at 0x6e21990>

Example 7.8 , Page Number 238

In [25]:
#Variables

VCC = 20                         #Collector supply voltage (in volts)
RB = 1.0 * 10**3                 #Base resistance (in ohm)
VBE = 0.7                        #Base-to-emitter voltage (in volts)
beta = 100                       #Current gain in CE

#Calculation

IB = (VCC - VBE)/RB              #Base current (in Ampere)
IC = beta *IB                    #Collector current (in Ampere)
VCE = VCC - IC*RC                #Collector-to-Emitter voltage (in volts)

#Result

print "Visualizing that VCE = 0.7 , we can say that transistor is just gone to saturation from active region (not well within saturation)."
Visualizing that VCE = 0.7 , we can say that transistor is just gone to saturation from active region (not well within saturation).

Example 7.9 , Page Number 238

In [27]:
#Variables

VCC = 10                           #Collector supply voltage (in volts)
VBB = 5                            #Base supply votlage (in volts)
RB = 200 * 10**3                   #Base resistance (in ohm)
VBEsat = 0.8                       #Base-to-emitter voltage in saturation state (in volts)
VCEsat = 0.2                       #Collector-to-emitter voltage in saturation state (in volts)
beta = 100                         #Current gain in CE

#Calculation

IB = (VBB-VBEsat)/RB               #Base current (in Ampere)
IC = beta*IB                       #Collector current (in Ampere)
RC = (VCC - VCEsat)/IC             #Collector resistance (in volts)

#Result

print "Maximum value of RC for which transistor remains in saturation is ",round(RC*10**-3,3),"ohm."
Maximum value of RC for which transistor remains in saturation is  4.667 ohm.

Example 7.10 , Page Number 239

In [29]:
#Variables

IE = 2.0 * 10**-3                     #Emitter current (in Ampere)
alpha = 0.99                          #Current gain in CB
RE = 1.0 * 10**3                      #Emitter resistance (in ohm) 
VBE = 0.7                             #Base-emitter voltage (in volts) 
VCB = 1                               #Collector-base voltage (in volts)
RC = 4.0 * 10**3                      #Collector resistance (in ohm) 

#Calculation

IC = alpha*IE                         #Collector current (in Ampere)
IB = IE - IC                          #Base current (in Ampere)  
VEE = IE*RE + VBE                     #Emitter supply voltage (in volts)
VCC = IC*RC + VCB                     #Collector supply voltage (in volts)

#Result

print "IC : ",IC * 10**3,"mA.\nIB : ",IB * 10**3,"mA.\nVEE : ",VEE,"V.\nVCC : ",VCC,"V."

#Slight variation due to higher precision in the value of VCC.
IC :  1.98 mA.
IB :  0.02 mA.
VEE :  2.7 V.
VCC :  8.92 V.

Example 7.11 , Page Number 239

In [6]:
#Variables

VCC = 30                          #Collector supply voltage (in volts)
VBB = 6                           #Base voltage (in volts)
VBE = 0.7                         #Emitter-to-base voltage (in volts)
RB = 1.0 * 10**6                  #Base resistance (in ohm)
beta = 100                        #Current gain in CB
ICBO = 0.1 * 10**-6               #Reverse saturation current (in Ampere) 
dt = 55-25                        #Change in temperature (in Celsius degree)

#Calculation

IB = (VBB - VBE)/RB                 #Base current (in Ampere)
IC = beta*IB + (beta+1)*ICBO        #Collector current (in Ampere)
ICBO55 = ICBO * 2**(dt/10.0)        #ICBO at 55 Celsius degree (in Ampere)
VBE55 = 0.7 - 2.5*10**-3*dt         #VBE at 55 Celsius degree (in Ampere)
IB55 = (VBB - VBE55)/RB             #Base current at 55 Celsius degree(in Ampere)
IC55 = beta*IB55 + (beta+1)*ICBO55  #Collector current 55 Celsius degree (in Ampere)

#Result

print "IB : ",round(IB * 10**6,1),"micro-A and IC :",round(IC*10**3,2),"mA at 25 Celsius degree."
print "IB : ",round(IB55 * 10**6,3),"micro-A and IC :",round(IC55*10**3,4),"mA at 55 Celsius degree."

#Slight variation in IC55 due to higher precision.
IB :  5.3 micro-A and IC : 0.54 mA at 25 Celsius degree.
IB :  5.375 micro-A and IC : 0.6183 mA at 55 Celsius degree.

Example 7.12 , Page Number 239

In [13]:
#Variables

hfe = 100                                  #Current gain in CE
VBE = 0.8                                  #Base-emitter voltage (in volts)
VBB = 3.0                                  #Base supply voltage (in volts)
RB = 7.0 * 10**3                           #Base resistance (in ohm)
RL = 500                                   #Load resistance (in ohm)
RC = 3.0 * 10**3                           #Collector resistance (in ohm)
VCC = 10                                   #Collector supply voltage (in volts)  
VCE = 1                                    #Collector-emitter voltage (in volts)

#Calculation

#  7500IB + 500IC = 2.2 ----Eq. 1
#  500IB + 2500IC = 9.0 ----Eq. 2
IC = 2.55                                  #Collector current (in milli-Ampere)
IB = 0.123                                 #Base current (in milli-Ampere)
beta = IC/IB                               #Current gain in CB
VC = -VCE - (IB + IC)*RL*10**-3            #Collector voltage in saturation (in volts)
IBmax = IC/hfe                             #Maximum base current (in milli-Ampere)
RB = (VBB - VBE - IC*RL*10**-3 )/IBmax     #Base resistance (in kilo-ohm)

#Result

print "Since , beta is very less than hfe , therefore it is in saturation region."
print "VC :",VC,"V."
print "Minimum value of RB for which it operates in active region : ",round(RB,2)," kilo-ohm."
Since , beta is very less than hfe , therefore it is in saturation region.
VC : -2.3365 V.
Minimum value of RB for which it operates in active region :  36.27  kilo-ohm.

Example 7.13 , Page Number 242

In [16]:
#Variables

R2 = 30.0 * 10**3                          #Resistance (in ohm)
R1 = 133.55 * 10**3                        #Resistance (in ohm)  
alpha = 0.985                              #Current gain in CB
VCC = 16                                   #Collector supply voltage (in volts)  
VCE = 6                                    #Collector-emitter voltage (in volts)
IE = 2.0 * 10**-3                          #Emitter current (in Ampere)
IC = alpha*IE                              #Collector current (in Ampere)
IB = IE - IC                               #Base current (in Ampere)
beta = alpha/(1-alpha)                     #Current gain in CE 
RE = 1.0 * 10**3                           #Emitter resistance (in ohm)
VBE = 0.2                                  #Base-emitter voltage (in volts)

#Calculation

RC = (VCC - VCE - IE*RE)/IC                #Collector resistance (in ohm)
Vth = R2/(R1 + R2)*VCC                     #Voltage across R2 (in volts)
Rth = R1*R2/(R1+R2)                        #Thevenin's equivalence resistance (in ohm)
S = (1+beta)/(1 + beta*RE/(Rth+RE))        #Stability factor 

#Result

print "R1 : ",round(R1 * 10**-3,2),"kilo-ohm."
print "RC : ",round(RC * 10**-3,2),"kilo-ohm."
print "S : ",round(S,2),"."
R1 :  133.55 kilo-ohm.
RC :  4.06 kilo-ohm.
S :  18.65 .

Example 7.14 , Page Number 243

In [20]:
#Variables

beta = 50.0                                #Current gain in CE
VBE = 0.6                                  #Base-emitter voltage (in
RC = 4.7 * 10**3                           #Collector resistance (in ohm)
VCC = 20                                   #Collector supply voltage (in volts)  
IC = 2.0 * 10**-3                          #Collector current (in Ampere)
VCE = 8                                    #Collector-emitter voltage (in volts)
RE = 1.3 * 10**3                           #Emitter resistance (in ohm)
S = 5                                      #Stability factor

#Calculation

IB = IC/beta                               #base current (in Ampere) 
IE = IB + IC                               #Emitter current (in Ampere)
Rth = (S - 1)*RE/(1 -S/(1+beta))           #Thevenin's equivalent resistance (in ohm)
Vth = IB * Rth + VBE + IE*RE               #Thevenin's equivalent voltage (in volts)
R1 = Rth * VCC/Vth                         #Resistance1 (in ohm)
R2 = Vth * R1/(VCC - Vth)                  #Resistance2 (in ohm)

#Result

print "IB : ",IB*10**3,"mA."
print "IE : ",IE*10**3,"mA."
print "Rth : ",round(Rth*10**-3,3),"kilo-ohm."
print "Vth : ",round(Vth,4),"V."
print "R1 :",round(R1*10**-3,1),"kilo-ohm."
print "R2 : ",round(R2*10**-3,2),"kilo-ohm."
IB :  0.04 mA.
IE :  2.04 mA.
Rth :  5.765 kilo-ohm.
Vth :  3.4826 V.
R1 : 33.1 kilo-ohm.
R2 :  6.98 kilo-ohm.

Example 7.15 , Page Number 244

In [29]:
#Variables

dICbyIC = 10                     #Percentage change in IC 
VBE25max = 0.7                   #Max VBE at 25 degree Celsius (in volts)
VBE25min = 0.6                   #Min VBE at 25 degree Celsius (in volts)
ICO25 = 5 * 10**-9               #Reverse saturation current at 25 degree celsius (in Ampere)
ICO145 = 3 * 10**-6              #Reverse saturation current at 145 degree celsius (in Ampere)
VCC = 20                         #Collector supply voltage (in volts)
VCE = 10                         #Collector-emitter voltage (in volts)

#Calculation

dIC = 5.0/100 * 0.6              #Change in collector current (in milli-Ampere)
dICO = ICO145 - ICO25            #Change in reverse saturation current (in Ampere)
S = dIC/dICO                     #Stability factor
dVBE = -2.5 * (145 - 25)         #Change in VBE (in volts)
SV = dIC/dVBE                    #SV
beta = hfe = 400                 #Current gain in CE
#Rth + Re = 99750.6 
#RE = 391.0/3609 * Rth
RE = 9.75                        #Emitter resistance (in kilo-ohm) 
Rth = 90                         #Thevenin's equivalent resistance (in kilo-ohm)
dIC1 = S*ICO145 + SV*dVBE        #Change in collector current1 (in milli-Ampere) 
IC = 0.6 + dIC1                  #Collector current (in milli- Ampere)  
IE = IC + IC/beta                #Emitter current (in milli-Ampere)
RC = (VCC - IE*RE - VCE)/IC      #Collector resistance (in ohm)
VBE = 0.65                       #emitter-base voltage (in volts)
Vth = IC/beta*Rth + VBE + IE*RE  #Thevenin's equivalent voltage (in volts)
R1 = Rth * VCC/Vth               #Resistance1 (in kilo-ohm)
R2 = Vth * R1/(VCC - Vth)        #Resistance2 (in kilo-ohm)

#Result

print "RC : ",round(RC,3)," kilo-ohm.\nRE : ",RE," kilo-ohm.\nR1 : ",round(R1)," kilo-ohm.\nR2 : ",round(R2)," kilo-ohm."
RC :  5.376  kilo-ohm.
RE :  9.75  kilo-ohm.
R1 :  248.0  kilo-ohm.
R2 :  141.0  kilo-ohm.

Example 7.16 , Page Number 245

In [30]:
#Variables

hfe = 100                     #Current gain in CE
VBE = 0.7                     #Emitter-base voltage (in volts)
ICO = 0                       #Reverse saturation current (in Ampere)
IC = 1.0 * 10**-3             #Collector current (in Ampere)
VCE = 2.5                     #Collector-emitter voltage (in volts) 
VCC = 5                       #Collector supply voltage (in volts) 
R2 = 10 * 10**3               #Resistance2 (in ohm) 


#Calculation

R1 = 36.238 * 10**3           #Resistance1 (in ohm)                    
RC = (VCC - VCE)/IC           #Collector resistance (in ohm)        

#Result

print "R1 : ",R1*10**-3,"kilo-ohm.\nRC : ",RC*10**-3,"kilo-ohm."

#Printing mistake in the value of RC in book.
R1 :  36.238 kilo-ohm.
RC :  2.5 kilo-ohm.

Example 7.17 , Page Number 245

In [41]:
#Variables

beta = 100                         #Current gain in CE
R1 = 10.0 * 10**3                  #Resistance1 (in ohm)
R2 = 2.2 * 10**3                   #Resistance2 (in ohm)
VCC = 10                           #Collector supply voltage (in volts)
RE = 1.0 * 10**3                   #Emitter resistance (in ohm)
RC = 3.6 * 10**3                   #Collector resistance (in ohm)
VBE = 0.7                          #Base-emitter voltage (in volts) 

#Calculation

RB = R1*R2/(R1+R2)                 #Base resistance (in ohm)
Vth = VCC*R2/(R1 + R2)          #Thevenin's voltage (in volts)
IE = (Vth - VBE)/(RE - Rth/(beta + 1))        #Emitter current (in Ampere)
IC = beta*1.0/(beta + 1)*IE        #Collector current (in Ampere)        
VCE = VCC - IC*RC - IE*RE          #Collector-emitter voltage (in volts)  

#Result


print "VCE : ",round(VCE),"V.\nIE : ",round(IE*10**3,2),"mA."

#Slight varaition due to higher precision.
VCE :  5.0 V.
IE :  1.1 mA.

Example 7.18 , Page Number 246

In [43]:
#Variables

beta = 200                         #Current gain in CE
R1 = 82.0 * 10**3                  #Resistance1 (in ohm)
R2 = 16.0 * 10**3                  #Resistance2 (in ohm)
VCC = -22                          #Collector supply voltage (in volts)
RE = 750                           #Emitter resistance (in ohm)
RC = 2.2 * 10**3                   #Collector resistance (in ohm)
VBE = -0.7                         #Base-emitter voltage (in volts) 

#Calculation

Vth = VCC*R2/(R1 + R2)             #Thevenin's equivalent voltage (in volts)
Rth = R1*R2/(R1+R2)                #Thevenin's equivalent resistance (in ohm)
IB = (Vth - VBE)/(Rth +(beta+1)*RE)#Base current (in Ampere) 
IC = beta * IB                     #Collector current (in Ampere)
VC = VCC - IC*RC                   #Output voltage (in volts)

#Result

print "VC : ",round(VC,2),"V."
print "IB : ",round(IB * 10**6,2)," micro-A"
VC :  -14.25 V.
IB :  -17.62  micro-A

Example 7.19 , Page Number 246

In [44]:
#Variables

VCC = 20                           #collector supply voltage (in volts)
beta = 50                          #Current gain in CE
RB = 430.0 * 10**3                 #Base resistance (in ohm) 
RE = 1.0 * 10**3                   #Emitter resistance (in ohm)
RC = 2.0 * 10**3                   #Collector resistance (in ohm)
VBE = 0.7                          #Base-emitter voltage (in volts) 
IC = 2 * 10**-3                    #Collector current (in Ampere)

#Calculation

VCE = VCC - IC*(RC+RE)             #Collector-emitter voltage (in volts) 
VC = VCC - RC*IC                   #Output voltage (in volts)
VE = VC - VCE                      #Emitter voltage (in volts)
IB = 0.04 * 10**-3                 #Base current (in Ampere)
IE = (1+beta)*IB                   #Emitter current (in Ampere)
VB = VCC - 430*10**3*IB            #Base voltage (in volts)

#Result

print "IB : ",IB*10**3,"mA.\nIC : ",IC*10**3,"mA.\nVCE : ",VCE,"V.\nVE : ",VE,"V.\nVB : ",VB,"V.\nVC : ",VC,"V."
IB :  0.04 mA.
IC :  2.0 mA.
VCE :  14.0 V.
VE :  2.0 V.
VB :  2.8 V.
VC :  16.0 V.

Example 7.20 , Page Number 246

In [52]:
#Variables

alpha = 0.985                      #Current gain in CB
R1 = 50.0 * 10**3                  #Resistance1 (in ohm)
R2 = 20.0 * 10**3                  #Resistance2 (in ohm)
VCC = 20                           #Collector supply voltage (in volts)
RE = 2.0 * 10**3                   #Emitter resistance (in ohm)
RC = 3.0 * 10**3                   #Collector resistance (in ohm)
VBE = 0.7                          #Base-emitter voltage (in volts) 

#Calculation

Vth = VCC*R2/(R1 + R2)             #Thevenin's equivalent voltage (in volts)
Rth = R1*R2/(R1+R2)                #Thevenin's equivalent resistance (in ohm)
beta = alpha/(1-alpha)             #Current gain in CE
IB = (Vth - VBE)/(Rth +(beta+1)*RE)#Base current (in Ampere) 
IC = beta * IB                     #Collector current (in Ampere)
VCE = VCC - IC*(RE + RC)           #Collector-emitter voltage (in volts)
S = (1 + beta)/(1 + beta*(RE/(Rth + RE))) #Stability factor

#Result

print "Operating point will be ICQ : ",round(IC*10**3,2),"mA , VCEQ : ",round(VCE,2),"V."
print "Stability factor : ",round(S,2),"."

#Slight variation due to higher precision.
Operating point will be ICQ :  2.23 mA , VCEQ :  8.85 V.
Stability factor :  7.35 .

Example 7.21 , Page Number 247

In [53]:
#Variables

RL = 1.0 * 10**3                    #Load resistance (in ohm) 
RE = 200                            #Emitter resistance (in ohm)
beta = 100                          #Current gain in CE
VCC = 9                             #Collector supply voltage (in volts)
ICQ = 3.75 * 10**-3                 #Q-point Collector current (in Ampere)
VCEQ = 4.5                          #Q-point collector-emitter voltage (in volts)
VBE = 0.7                           #Base-emitter voltage (in volts)

#Calculation

IB = ICQ/beta                       #Base current (in Ampere)
IE = (1 + beta)*IB                  #Emitter current (in Ampere)
Rth = 20.0 * 10**3                  #Thevenin's eq. resistance (in ohm)
Vth = IB*Rth + VBE +IE*RE           #Thevenin's equivalent voltage (in volts)
R1 = Rth*VCC/Vth                    #Resistance1 (in ohm)
R2 = R1*Vth/(VCC - Vth)             #Resistance2 (in ohm)  

#Result

print "R1 : ",round(R1*10**-3,2),"kilo-ohm.\nR2 : ",round(R2*10**-3,1),"kilo-ohm."
R1 :  81.54 kilo-ohm.
R2 :  26.5 kilo-ohm.

Example 7.22 , Page Number 248

In [59]:
#Variables

VCC = 22.5                         #collector supply voltage (in volts)
beta = 55                          #Current gain in CE
RB = 430.0 * 10**3                 #Base resistance (in ohm) 
RE = 1.0 * 10**3                   #Emitter resistance (in ohm)
RC = 5.6 * 10**3                   #Collector resistance (in ohm)
VBE = 0                            #Base-emitter voltage (in volts) 
IC = 2 * 10**-3                    #Collector current (in Ampere)
R1 = 90 * 10**3                    #Resistance1 (in ohm)
R2 = 10 * 10**3                    #Resistance2 (in ohm) 

#Calculation

Rth = R1*R2/(R1+R2)                #Thevenin's eq. resistance (in ohm) 
Vth = VCC * R2/(R1 + R2)           #Thevenin's eq. voltage (in volts)
IB = (Vth - VBE)/(Rth +(beta + 1)*RE)     #Base current (in Ampere)
IC = beta*IB                       #Collector current (in Ampere)
IE = (beta + 1)*IB                 #Emitter current (in Ampere)
VCE = VCC - IC*RC - IE*RE          #Collector-emitter voltage (in volts)
S = (1 + beta)/(1 + beta*RE/(Rth + RE))    #Stability factor

#Result

print "Operating point , Q will be ICQ =",round(IC*10**3,2),"mA and VCEQ =",VCE,"V."
print "Stability factor : ",round(S,2),"."

#Slight variation due to higher precision.
Operating point , Q will be ICQ = 1.9 mA and VCEQ = 9.9 V.
Stability factor :  8.62 .

Example 7.23 , Page Number 248

In [69]:
#Variables

RC = 2.7 * 10**3                       #Collector resistance (in ohm)
RE = 0.68 * 10**3                      #Emitter resistance (in ohm)
IB = 20.0 * 10**-6                     #Base current (in Ampere)
VCE = 7.3                              #Collector-emitter voltage (in volts)
VE = 2.1                               #Emitter voltage (in volts)
VBE = 0.7                              #Base-emitter voltage (in volts)

#Calculation

IE = VE/RE                             #Emitter current (in Ampere)
beta = IE/IB - 1                       #Current gain in CE
VCC = beta*IB*RC + VCE + IE*RE         #Collector supply voltage (in volts)
RB = (VCC - VE)/IB               #Base resistance (in ohm)   

#Result

print "beta : ",round(beta,1),".\nVCC : ",round(VCC,4),"V.\nRB : ",round(RB*10**-3),"kilo-ohm."
beta :  153.4 .
VCC :  17.6842 V.
RB :  779.0 kilo-ohm.

Example 7.24 , Page Number 249

In [5]:
#Variables

beta=hfe = 100.0                  #Current gain in CE
VBE = .6                          #Base-emitter voltage (in volts)
IC = 1.0 * 10**-3                 #Collector current (in Ampere)
S = 8                             #Stability factor
VCC = 10                          #Collector supply voltage (in volts)
RE = 1.0 * 10**3                  #Emitter resistance (in ohm)                   
VCE = 5                           #Collector-emitter resistance (in ohm) 

#Calculation

IB = IC/beta                      #Base current (in Ampere)
IE = IC + IB                      #Emitter current (in Ampere)
RC = (VCC - VCE - IE*RE)/IC       #Collector resistance (in ohm)
Rth = RE*(beta*S/(1+beta-S) -1)   #Thevenin's resistance(in ohm)
Vth = IB*Rth + VBE + IE*RE        #Thevenin's eq. voltage (in volts)
R1 = Rth*VCC/Vth                  #Resistance1 (in ohm)
R2 = (Vth*R1)/(VCC-Vth)           #Resistance2 (in ohm)

#Result

print "R1 : ",round(R1*10**-3),"kilo-ohm.\nR2 : ",round(R2*10**-3,2),"kilo-ohm."

#Slight variation due to higher precision.
R1 :  45.0 kilo-ohm.
R2 :  9.14 kilo-ohm.

Example 7.25 , Page Number 249

In [6]:
#Variables

beta = 100                        #Current gain in CE
R1 = 2.2 * 10**3                  #Resistance1 (in ohm)
R2 = 2.2 * 10**3                  #Resistance2 (in ohm)
VBE = 0.7                         #Base-emitter voltage (in volts)
RE = 1.0 * 10**3                  #Emitter resistance (in ohm)
VCC = 5                           #Collector supply voltage (in volts)

#Calculation

VA = VCC * R2/(R1 + R2)           #Voltage at A (in volts)
IE = (VA - VBE)/RE                #Emitter current (in Ampere)
VCEQ = VCC - IE*RE                #Q-point VCE (in volts)
ICQ = IE                          #Q-point IC (in Ampere) 

#Result

print "VCEQ : ",VCEQ,"V."
print "ICQ : ",ICQ * 10**3,"mA."
VCEQ :  3.2 V.
ICQ :  1.8 mA.

Example 7.26 , Page Number 250

In [15]:
#Variables

beta = 100                       #current gain in CE 
VCC = 12                         #Collector supply voltage (in volts)
R1 = 15.0 * 10**3                #Resistance1 (in ohm)
R2 = 2.7 * 10**3                 #Resistance2 (in ohm)
VBE = 0.7                        #Base-emitter voltage (in volts)
RE = 1.0 * 10**3                 #Emitter resistance (in ohm)
RC = 1.0 * 10**3                 #Collector resistance (in ohm)

#Calculation

VA = VCC*R2/(R1 + R2)            #Potential at A (in volts)
IE = (VA - VBE)/RE               #Emitter current (in Ampere)
IC = IE                          #Collector current (in Ampere) 
VCEQ = VCC - IC*(RC + RE)        #VCE at Q (in volts)
ICQ = IE                         #IC at Q (in volts)
IB = IC/beta                     #Base current (in Ampere) 

#Result

print "VCEQ : ",round(VCEQ,2),"V.\nICQ : ",round(ICQ*10**3,2),"mA."
print "IB : ",round(IB * 10**6,1),"micro-A."
VCEQ :  9.74 V.
ICQ :  1.13 mA.
IB :  11.3 micro-A.

Example 7.27 , Page Number 250

In [18]:
#Variables

VCC = 16                 #Collector supply voltage (in volts)
RC = 3.0 * 10**3         #Collector resistance (in ohm)
RE = 2.0 * 10**3         #Emitter resistance (in ohm)
R1 = 56.0 * 10**3        #Resistance1 (in ohm)
R2 = 20.0 * 10**3        #Resistance2 (in ohm)
alpha = 0.985            #Current gain in CB 

#Calculation

beta = alpha/(1-alpha)   #Current gain in CE
VBE = 0.3                #Base-emitter voltage (in volts)
VB = VCC * R2/(R1 + R2)  #Base voltage (in volts)
IC = (VB - VBE)/RE       #Collector current (in Ampere)
VCE = VCC - IC*(RE + RC) #Collector-emitter voltage (in volts)
Rth = R1*R2/(R1 + R2)    #Thevenin's eq. resistance (in ohm)
S = (1 + beta)*(1 + Rth/RE)/(1 + beta + Rth/RE)          #Stability factor

#Result

print "Operation point : ICQ = ",round(IC*10**3,3),"mA , VCQ = ",round(VCE,3),"V."
print "Stability factor : ",round(S,2),"."
Operation point : ICQ =  1.955 mA , VCQ =  6.224 V.
Stability factor :  7.54 .

Example 7.28 , Page Number 251

In [21]:
#Variables

VCC = 20                 #Collector supply voltage (in volts)
RL = 4.0 * 10**3         #Load resistance (in ohm)
VCE = 6.0                #Collector-emitter voltage (in volts)
IC = 2.0 * 10**-3        #Collector current (in Ampere)
beta=hfe = 20            #Current gain in CE
ICO = 10 * 10**-6        #Reverse saturation current (in Ampere)
VBE = 0.7                #Base-emitter voltage (in volts)

#Calculation

IB = (IC - (1 + beta)*ICO)/beta    #Base current (in Ampere)
IC = beta*IB + (1 + beta)*ICO      #Collector current (in Ampere)
IE = (beta + 1)*IB                 #Emitter current (in Ampere)
RE = (VCC - IC*RL - VCE)/IE        #Emitter resistance (in ohm)
Rth = 20.0 * 10**3                 #Thevenin's eq. resistance (in ohm)
Vth = IB*Rth + VBE + IE*RE         #Thevenin's eq. voltage (in volts)
R1 = Rth*VCC/Vth                   #Resitance1 (in ohm)
R2 = R1*Vth/(VCC - Vth)            #Resistance2 (in ohm)  

#Result

print "R1 : ",round(R1*10**-3,1),"kilo-ohm.\nR2 : ",round(R2*10**-3,2),"kilo-ohm."

#Slight variation due to higher precision.
0.002 8.95e-05 0.0018795 3192.33838787 20000.0 8.49
R1 :  47.1 kilo-ohm.
R2 :  34.75 kilo-ohm.

Example 7.29 , Page Number 252

In [26]:
import math
import numpy
%matplotlib inline
from matplotlib.pyplot import plot,title,xlabel,ylabel,ylim,xlim,annotate

#Variables

beta = 100

#Calculation

ICQ = 1.07                #Collector current at Q-point (in milli-Ampere)
VCQ = 5.067               #Collector-emitter voltage at Q-point (in volts)

#Result

print "Following is the graph: "

x = numpy.linspace(0,5.07,100)
y1 = numpy.linspace(0,1.07/2,100)
x1 = numpy.linspace(0,5.067/2,100)
plot(x,1.07-1.07/5.07*x,'b')
plot(x1,1.07/2+x1-x1,'--',color='g')
plot(5.067/2+y1-y1,y1,'--',color='g')
annotate('Q - POINT',xy=(5.067/2,1.07/2))
xlim(0,6)
ylim(0,1.1)
title("DC Load line")
xlabel("-VCE in Volts->")
ylabel("-IC in mA->")
Following is the graph: 
Out[26]:
<matplotlib.text.Text at 0x637cf70>

Example 7.30 , Page Number 253

In [36]:
#Variables

beta = 50                        #current gain in CE 
VCC = 12                         #Collector supply voltage (in volts)
VBE = 0.7                        #Base-emitter voltage (in volts)
RB = 100.0 * 10**3               #Base resistance (in ohm)
RC = 2.0 * 10**3                 #Collector resistance (in ohm)

#Calculation

IB = (VCC - VBE)/(beta*RC + RB)  #Base current (in Ampere)  
IC = beta * IB                   #Collector current (in Ampere)
VCE = VCC - IC*RC                #Collector-emitter voltage (in volts)
VCE1 = 5                         #New collector-emitter voltage (in volts) 
IC1 = (VCC - VCE1)/RC            #Collector current1 (in Ampere)
IB1 = IC1/beta                   #Base current1 (in Ampere)
RB1 = (VCC - VBE - beta*IB1*RC)/IB1         #Base resistance1 (in ohm)

#Result

print "Value of RB :",round(RB1*10**-3,2)," kilo-ohm."
Value of RB : 61.43  kilo-ohm.

Example 7.31 , Page Number 254

In [41]:
#Variables

beta = 100.0                         #Current gain in CE
RC = 1.0 * 10**3                     #Collector resistance (in ohm)
VCC = 20.0                           #Collector supply voltage (in volts)
VBE = 0                              #Base-emitter voltage (in volts)
VCEQ = 4                             #VCE at Q-point (in volts) 

#Calculation

I1C = (VCC - VCEQ)/RC                #Collector current1 (in Ampere)
IC = I1C/(1+1/beta)                  #Collector current (in Ampere)
IB = I1C - IC                        #base current (in Ampere)
RB = (VCEQ + VBE)/IB                 #Base resistance (in ohm)
S = (1 + beta)/(1 + beta*RC/(RB + RC))      #Stability factor

#Result

print "Value of collector to base resistance :",RB*10**-3,"kilo-ohm."
print "Stability factor :",S,"."

#Slight variation due to higher precision.
0.016 0.0158415841584 0.000158415841584
Value of collector to base resistance : 25.25 kilo-ohm.
Stability factor : 21.0 .

Example 7.32 , Page Number 254

In [16]:
#Variables 

beta = 50                        #Current gain in CB
VCC = 10                         #Collector supply voltage (in volts)
RC = 2.0 * 10**3                 #Collector resistance (in ohm)
VBE = 0                          #Base-emitter voltage (in volts)
RB = 100 * 10**3                 #Base resistance (in ohm) 

#Calculation

IB = VCC/(RB + (1 + beta)*RC)    #Base current (in Ampere)
IC = beta*IB                     #Collector current (in Ampere)
VCE = VCC - (IC + IB)*RC         #Collector-emitter voltage (in volts)
ICQ = IC                         #IC at Q-point (in Ampere)
S = (1 + beta)/(1 + beta*RC/(RC + RB))    #Stability factor

#Result

print "ICQ : ",round(ICQ * 10**3,3),"mA , VCEQ : ",round(VCE,2),"V."
print "Stability factor : ",round(S,2),"."
ICQ :  2.475 mA , VCEQ :  4.95 V.
Stability factor :  25.75 .

Example 7.33 , Page Number 255

In [43]:
#Variables

betamax = 180                    #Current gain max. in CE
betamin = 60                     #Current gain min. in CE
VCC = 15                         #Collector supply voltage (in volts)
RB = 250.0 * 10**3               #Base resistance (in ohm)
RC = 2.5 * 10**3                 #Collector resistance (in ohm) 
VBE = 0.7                        #Base-collector voltage (in volts)

#Calculation

#IC = (VCC - VBE)/(RC + RC/beta + RB/beta)          #Collector current (in Ampere)
ICmax = (VCC - VBE)/(RC + RC/betamax + RB/betamax)  #Max. collector current (in Ampere)
ICmin = (VCC - VBE)/(RC + RC/betamin + RB/betamin)  #Min. collector current (in Ampere) 

#Result

print "Maximum collector current : ",round(ICmax*10**3,2),"mA."
print "Minimum collector current : ",round(ICmin*10**3,2),"mA."
Maximum collector current :  3.66 mA.
Minimum collector current :  2.13 mA.

Example 7.34 , Page Number 256

In [44]:
#Variables

beta = 90                        #Current gain in CE
VCC = 18                         #Collector supply voltage (in volts)
RB = 510.0 * 10**3               #Base resistance (in ohm)
RC = 2.2 * 10**3                 #Collector resistance (in ohm) 
RE = 1.8 * 10**3                 #Emitter resistance (in ohm)  
VBE = 0.7                        #Base-collector voltage (in volts)

#Calculation

IB = VCC/(RB + (1 + beta)*(RC+RE))    #Base current (in Ampere)
IC = beta*IB                          #Collector current (in Ampere)
VCE = VCC - (IC + IB)*RC -IE*RE       #Collector-emitter voltage (in volts)

#Result

print "When beta increases due to temperature , VCE will decrease."
When beta increases due to temperature , VCE will decrease.

Example 7.35 , Page Number 257

In [55]:
#Variables

beta = 90.0                      #Current gain in CE
VCC = 10                         #Collector supply voltage (in volts)
RB = 250.0 * 10**3               #Base resistance (in ohm)
RC = 4.7 * 10**3                 #Collector resistance (in ohm) 
RE = 1.2 * 10**3                 #Emitter resistance (in ohm)  
VBE = 0.7                        #Base-collector voltage (in volts)
beta1 = 135                      #New current gain in CE

#Calculation

IC = (VCC-VBE)/((RE+RC)*(1/beta + 1) + RB/beta)#Collector current (in Ampere)
ICQ = IC                                   #Collector current at Q-point (in Ampere)
IB = IC/beta                               #Base current (in Ampere)
VCE = VCC - (IC + IB)*(RC+RE)              #Collector-emitter voltage (in volts)
VCEQ = VCE                                 #Collector-emitter voltage at Q-point (in volts)
ICQ1 = (VCC-VBE)/((RE+RC)*(1/beta1 + 1) + RB/beta1) #Collector current1 at Q-point (in Ampere)
IB1 = ICQ1/beta                            #Base current1 (in Ampere) 
VCEQ1 = VCC - (ICQ1 + IB)*(RC+RE)          #Collector-emitter voltage (in volts)

#Result


print "Old ICQ :",round(ICQ*10**3,2),"mA and new ICQ :",round(ICQ1*10**3,3),"mA."
print "Old VCEQ :",round(VCEQ,2),"V and new VCEQ :",round(VCEQ1,2),"V."

#Slight variation due to higher precision.
Old ICQ : 1.06 mA and new ICQ : 1.2 mA.
Old VCEQ : 3.65 V and new VCEQ : 2.85 V.

Example 7.36 , Page Number 258

In [60]:
#Variables

VCC = 15                           #Collector supply voltage (in volts) 
IE = 1.0 * 10**-3                  #Emitter current (in Ampere)
beta = 99                          #Current gain in CE
VBE = 0.7                          #Base-emitter voltage (in volts)
R1 = 17.0 * 10**3                  #Resistance1 (in ohm)
RC = 1.0 * 10**3                   #Collector resistance (in ohm)
RE = 1.0 * 10**3                   #Emitter resistance (in ohm)

#Calculation

IB = (IE)/(beta + 1)               #Base current (in Ampere)
IC = beta*IB                       #Collector current (in Ampere)
IR1 = (VBE + IE*RE)/R1             #Current through R1 (in Ampere)
IRF = IR1 + IB                     #Current through RF (in Ampere)
I1C = IC + IRF                     #Current through RC (in Ampere)
Vo = VCC - I1C*RC                  #Output voltage (in volts)
RF = (Vo - VBE - IE*RE)/IRF        #Resistance RF (in ohm) 

#Result

print "Vo : ",round(Vo,1),"V."
print "RF : ",round(RF*10**-3,2),"kilo-ohm."

#Calculation error in book for value of RF.
Vo :  13.9 V.
RF :  110.91 kilo-ohm.

Example 7.37 , Page Number 258

In [65]:
#Variables

VCC = 24                           #Collector supply voltage (in volts)
VBE = 0.7                          #Base-emitter voltage (in volts)
RC = 10.0 * 10**3                  #Collector resistance (in ohm)
RE = 270.0                         #Emitter resistance (in ohm)
VCE = 5                            #Collector-emitter voltage (in volts) 
beta = 45                          #Current gain in CE

#Calculation

IE = (VCC - VCE )/(RC + RE)        #Emitter current (in Ampere)
IB = IE/(beta + 1)                 #Base current (in Ampere)
RB = (VCC - VBE - IE*(RE + RC))/IB #Base resistance (in ohm)

#Result


print "R : ",round(RB*10**-3,1),"kilo-ohm."

#Slight variation due to higher precision.
R :  106.9 kilo-ohm.

Example 7.38 , Page Number 259

In [71]:
#Variables

VCC = 20                           #Collector supply voltage (in volts)
VBE = 0.7                          #Base-emitter voltage (in volts)
RE = 1.0 * 10**3                   #Emitter resistance (in ohm)
beta = 100                         #Current gain in CE
IC = 2.0 * 10**-3                  #Collector current (in Ampere)  
S = 10                             #Stability factor

#Calculation

IB = IC/beta                       #Base current (in Ampere)
IE = IB + IC                       #Emitter current (in Ampere)
Rth = beta*S*RE/(1 + beta - S) - RE #Thevenin's eq. resistance (in ohm)
Vth = IB*Rth + VBE + IE*RE         #Thevenin's eq. voltage (in volts) 
R1 = Rth*VCC/Vth                   #Resitance1 (in ohm)
R2 = R1*Vth/(VCC - Vth)            #Resistance2 (in ohm)  

#Result

print "Rth : ",round(Rth),"ohm."
print "IB : ",round(IB*10**6),"micro-A."
print "IE : ",round(IC*10**3,2),"mA."
print "Vth : ",round(Vth,1),"V."
print "R1 : ",round(R1*10**-3,1),"kilo-ohm."
print "R2 : ",round(R2*10**-3,1),"kilo-ohm."

#Slight variations due to higher precision.
Rth :  9989.0 ohm.
IB :  20.0 micro-A.
IE :  2.0 mA.
Vth :  2.9 V.
R1 :  68.4 kilo-ohm.
R2 :  11.7 kilo-ohm.

Example 7.39 , Page Number 266

In [94]:
import math
import numpy
%matplotlib inline
from matplotlib.pyplot import plot,title,xlabel,ylabel,ylim,xlim,annotate

#Variables

RC = 3.0 * 10**3                         #Collector resistance (in ohm)
RL = 12.0 * 10**3                        #Load resistance (in ohm)
R1 = 16.0 * 10**3                        #Resitance1 (in ohm)
R2 = 4.0 * 10**3                         #Resistance2 (in ohm)
RE = 2.0 * 10**3                         #Emitter Resistance (in ohm)
VCEcutoff = VCC = 20                     #Collector supply voltage (in volts)

#Calculation

IC = VCC/(RC + RE)                       #Collector current(in Ampere) 
VE = VCC*R2/(R1 + R2)                    #Voltage across R2 (in volts)
IE = VE/RE                               #Emitter current (in Ampere)
ICQ = IE                                 #IC at Q-point (in Ampere)
VCEQ  = VCC - ICQ*(RC + RE)              #VCE at Q-point (in Ampere)
Rac = RC*RL/(RC + RL)                    #AC resistance (in ohm)
ICsat = ICQ + VCEQ/Rac                   #IC saturation (in Ampere)
VCEoff = VCEQ + ICQ*Rac                  #VCE cut-off for ac load line (in volts)

#Result

print "Following is the graph of ac and dc load lines."

#Graph

x = numpy.linspace(0,20,100)
x2 = numpy.linspace(0,14.8,100)
y1 = numpy.linspace(0,2,100)
x1 = numpy.linspace(0,10,100)
plot(x,4-4/20.0*x,'b')
plot(x2,6.17-6.17/14.8*x2,'r')
plot(x1,2+x1-x1,'--',color='g')
plot(10+y1-y1,y1,'--',color='g')
annotate('Q',xy=(10,2.2))
annotate('DC load line',xy=(14,1.3))
annotate('AC load line',xy=(5.5,4))
xlim(0,20)
ylim(0,7)
title("DC and AC Load lines")
xlabel("-VCE in Volts->")
ylabel("-IC in mA->")
Following is the graph of ac and dc load lines.
Out[94]:
<matplotlib.text.Text at 0x858b350>

Example 7.40 , Page Number 268

In [95]:
#Variables

dVBE = 0.025                 #Change in VBE (in volts)
dIB = 15.0 * 10**-6          #Change in base current (in Ampere)
dIC = 1.2 * 10**-3           #Change in collector current (in Ampere)
RC = 6.0 * 10**3             #Collector resistance (in ohm)
RL = 12.0 * 10**3            #Load resistance (in ohm)

#Calculation

Rin = dVBE/dIB               #Input resistance (in ohm)
beta = dIC/dIB               #Current gain in CE
Rac = RC*RL/(RC+RL)          #AC load (in ohm)
Av = beta*Rac/Rin            #Voltage gain 
Ap = beta*beta*Rac/Rin       #Power gain      

#Result

print "Input resistance : ",round(Rin*10**-3,3),"kilo-ohm."
print "Current gain : ",beta,"."
print "AC load : ",Rac*10**-3,"kilo-ohm."
print "Voltage gain : ",Av,"."
print "Power gain : ",Ap,"."
Input resistance :  1.667 kilo-ohm.
Current gain :  80.0 .
AC load :  4.0 kilo-ohm.
Voltage gain :  192.0 .
Power gain :  15360.0 .