# Chapter3-The Bipolar Junction Transistor¶

## Ex1-pgpg104¶

In [1]:
import math

##Example 3.1
##let beta be "b"
b=150.;##common emitter current gain
iB=15*10**-3;##(mA) base current
##assume transistor biased in forward active mode
iC=b*iB;
print"%s %.2f %s"%('\ncollector current= ',iC,' mA\n')
iE=(1.+b)*iB;
print"%s %.2f %s"%('\nemitter current= ',iE,' mA\n')
a=b/(1.+b);
print"%s %.2f %s"%('\ncommon base current gain=',a,'')

collector current=  2.25  mA

emitter current=  2.27  mA

common base current gain= 0.99


## Ex2-pg113¶

In [2]:
import math
#calculate the
##Example 3.2
b=100.;##common emitter current gain
BVcbo=120.;##(V) break down voltage of the B-C junction
n=3.;##empirical constant
BVceo=BVcbo/(b)**(1./n);
print"%s %.2f %s"%('\nbreakdown voltage= ',BVceo,' V\n')

breakdown voltage=  25.85  V



## Ex3-pg115¶

In [3]:
import math

##Example 3.3
Vbb=4.;##(V)
Rb=220.##(KOhm);
Rc=2.;##(KOhm)
Vcc=10.;##(V)
Vbe=0.7;##(V)
b=200.;
##from fig.3.19(b)
Ib=(Vbb-Vbe)/Rb;
print"%s %.2f %s"%('\nbase current= ',Ib,' mA\n')
Ic=b*Ib;
print"%s %.2f %s"%('\ncollector current= ',Ic,' mA\n')
Ie=(1.+b)*Ib;
print"%s %.2f %s"%('\nemitter current= ',Ie,' mA\n')
Vce=Vcc-Ic*Rc;
print"%s %.2f %s"%('\ncollector emitter voltage= ',Vce,' V\n')

base current=  0.01  mA

collector current=  3.00  mA

emitter current=  3.01  mA

collector emitter voltage=  4.00  V



## Ex4-pg116¶

In [4]:
import math

##Example 3.4
Vbb=1.5;##(V)
Rb=580.;##(KOhm)
Veb=0.6;##(V)
Vcc=5.;##(V)
b=100.;
##writing Kirchhoff voltage law equation around E-B loop
Ib=(Vcc-Veb-Vbb)/Rb;
print"%s %.2f %s"%('\nbase current= ',Ib,' mA\n')
Ic=b*Ib;
print"%s %.2f %s"%('\ncollector current= ',Ic,' mA\n')
Ie=(1.+b)*Ib;
print"%s %.2f %s"%('\nemitter current=',Ie,' mA\n')
Vec=(1./2.)*Vcc;
print"%s %.2f %s"%('\nce voltage= ',Vec,' V\n')
Rc=(Vcc-Vec)/Ic;
print"%s %.2f %s"%('\ncollector resistance= ',Rc,' KOhm\n')

base current=  0.01  mA

collector current=  0.50  mA

emitter current= 0.51  mA

ce voltage=  2.50  V

collector resistance=  5.00  KOhm



## Ex5-pg119¶

In [5]:
import math

##Example 3.5
b=100.;
Vbe=0.7;##(V)
Vce=0.2;##(V)
Vbb=8.;##(v)
Rb=220.;##(KOhm)
Ib=(Vbb-Vbe)/Rb
print"%s %.2f %s"%('\nbase current= ',Ib,' mA\n')
##transistor in active region
Ic=b*Ib;
print"%s %.2f %s"%('\ncollector current= ',Ic,' mA\n')
Vcc=10.;##(V)
Rc=4.;##(KOhm)
Vce=Vcc-Ic*Rc;
print"%s %.2f %s"%('\ncollector emitter voltage= ',Vce,' V\n')
##saturation
Vce=0.2;##(V)
Ic=(Vcc-Vce)/Rc;
print"%s %.2f %s"%('\nsaturation collector current= ',Ic,' mA\n')
x=Ic/Ib
##which is <b
Ie=Ic+Ib;
print"%s %.2f %s"%('\nemitter current= ',Ie,' mA\n')

base current=  0.03  mA

collector current=  3.32  mA

collector emitter voltage=  -3.27  V

saturation collector current=  2.45  mA

emitter current=  2.48  mA



## Ex6-pg122¶

