Chapter No.2: Bipolar junction Transistors(BJTs)

example 2.1 , Page No. 63

In [1]:
#Current amplification factors
import math
#variable declaration
deltaIB=50.0                               #in uA
deltaIC=1.0                                #in mA

#Calculations
deltaIC=deltaIC*10**3                    #in uA
Beta=deltaIC/deltaIB                     #unitless
Alfa=Beta/(1+Beta)                       #unittless

#Result
print("Current Amplification Factor,Beta :%.0f"%Beta)
print("Current Amplification Factor,Alfa :%.3f or 20/21"%(Alfa))
Current Amplification Factor,Beta :20
Current Amplification Factor,Alfa :0.952 or 20/21

example 2.2, Page No.63

In [127]:
#Value of IE
import math
#variable Declaration
IB=25.0                       #in uA
Beta=40.0                     #unitless

#Calculations
IC=Beta*IB                    #in uA
IE=IB+IC                      #in uA

#Result
print("The value of IE : %.0f micro Ampere"%IE)
The value of IE : 1025 micro Ampere

example 2.3, page No.63

In [128]:
#Change in collector current
import math
#variable declaration
alfa=0.98                          #unitless
deltaIB=0.2                        #in mA

#calculations
Beta=alfa/(1-alfa)                 #unitless
deltaIC=Beta*deltaIB               #in mA

#result
print("Change in collector curent :%.0f mA "% (deltaIC))
Change in collector curent :10 mA 

example 2.4, Page No.64

In [129]:
#nput current in CE and CB configuration
import math
#variable declaration
Beta=45                               #unitless
RL=1.0                                #in kOhm
deltaVCE=1                            #in volt


#calculation

#(i)
IC=deltaVCE/(RL*1000)                 #in Ampere
#Formula : Beta=deltaIC/deltaIB
IB=IC/Beta                            #in Ampere

#(ii)
IC=deltaVCE/(RL*1000)                 #in Ampere
#Formula : Beta=deltaIC/deltaIB
IE=IB+IC                              #in Ampere

#result
print("Part (i) : CE coniguration\n")
print("Input Base Current, IB in mA :%.3f "%(IB*10**3))
print("\nPart (ii) : CB coniguration\n")
print("Input Emitter Current, IE in mA :%.3f "%(IE*10**3))
Part (i) : CE coniguration

Input Base Current, IB in mA :0.022 

Part (ii) : CB coniguration

Input Emitter Current, IE in mA :1.022 

example 2.5, Page No.64

In [130]:
#Current gain and base current
import math
#variable declaration
Ileakage=12.5                       #in uA
ICBO=12.5                           #in uA
IE=2                                #in mA
IC=1.97                             #in mA

#calculation
#Formula : IC=alfa*IE+ICBO
alfa=(IC-ICBO/10**3)/IE             #unitless
IB=IE-IC                            #in mA

#result
print("Current Gain : %.3f"%(math.floor(alfa*1000)/1000))
print("Base current in mA : %.2f"%IB)
Current Gain : 0.978
Base current in mA : 0.03

example 2.6, Page No.64

In [131]:
#Input resistance of transistor
import math
#variable declaration
deltaVBE=200.0                        #in mVolt
deltaIB=100                           #in uA

#calculations
ri=deltaVBE*10**-3/(deltaIB*10**-6)   #in Ohm

#Result
print("Input resistane of transistor in kohm :%.0f"%(ri/1000))
Input resistane of transistor in kohm :2

example 2.7, Page No.64

In [132]:
#Dynamic input resistance
import math
#variable declaration
deltaVEB=200.0                         #in mVolt
deltaIE=5.0                            #in mA

#calculation
ri=deltaVEB*10**-3/(deltaIE*10**-3)    #in Ohm

#Result
print("Input resistane of transistor in Ohm :%.0f"%ri)
Input resistane of transistor in Ohm :40

example 2.9, Page No.72

