# Chapter5-The Field Effect Transistor¶

## Ex1-pg252¶

In [1]:
import math

##Example 5.1
Vtn=0.75;##(V)
W=40.*10**-6;##(cm)
L=4.*10**-6;##(cm)
u=650.;##(cm)
Iox=450.*10**-11;
e=3.9*8.86*10**-14;
Kn=W*u*e/(2.*L*Iox);
print"%s %.2f %s"%('\nconduction parameter= ',Kn,' mA/V^2\n')
Vgs=2.*Vtn;
i_D=Kn*(Vgs-Vtn)**2;
print"%s %.2f %s"%('\ndrain current= ',i_D,' mA\n')

conduction parameter=  0.25  mA/V^2

drain current=  0.14  mA



## Ex2-pg256¶

In [2]:
import math

##Example 5.2
Kp=0.2;##(mA/V^2)
Vtp=0.5;
iD=0.5;
Vsg=math.sqrt(iD/Kp)-Vtp;
print"%s %.2f %s"%('\nVgs= ',Vsg,' V\n')
##to bias in p channel MOSFET
Vsd=Vsg+Vtp;
print"%s %.2f %s"%('\nVsd= ',Vsd,' V\n')

Vgs=  1.08  V

Vsd=  1.58  V



## Ex3-pg264¶

In [3]:
import math

##Example 5.3
R1=30.;
R2=20.;
RD=20.;
Vdd=5.;
Vtn=1.;
Kn=0.1;
Vgs=R2*Vdd/(R1+R2);
print"%s %.2f %s"%('\nVgs= ',Vgs,' V\n')
I_D=Kn*(Vgs-Vtn)**2;
print"%s %.2f %s"%('\nthe drain current= ',I_D,' mA\n')
Vds=Vdd-I_D*RD;
print"%s %.2f %s"%('\ndrain to source voltage= ',Vds,' V\n')

Vgs=  2.00  V

the drain current=  0.10  mA

drain to source voltage=  3.00  V



## Ex4-pg265¶

In [4]:
import math

##Example 5.4
R1=50.;
R2=50.;
RD=7.5;
Vdd=5.;
Vtp=-0.8;
Vg=2.5;
Kp=0.2;
Vo=R2*Vdd/(R1+R2);
print"%s %.2f %s"%('\nVo= ',Vo,' V\n')
Vsg=Vdd-Vg;
print"%s %.2f %s"%('\nsource to gate voltage= ',Vsg,' V\n')
I_D=Kp*(Vsg+Vtp)**2;
print"%s %.2f %s"%('\nthe drain current= ',I_D,' mA\n')
Vsd=Vdd-I_D*RD;
print"%s %.2f %s"%('\nsource to drain voltage= ',Vsd,' V\n')

Vo=  2.50  V

source to gate voltage=  2.50  V

the drain current=  0.58  mA

source to drain voltage=  0.67  V



## Ex6-pg269¶

In [5]:
import math

##Example 5.6
Vtn=2.;
Kn=80.*10**-3;
##x=W/L
x=4.;
I_D=0.5;
##I_D=Kn*x*((Vgs-Vtn)^2)/2;
Vgs=math.sqrt(I_D*2./(Kn*x))+2.;
print"%s %.2f %s"%('\nVgs= ',Vgs,' V\n')
##y=R1+R2
Rs=2.;
y=10./0.05;
print"%s %.2f %s"%('\nR1+R2= ',y,' Kohm\n')
##Vgs=Vg-Vs=(R2/(R1+R2)*10-5)-I_D*Rs+5
R2=(y/10.)*(Vgs+I_D*Rs);
print"%s %.2f %s"%('\nR2= ',R2,' KOhm\n')
R1=y-R2;
print"%s %.2f %s"%('\nR1= ',R1,' KOhm\n')

Vgs=  3.77  V

R1+R2=  200.00  Kohm

R2=  95.36  KOhm

R1=  104.64  KOhm



## Ex7-pg270¶

In [6]:
import math