In [3]:
import numpy
import matplotlib
from matplotlib import pyplot
import math
%matplotlib inline
import warnings
warnings.filterwarnings('ignore')
#calculate the
##Example 3.6
Vbe=0.7;
b=75.;
##Q point values::
##using KVL eq around the B-E loop
##Vbb=Ib*Re+Vbe+Ie*Re
##assuming transistor is in forward biased mode we can write Ie=(1+b)*Ib
Vbb=6.;
Rb=25.;##KOhm
Re=0.6;##KOhm
Ib=(Vbb-Vbe)/(Rb+(1.+b)*Re);
print"%s %.2f %s"%('\nbase current= ',Ib,' mA\n')
Ic=b*Ib;
print"%s %.2f %s"%('\ncollector current= ',Ic,' mA\n')
Ie=(1+b)*Ib;
print"%s %.2f %s"%('\nemitter current= ',Ie,' mA\n')
Vcc=12.;
Rc=0.4;
Vce=Vcc-Ic*Rc-Ie*Re;
print"%s %.2f %s"%('\ncollector emitter voltage= ',Vce,' V\n')
##using KVL law around C-E loop
##Vce=Vcc-(Ic*(Rc+((1+B)/B)*Re));
Ic=numpy.array([0.12,5.63])
Vce=12.-(Ic)*1
pyplot.plot(Vce,Ic)
pyplot.xlabel("Vce")
pyplot.ylabel("Ic")
pyplot.show()

base current=  0.08  mA

collector current=  5.63  mA

emitter current=  5.71  mA

collector emitter voltage=  6.32  V



## Ex7-pg123¶

In [4]:
import math
import numpy
import matplotlib
from matplotlib import pyplot
%matplotlib inline
#calculate the
##Example 3.7
Vbe=0.65;
Vcc=5.;
Rc=0.5;##KOhm
b=100.;
V1=-5.;
Re=1.;##KOhm
## Q-point values :: writing KVL eq around B-E loop
Ie=(-V1-Vbe)/Re;
print"%s %.2f %s"%('\nemitter current= ',Ie,' mA\n')
Ib=(Ie/(1.+b));
print"%s %.2f %s"%('\nbase current= ',Ib,' mA\n')
Ic=(b/(1.+b))*Ie;
print"%s %.2f %s"%('\ncollector current= ',Ic,' mA\n')
Vce=Vcc-Ic*Rc-Ie*Re-V1;
print"%s %.2f %s"%('\ncollector emitter voltage= ',Vce,' V\n')
##Vce=Vcc-V1-(Ic*(Rc+((1+B)/B)*Re));

Vce=numpy.array([0,2,3.5,4,6,8,10])
Ic=(10.-Vce)/1.51;

pyplot.plot(Vce,Ic)
pyplot.xlabel("Vce")
pyplot.ylabel("Ic")


emitter current=  4.35  mA

base current=  0.04  mA

collector current=  4.31  mA

collector emitter voltage=  3.50  V


Out[4]:
<matplotlib.text.Text at 0x75078d0>

## Ex9-pg128¶

In [5]:
import math
import numpy
import matplotlib
from matplotlib import pyplot
%matplotlib inline
#calculate the
##Example 3.9
b=100.;
Vbe=0.7;
V1=-5.;
V2=12.;
Rb=10.;
Re=5.;
Rc=5.;
Rl=5.;
##Q point values:: using KVL eq around B-E loop
Ib=-(V1+Vbe)/(Rb+(1.+b)*Re);
print"%s %.2f %s"%('\nbase current= ',Ib,' mA\n')
Ic=b*Ib;
print"%s %.2f %s"%('\ncollector current= ',Ic,' mA\n')
Ie=(1.+b)*Ib;
print"%s %.2f %s"%('\nemitter current= ',Ie,' mA\n')
##at collector node we can write Ic=(V2-Vo)/Rc-Vo/Rl
Vo=(V2/Rc-Ic)*Rc*Rl/(Rc+Rl);
print"%s %.2f %s"%('\noutput voltage= ',Vo,' V\n')
Vce=Vo-Ie*Re-V1;
print"%s %.2f %s"%('\ncollector emitter voltage= ',Vce,' V\n')
Rth=Rl*Rc/(Rl+Rc);
print"%s %.2f %s"%('\nThevenin rquivalent resistance= ',Rth,' KOhm\n')
Vth=(Rl/(Rl+Rc))*V2;
print"%s %.2f %s"%('\nThevenin equivalent voltage= ',Vth,' V\n')
##fig.3.36(c) KVL law
##Vce=6-V1-Ic*Rth-Ie*Re;

Vce=numpy.array([0,2,4.7,3.5,4,6,8,10])
Ic=(11.-Vce)/7.5;

pyplot.plot(Vce,Ic)
pyplot.xlabel("Vce")
pyplot.ylabel("Ic")

base current=  0.01  mA

collector current=  0.83  mA

emitter current=  0.84  mA

output voltage=  3.91  V

collector emitter voltage=  4.70  V