In [133]:
#Current gain input resistance and voltage gain
import math
#variable declaration
Ri=500.0                              #in Ohm
RL=1.0                                #in kOhm
hie=1.0                               #in kOhm
hre=2.0*10**-4                        #unitless
hfe=50.0                              #unitless
hoe=25.0                              #micro mho

#Calculations
#Part (a) :
Ai=-hfe/(1+hoe*10**-6*RL*10**3)                       #unitless
#Part (b) :
Rin=(hie*10**3)-(hre*hfe/((hoe*10**-6)+1/(RL*10**3)))     #in Ohm
#Part (c) :
Av=Ai*RL*10**3/Ri                                     #unitless

#Result
print("(a)\nCurrent Gain :%.1f "%Ai)
print("(b)\nInput Resistance in Ohm :%.2f"%Rin)
print("(c)\nVoltage Gain :%.1f "%Av)
(a)
Current Gain :-48.8 
(b)
Input Resistance in Ohm :990.24
(c)
Voltage Gain :-97.6 

example 2.10, Page No.78

In [134]:
#Collector emitter saturation voltage
import math

#variable declaration
alfaF=0.99                          #unitless
alfaR=0.20                          #unitless
IC=1.0                              #in mA
IB=50.0                             #in micro Ampere
T=300                               #in kelvin
k=1.38*10**-23                      #Boltzman constant
e=1.6*10**-19                       #in cooulamb

#Calculation
Vth=k*T/e                           #in Volt
VCEsat=Vth*math.log(((IC*10**-3*(1-alfaR)+IB*10**-6)*alfaF)/((alfaF*IB*10**-6-(1-alfaF)*IC*10**-3)*alfaR))

#Result
print("Collector-Emitter saturation voltage in volt :%.3f"%VCEsat)
Collector-Emitter saturation voltage in volt :0.121

example 2.11, Page No.78

In [135]:
#Relative size of collector junction
import math
#variable declaration
IES=10**-14                                 #in A
alfaF=1                                     #unitless
alfaR=0.1                                   #unitless

#Calculations
#Formula : alfaF*IES=alfaR*ICS
ICS=(alfaF/alfaR)*IES                       #in Ampere
RelativeSize=ICS/IES                        #unitless
BetaR=alfaR/(1-alfaR)                       #unitless

#Result
print("Collector base junction saturation current in Ampere : %.1f * 10^-12"%(ICS*10**12))
print("\nCollector is %.0f times larger in size than emitter"%RelativeSize)
print("\nValue of BetaR :%.2f "%BetaR)
Collector base junction saturation current in Ampere : 0.1 * 10^-12

Collector is 10 times larger in size than emitter

Value of BetaR :0.11 

example 2.12, Page No.87

In [178]:
#DC load line and operating point
import math
#variable declaration
Beta=100                                #unitless
VCC=6                                   #in volt
RB=530                                  #in kOhm
RC=2                                    #in kOhm
VBE=0.7                                 #in volt(For Si)

#Part (i)
IC1=0                                   #in A
VCE1=VCC-IC1*RC                         #in volt
#If VCE=0                               #in volt
VCE2=0                                  #in volt
IC2=VCC/RC                              #in Ampere
################------------PLOT------------#############
t = arange(0.0001,6 , 0.0005)
t2 = arange(0.0001, 4, 0.0005)
a=arange(0.001,1,0.0005)
x=(4*a)/a
plot(t2,1*t2/t2,'--')
plot(x,a,'--')
plot(t,(3-0.5*t),'b')
text(4,1.1,'Q(4,1)')
text(0.1,3.05,'A')
text(6.05,0.1,'B')
xlabel('VCE(in volts)')
ylabel('IC(in mA)')
title('DC load line')
#########---------------------------------------##########
#Formula : VCC=VBE+IB*RB
IB=(VCC-VBE)/(RB*10**3)                 #in Ampere
IC=Beta*IB;#in Ampere
VCE=VCC-IC*RC*10**3                     #in volt
print("Q point coordinates are :");
print("IC=%.1f mA and VCE=%.1f Volt."%((IC*10**3),(VCE)))
Q point coordinates are :
IC=1.0 mA and VCE=4.0 Volt.