##Example 5.7
Vtn=0.8;
Kn=80.;
##x=W/L
x=3.;
I_D=250.;
Vd=2.5;
##I_D=Kn/2*x*(Vgs-Vtn)^2
Vgs=math.sqrt(I_D*2./(Kn*x))+Vtn;
print"%s %.2f %s"%('\nVgs= ',Vgs,' V\n')
Vs=-Vgs
##I_D=(5-Vd)/Rd
Rd=(5.-Vd)/I_D;
print"%s %.2f %s"%('\nRd= ',Rd,' KOhm\n')
Vds=Vd-Vs;
print"%s %.2f %s"%('\nVds= ',Vds,' V\n')
Vdssat=Vgs-Vtn
##since Vds>Vdssat transistor is biased in saturation region

Vgs=  2.24  V

Rd=  0.01  KOhm

Vds=  4.74  V



## Ex8-pg272¶

In [11]:
import math
from numpy import roots
##Example 5.8
Vtn=0.8;
Kn=0.05;
##I_D=Kn*(Vgs-Vtn)^2
##Vds=Vgs=5-I_D*Rs
##combining these two equations we obtain 0.5(Vgs)^2+0.2Vgs-4.68
import numpy
from numpy.polynomial import Polynomial as P
p = P([1, 5, 6])
p.roots()

print('',p.roots(),' V\n')
##assuming transistor is conducting ,Vgs must be greater than threshold voltage
Vgs=2.87;
I_D=Kn*(Vgs-Vtn)**2;
print"%s %.2f %s"%('\ndrain current= ',I_D,' mA\n')
#ans is varying due to round of error in book calculations are done wrong

('', array([-0.5       , -0.33333333]), ' V\n')

drain current=  0.21  mA



## Ex10-pg277¶

In [9]:
import math

##Example 5.10
Vtn=-2.;
Kn=0.1;
Vdd=5.;
Rs=5.;
Vgs=0.;
I_D=Kn*(Vgs-Vtn)**2;
print"%s %.2f %s"%('\ndrain current= ',I_D,' mA\n')
Vds=Vdd-I_D*Rs;
print"%s %.2f %s"%('\ndc drain to source voltage= ',Vds,' V\n')
Vdssat=Vgs-Vtn
##since Vds>Vdssat transisyor is biased in saturation region

drain current=  0.40  mA

dc drain to source voltage=  3.00  V



## Ex11-pg277¶

In [10]:
import math
import numpy

##Example 5.11
Vtnd=1;
Vtnl=-2;
Knd=50;
Knl=10;
Vt=5;
import numpy
from numpy.polynomial import Polynomial as P
p = P([4, -40, 5])
p.roots()

print('\npossible solutions ::',p.roots(),'')
##since output voltage cannot be greater than supply voltage 5V
Vo=0.1;##(V)
I_D=Knl*(-Vtnl)**2;
print"%s %.2f %s"%('\ndrain current= ',I_D,' microA\n')

('\npossible solutions ::', array([ 0.10128226,  7.89871774]), '')

drain current=  40.00  microA



## Ex13-pg282¶

In [16]:
import math
#calculate the
##Example 5.13
Kn1=0.2;
Kn2=0.1;
Kn3=0.1;
Kn4=0.1;
Vtn1=1.;
Vtn2=1.;
Vtn3=1.;
Vtn4=1.;
V2=-5.;
Vgs3=(math.sqrt(Kn4/Kn3)*(-V2-Vtn4)+Vtn3)/(1.+math.sqrt(Kn4/Kn3));
print"%s %.2f %s"%('\nVgs3= ',Vgs3,' V\n')
Iq=Kn3*(Vgs3-Vtn3)**2;
print"%s %.2f %s"%('\nbias current= ',Iq,' mA\n')
Vgs1=math.sqrt(Iq/Kn1)+Vtn1;
print"%s %.2f %s"%('\ngate to source voltage on M1= ',Vgs1,' V\n')
Vds2=-V2-Vgs1;
print"%s %.2f %s"%('\ndrain to source voltage on M2= ',Vds2,' V\n')
Vgs2=Vgs3;
Vdssat=Vgs2-Vtn2
##since Vds2>Vdssat M2 is biased in saturation region

Vgs3=  2.50  V

bias current=  0.23  mA

gate to source voltage on M1=  2.06  V

drain to source voltage on M2=  2.94  V



## Ex14-pg284¶

In [17]:
import math