Thevenin rquivalent resistance=  2.50  KOhm

Thevenin equivalent voltage=  6.00  V


Out[5]:
<matplotlib.text.Text at 0x34068b0>

## Ex10-pg132¶

In [22]:
import math
#calculate the
##Example 3.10
Rb=0.24;
Vcc=12.;
Vbe=0.7;
Vce=0.1;
b=75.;
Rc=5.;##Ohm
##for Vt=0 ,transistor is cut off,Ib=Ic=0,Vo=Vcc=12 V,power dissipation is zero
Vt=12.;##(V)
Ib=(Vt-Vbe)/Rb;
print"%s %.2f %s"%('\nbase current= ',Ib,' mA\n')
Ic=(Vcc-Vce)/Rc;
print"%s %.2f %s"%('\ncollector current= ',Ic,'A\n')
Ib=0.0471;##A
x=Ic/Ib
##since Ic/Ib<b transistor is in saturation
##Vo==Vcc;
Vo=0.1;
print"%s %.2f %s"%('\noutput voltage= ',Vo,' V\n')
P=Ic*Vce+Ib*Vbe;
print"%s %.2f %s"%('\npower dissipation= ',P,' W\n')

base current=  47.08  mA

collector current=  2.38 A

output voltage=  0.10  V

power dissipation=  0.27  W



## Ex13-pg138¶

In [23]:
import math

##Example 3.13
b=100.;
Vcc=12.;
Vbe=0.7;
Icq=1.;##mA
Vceq=6.;
Rc=(Vcc-Vceq)/Icq;
print"%s %.2f %s"%('\ncollector resistance= ',Rc,' KOhms\n')
Ibq=Icq/b;
print"%s %.2f %s"%('\nbase current= ',Ibq,' mA\n')
Rb=(Vcc-Vbe)/Ibq;
print"%s %.2f %s"%('\nbase resistance= ',Rb,' KOhms\n')

collector resistance=  6.00  KOhms

base current=  0.01  mA

base resistance=  1130.00  KOhms



## Ex14-pg141¶

In [28]:
import math

##Example 3.14
R1=56.;
R2=12.2;
Rc=2.;
Re=.4;
Vcc=10.;
Vbe=0.7;
b=100.;
##fig.3.53(b)
Rth=R2*R1/(R1+R2);
print"%s %.2f %s"%('\nThevenin rquivalent resistance= ',Rth,' KOhm\n')
Vth=(R2/(R1+R2))*Vcc;
print"%s %.2f %s"%('\nThevenin equivalent voltage= ',Vth,' V\n')
Ibq=(Vth-Vbe)/(Rth+(1.+b)*Re);
print"%s %.2f %s"%('\nbase current= ',Ibq,' mA\n')
Icq=b*Ibq;
print"%s %.2f %s"%('\ncollector current= ',Icq,' mA\n')
Ieq=(1.+b)*Ibq;
print"%s %.2f %s"%('\nemitter current= ',Ieq,' mA\n')
Vceq=Vcc-Icq*Rc-Ieq*Re;
print"%s %.2f %s"%('\ncollector emitter voltage= ',Vceq,' V\n')
b=numpy.array([50,100,150])
for x in range(0,150):
Ibq=(Vth-Vbe)/(Rth+(1.+x)*Re);
print("Ibeq,Iceq,Ieq,Vceq")
print(Ibq)
Icq=x*Ibq;
print(Icq)
Ieq=(1+x)*Ibq;
print(Ieq)
Vceq=Vcc-Icq*Rc-Ieq*Re;
print(Vceq)
print("")

Thevenin rquivalent resistance=  10.02  KOhm

Thevenin equivalent voltage=  1.79  V

base current=  0.02  mA

collector current=  2.16  mA

emitter current=  2.18  mA

collector emitter voltage=  4.81  V

Ibeq,Iceq,Ieq,Vceq
0.0155511811024
2.31712598425
2.33267716535
4.43267716535



## Ex15-pg142¶

In [29]:
import math

##Example 3.15
Vcc=5.;
Rc=1.;##KOhm
Vbe=0.7;
b=120.;
Vceq=3.;
Re=.510;
Icq=(Vcc-Vceq)/(Rc+Re);
print"%s %.2f %s"%('\ncollector current= ',Icq,' mA\n')
Ibq=Icq/b;
print"%s %.2f %s"%('\nbase current= ',Ibq,' mA\n')
##for bias stable circuit
Rth=0.1*(1.+b)*Re;
print"%s %.2f %s"%('\nThevenin rquivalent resistance= ',Rth,' KOhm\n')
##Ibq=(Vth-Vbe)/(Rth+(1+b)*Re)
Vth=Ibq*(Rth+(1.+b)*Re)+Vbe;
print"%s %.2f %s"%('\nThevenin equivalent voltage= ',Vth,' V\n')
##Vth=(R2/(R1+R2))*Vcc
##let x=(R2/(R1+R2))
x=Vth/Vcc
##Rth=6050=R1*x
R1=6.05/x;
print"%s %.2f %s"%('\nR1= ',R1,'KOhms\n')
R2=x*R1/(1-x);
print"%s %.2f %s"%('\nR2= ',R2,'KOhms\'')