example 2.13, Page No. 88

In [137]:
#RB and new value of IC
import math
#variable declaration
Beta=100.0                        #unitless
IC=1.0                            #in mA
VCC=12.0                          #in volt
VBE=0.3                           #in volt(For Ge)

#calculation

#Part (i)
IB=IC/Beta                        #in mA
#Formula : VCC=VBE+IB*RB
RB=(VCC-VBE)/(IB*10**-3)          #in Ampere

#part (ii)
Beta=50                           #unitless
IB=(VCC-VBE)/RB                   #in Ampere
IC=Beta*IB                        #in Ampere

#Result
print("Resistance RB in kOhm : %.0f"%(RB/10**3))
print("Zero signal IC in mA:%.1f"%(IC*10**3))
Resistance RB in kOhm : 1170
Zero signal IC in mA:0.5

example 2.14, Page No.88

In [138]:
#Set the operating point
import math
print("To set the required operating point, value of RB will be find out.")

#variable declaration
IC=1.0                                          #in mA
VCE=8.0                                         #in volt
Beta=100.0                                      #unitless
VCC=12.0                                        #in volt
VBE=0.3                                         #in volt(For Ge)

#calculation

#Part (i)
RC=(VCC-VCE)/(IC*10**-3)                      #in ohm
IB=IC/Beta                                    #in mA
RB=(VCC-VBE-Beta*(IB*10**-3)*RC)/(IB*10**-3)  #in Ohm

#Part (ii)
Beta=50                                       #unitless
IB=(VCC-VBE)/(RB+Beta*RC)                     #in mA
IC=Beta*IB                                    #in Ampere
VCE=VCC-IC*RC                                 #in volt

#Result
print("Value of RB in kOhm : %.0f"%(RB/1000))
print("New operating point is %.1f V,%.1f mA"%(VCE,IC*10**3))
To set the required operating point, value of RB will be find out.
Value of RB in kOhm : 770
New operating point is 9.6 V,0.6 mA

example 2.15, Page No. 93

In [139]:
#Value of IC
import math
#variable declaration
R1=50.0                                 #in kohm
R2=10.0                                 #in kohm
RE=1.0                                  #in kohm
VCC=12.0                                #in volt

#calaculation

#Part (i)
VBE=0.1                                   #in volt
VBBdash=(R2/(R1+R2))*VCC                  #in volt
IC1=(VBBdash-VBE)/(RE*1000)               #in mA

#Part (ii)
VBE=0.3                                   #in volt
IC2=(VBBdash-VBE)/(RE*1000)               #in mA

#result
print("At VBE=0.1V, Value of IC in mA : %.1f"%(IC1*1000))
print("At VBE=0.3V, Value of IC in mA : %.1f"%(IC2*1000))
At VBE=0.1V, Value of IC in mA : 1.9
At VBE=0.3V, Value of IC in mA : 1.7

example 2.16, Page No.94

In [3]:
#Operating point and stability factor
import math
#variable declaration
R1=10.0                             #in kohm
R2=5.0                              #in kohm
RE=2.0                              #in kohm
RC=1.0                              #in kohm
VCC=12.0                            #in volt
Beta=100.0                          #unitless
VBE=0.7                             #in volt


#calculation

#Part (i)
#Formula : VBE=VBBdash-IB*RBdash-IE*RE
VBBdash=(R2/(R1+R2))*VCC          #in volt
IE=(VBBdash-VBE)/(RE*10**3)       #in Ampere
IC=IE                             #in mA
#Formula : VCC=IC*RC+VCE+IE*RE
VCE=VCC-IC*RC*10**3-IE*RE*10**3   #in Volt