##Example 5.14
I_D=0.5;
Vds=6.;
Kn=80.*10**-6;
Vgs=5.;
Vtn=1.;
##x=W/L
x=I_D*2./(Kn*(Vgs-Vtn)**2);
print(x,"W/L ")
##maximum power dissipation in transistor
Pmax=Vds*I_D;
print"%s %.2f %s"%('\nmaximum power dissipation in transistor= ',Pmax,' W\n')

(781.2500000000001, 'W/L ')

maximum power dissipation in transistor=  3.00  W



## Ex16-pg293¶

In [18]:
import math
import numpy
##Example 5.16
Idss=2.;##(mA) saturation current
Vp=-3.5;##(V) pinch off voltage
Vgs=numpy.array([[0, Vp/4. ,Vp/2.]])
I_D=Idss*(1.-Vgs/Vp)**2;
print (I_D)
Vds=Vgs-Vp;
print (Vds)

[[ 2.     1.125  0.5  ]]
[[ 3.5    2.625  1.75 ]]


## Ex17-pg295¶

In [19]:
import math

##Example 5.17
Idss=5.;##mA
Vp=-4.;
Vdd=10.;
I_D=2.;
Vds=6.;
##I_D=Idss*(1-Vgs/Vp)^2
Vgs=(1.-math.sqrt(I_D/Idss))*Vp;
print"%s %.2f %s"%('\nVgs= ',Vgs,' V\n')
Rs=-Vgs/I_D;
print"%s %.2f %s"%('\nRs= ',Rs,' KOhm\n')
Rd=(Vdd-Vds-I_D*Rs)/I_D;
print"%s %.2f %s"%('\nRd= ',Rd,' KOhm\n')
Vgs-Vp
##since Vds>Vgs-Vp JFET is biased in saturation

Vgs=  -1.47  V

Rs=  0.74  KOhm

Rd=  1.26  KOhm


Out[19]:
2.5298221281347035

## Ex19-pg298¶

In [20]:
import math

##Example 5.19
Idss=2.5;
Vp=2.5;
I_D=0.8;
##I_D=Iq=0.8*10^-3=(Vd-(-9))/Rd
Vd=0.8*4.-9;
print"%s %.2f %s"%('\nVd = ',Vd,'V\n')
##I_D=Idss*(1-Vgs/Vp)^2;
Vgs=(1.-math.sqrt(I_D/Idss))*Vp;
print"%s %.2f %s"%('\nVgs = ',Vgs,'V\n')
Vs=1-Vgs;
print"%s %.2f %s"%('\nVs= ',Vs,' V\n')
Vsd=Vs-Vd;
print"%s %.2f %s"%('\nVsd= ',Vsd,' V\n')
Vp-Vgs
##since Vsd>Vp-Vgs JFET is biased in saturation

Vd =  -5.80 V

Vgs =  1.09 V

Vs=  -0.09  V

Vsd=  5.71  V


Out[20]:
1.414213562373095

## Ex20-pg299¶

In [21]:
import math

##Example 5.20
Vtn=0.24;
Kn=1.1;
##x=R1+R2=50000
x=50.;
Vgs=0.5;
Vds=2.5;
Vdd=4.;
Rd=6.7;
I_D=Kn*(Vgs-Vtn)**2;
print"%s %.2f %s"%('\ndrain current= ',I_D,' mA\n')
Vd=Vdd-I_D*Rd;
print"%s %.2f %s"%('\nvoltage at drain= ',Vd,' V\n')
Vs=Vd-Vds;
print"%s %.2f %s"%('\nvoltage at source = ',Vs,'V\n')
Rs=Vs/I_D;
print"%s %.2f %s"%('\nsource resistance = ',Rs,'KOhm\n')
Vg=Vgs+Vs;
print"%s %.2f %s"%('\nvoltage at the gate= ',Vg,' V\n')
##Vg=R2*Vdd/(R2+R1)
R2=Vg*x/Vdd;
print"%s %.2f %s"%('\nR2= ',R2,' KOhm\n')
R1=x-R2;
print"%s %.2f %s"%('\nR1= ',R1,' KOhm\n')
Vgs-Vtn
##since Vds>Vgs-Vtn transistor is biased in saturation

drain current=  0.07  mA

voltage at drain=  3.50  V

voltage at source =  1.00 V

source resistance =  13.47 KOhm

voltage at the gate=  1.50  V

R2=  18.77  KOhm

R1=  31.23  KOhm


Out[21]:
0.26