collector current=  1.32  mA

base current=  0.01  mA

Thevenin rquivalent resistance=  6.17  KOhm

Thevenin equivalent voltage=  1.45  V

R1=  20.87 KOhms

R2=  8.52 KOhms'


## Ex16-pg146¶

In [30]:
import math

##Example 3.16
R1=10.;
b=50.;
Vbe=0.7;
V1=-5.;
I1=-(V1+Vbe)/R1;
print"%s %.2f %s"%('\nreference current= ',I1,' mA\n')
Iq=I1/(1.+2./b);
print"%s %.2f %s"%('\nbias current= ',Iq,' mA\n')
##Ib=Ib1=Ib2
Ib=Iq/b;
print"%s %.2f %s"%('\nbase current= ',Ib,' mA\n')

reference current=  0.43  mA

bias current=  0.41  mA

base current=  0.01  mA



## Ex17-pg148¶

In [31]:
import math
#calculate the
##Example 3.17
Vbe=0.7;
Vcc=10.;
V2=5.;
b=100.;
R1=100.;
R2=50.;
Re1=2.;
Rth=R2*R1/(R1+R2);
print"%s %.2f %s"%('\nThevenin rquivalent resistance= ',Rth,' KOhm\n')
Vth=(R2/(R1+R2))*Vcc-V2;
print"%s %.2f %s"%('\nThevenin equivalent voltage= ',Vth,' V\n')
##Vth=Ib1*Rth+Vbe+Ie1*Re1-5 and Ie1=(1+b)*Ib1
Ib1=(Vth+5-Vbe)/(Rth+(1+b)*Re1);
print"%s %.2f %s"%('\nIb1= ',Ib1,' mA\n')
Ic1=b*Ib1;
print"%s %.2f %s"%('\nIc1= ',Ic1,' mA\n')
Ie1=(1.+b)*Ib1;
print"%s %.2f %s"%('\nIe1= ',Ie1,' mA\n')
##summing the currents at the collector of Q1,Ir1+Ib2=Ic1
##(5-Vc1)/Rc1+Ib2=Ic1
##also Ib2=Ie2/(1+b)=(5-(Vc1+0.7))/(1+b)*Re2
Rc1=5.;
Re1=2.;
Re2=2.;
Rc2=1.5;
Vc1=Rc1*(1.+b)*Re2*((5./Rc1)+(4.3/((1.+b)*Re2))-Ic1)/(((1.+b)*Re2)+Rc1);
print"%s %.2f %s"%('\nVc1= ',Vc1,' V\n')
Ir1=(5.-Vc1)/Rc1;
print"%s %.2f %s"%('\nIr1= ',Ir1,' mA\n')
Ve2=Vc1+Vbe;
print"%s %.2f %s"%('\nVe2= ',Ve2,' V\n')
Ie2=(5-Ve2)/Re1;
print"%s %.2f %s"%('\nIe2= ',Ie2,' mA\n')
Ic2=Ie2*b/(1.+b);
print"%s %.2f %s"%('\nIc2= ',Ic2,' mA\n')
Ib2=Ie2/(1.+b);
print"%s %.2f %s"%('\nIb2 ',Ib2,' mA\n')
Ve1=Ie1*Re1-5;
print"%s %.2f %s"%('\nVe1= ',Ve1,' V\n')
Vc2=Ic2*Rc2-5.;
print"%s %.2f %s"%('\nVc2= ',Vc2,' V\n')
Vce1=Vc1-Ve1;
print"%s %.2f %s"%('\nVce1= ',Vce1,'V\n')
Vec2=Ve2-Vc2;
print"%s %.2f %s"%('\nVec2= ',Vec2,' V\n')

Thevenin rquivalent resistance=  33.33  KOhm

Thevenin equivalent voltage=  -1.67  V

Ib1=  0.01  mA

Ic1=  1.12  mA

Ie1=  1.13  mA

Vc1=  -0.48  V

Ir1=  1.10  mA

Ve2=  0.22  V

Ie2=  2.39  mA

Ic2=  2.36  mA

Ib2  0.02  mA

Ve1=  -2.74  V

Vc2=  -1.45  V

Vce1=  2.26 V

Vec2=  1.68  V