#Part (ii)
RBdash=(R1*R2/(R1+R2))             #in kOhm
S=(Beta+1)/(1+Beta*(RE/(RBdash+RE)))

#Result
print("IB is ver small : VBE=VBBdash-IE*RE")
print("As base current is very small IC=IE\n")
print("Operating point is %.3f V, %.3f mA\n"%(VCE,IC*10**3))
print("Staility factor S is : %.2f"%(S))
IB is ver small : VBE=VBBdash-IE*RE
As base current is very small IC=IE

Operating point is 7.050 V, 1.650 mA

Staility factor S is : 2.62

example 2.17, Page No. 97

In [2]:
#IC and VCE
import math
#variable declaration
R1=200.0                           #in kohm
R2=100.0                           #in kohm
RE=1.0                             #in kohm
RC=1.0                             #in kohm
VCC=9.0                            #in volt
he=2.0                             #in kohm
hfe=100.0                          #unitless
hoe=0.0                            #unitless
hre=0.0                            #unitless
VBE=0.7                            #in volt(For Si)

#Calculation

#Part (i)
RB=R1*R2/(R1+R2)                                      #in kohm
VBBdash=(R2/(R1+R2))*VCC                              #in volt
#Applying Kirchoff Law 
IB=(VBBdash-VBE)/(RB*10**3+RE*10**3*(1+hfe))          #in Ampere
IC=hfe*IB                                             #in Ampere

#Part (ii)
#Applying Kirchoff Law 
VCE=VCC-IC*RC*10**3-RE*1063*IB*(hfe+1)                #in volt

#Result
print("Value of IC in mA : %.2f"%(IC*10**3))
print("VCE in volt :%.3f"%VCE)
#Note : Ans of VCE is wrong in the book as VCC=10 V has been taken instead of 9 volt.
Value of IC in mA : 1.37
VCE in volt :6.155

example 2.18, Page No.99

In [142]:
#Region of Q point
import math
#variable declaration
RB=50.0                                               #in kohm
RC=3.0                                                #in kohm
VCC=10.0                                              #in volt
VEE=5.0                                               #in volt
hfe=100.0                                             #unitless
VCEsat=0.2                                            #in volt 
VBEsat=0.8                                            #in volt
VBEactive=0.7                                         #in volt
VBE=0.7                                               #in volt(For Si)

#Calculations

#Applying : Kirchoff 2nd Law : VEE-RB*IB-VBE=0
IB=(VEE-VBE)/(RB*10**3)                               #in Ampere
IC=hfe*IB                                             #in Ampere 
#Applying Kirchoff 2nd Law to collector-emitter loop: VCC-IC*RC-VCB-VBEactive=0
VCB=VCC-IC*RC*10**3-VBEactive                         #in volt:
IB=(VEE-VBEsat)/(RB*10**3)                            #in Ampere
IC=(VCC-VCEsat)/(RC*10**3);

#result
print("Collector to base voltage, VCB :%.1fV"%VCB)
print("\nThis shows that the base collector junction is forward biased. This implies that the transistor is in saturation region.")
print("\nValue of IB in mA :%.3f"%(IB*10**3))
print("\nValue of IC in mA :%.2f"%(IC*10**3))
Collector to base voltage, VCB :-16.5V

This shows that the base collector junction is forward biased. This implies that the transistor is in saturation region.

Value of IB in mA :0.084

Value of IC in mA :3.27

example 2.19, Page No.100

In [143]:
#Voltage across RE
import math
#variable declaration
VCC=20.0                                         #in volt
VBE=0.7                                          #in volt(For Si)
Beta=50.0                                        #unitless
RE=200.0                                         #in ohm
R1=60.0                                          #in kohm
R2=30.0                                          #in kohm

#calculation
V2=VCC*R2/(R1+R2)                              #in volt
VEO=V2-VBE                                     #in volt

#result
print("Voltage across RE in volt : %.2f"%VEO)
Voltage across RE in volt : 5.97