# Chapter6-Basic FET Amplifier¶

## Ex1-pg316¶

In [1]:
import math

##Example 6.1
Vtn=1.;
##let x= u_n*Cox*1/2
x=20.*10**-3;
##let y=W/L
y=40.;
I_D=1.;
Kn=x*y;
print"%s %.2f %s"%('\nconduction parameter= ',Kn,' mA/V^2\n')
g_m=2.*math.sqrt(Kn*I_D);
print"%s %.2f %s"%('\ntransconductance= ',g_m,' mA/V\n')

conduction parameter=  0.80  mA/V^2

transconductance=  1.79  mA/V



## Ex2-pg319¶

In [2]:
import math

##Example 6.2
Vgsq=2.12;
Vdd=5.;
Rd=2.5;
Vtn=1.;
Kn=0.8;
##let lambda=y
y=0.02;##V^-1
Idq=Kn*(Vgsq-Vtn)**2;
print"%s %.2f %s"%('\ndrain current= ',Idq,'mA\n')
Vdsq=Vdd-Idq*Rd;
print"%s %.2f %s"%('\ndrain to source voltage= ',Vdsq,' V\n')
Vgs=1.82;
Vgs-Vtn
##since Vdsq>Vgs-Vtn transistor is biased in saturation
g_m=2.*Kn*(Vgsq-Vtn);
print"%s %.2f %s"%('\ntransconductance= ',g_m,' mA/V\n')
ro=(y*Idq)**-1;
print"%s %.2f %s"%('\noutput resistance= ',ro,' KOhm\n')
Av=-g_m*ro*Rd/(ro+Rd);
print"%s %.2f %s"%('\nsmall signal voltage gain= ',Av,'\n')

drain current=  1.00 mA

drain to source voltage=  2.49  V

transconductance=  1.79  mA/V

output resistance=  49.82  KOhm

small signal voltage gain=  -4.27



## Ex3-pg326¶

In [3]:
import math

##Example 6.3
Vdd=10.;
R1=70.9;##(Kohm)
R2=29.1;##(Kohm)
Rd=5.;##(Kohm)
Vtn=1.5;
Kn=0.5;##(mA/V^2)
##lambda=y
y=0.01;##V^-1
Rsi=4.;##(Kohm)
Vgsq=Vdd*R2/(R1+R2);
print"%s %.2f %s"%('\ngate to source voltage= ',Vgsq,' V\n')
Idq=Kn*(Vgsq-Vtn)**2;
print"%s %.2f %s"%('\ndrain current= ',Idq,' mA\n')
Vdsq=Vdd-Idq*Rd;
print"%s %.2f %s"%('\ndrain to source voltage= ',Vdsq,' V\n')
g_m=2*Kn*(Vgsq-Vtn);
print"%s %.2f %s"%('\ntransconductance= ',g_m,' mA/V\n')
ro=(y*Idq)**-1;
print"%s %.2f %s"%('\noutput resistance= ',ro,' KOhm\n')
Ri=R1*R2/(R1+R2);
print"%s %.2f %s"%('\namplifier input resistance= ',Ri,' Kohm\n')
Av=-g_m*(ro*Rd/(ro+Rd))*Ri/(Ri+Rsi);
print"%s %.2f %s"%('\nsmall signal voltage gain=\n',Av,'')
print"%s %.2f %s"%('\namplifier input resistance= ',Ri,' Kohm\n')
Ro=Rd*ro/(Rd+ro);
print"%s %.2f %s"%('\namplifier output resistance= ',Ro,' Kohm\n')

gate to source voltage=  2.91  V

drain current=  0.99  mA

drain to source voltage=  5.03  V

transconductance=  1.41  mA/V

output resistance=  100.60  KOhm

amplifier input resistance=  20.63  Kohm

small signal voltage gain=
-5.63

amplifier input resistance=  20.63  Kohm

amplifier output resistance=  4.76  Kohm



## Ex4-pg327¶

In [4]:
import math

##Example 6.4
Vtn=1.;
Kn=1.;##(mA/V^2)
##lambda=y
y=0.015;##V^-1
Ri=100.;##(Kohm)
Idq=2.;##(mA)
Idt=4.;##(mA)
##Idt=4=Kn*(Vgst-Vtn)^2
Vgst=math.sqrt(Idt/Kn)+Vtn;
print"%s %.2f %s"%('\nVgst= ',Vgst,' V\n')
Vdst=Vgst-Vtn;
print"%s %.2f %s"%('\nVdst= ',Vdst,' V\n')
Vdd=12.;
Vdsq=7.;
Rd=(Vdd-Vdsq)/Idq;
print"%s %.2f %s"%('\nRd = ',Rd,'KOhm\n')
Vgsq=math.sqrt(Idq/Kn)+Vtn;
print"%s %.2f %s"%('\nVgsq= ',Vgsq,' V\n')
R1=Ri*Vdd/Vgsq;
print"%s %.2f %s"%('\nR1= ',R1,' Kohm\n')
R2=Ri*R1/(R1-Ri);
print"%s %.2f %s"%('\nR2= ',R2,' Kohm\n')
g_m=2*Kn*(Vgsq-Vtn);
print"%s %.2f %s"%('\ntransconductance= ',g_m,' mA/V\n')
ro=(y*Idq)**-1;
print"%s %.2f %s"%('\noutput resistance= ',ro,' KOhm\n')
Av=-g_m*(ro*Rd/(ro+Rd));
print"%s %.2f %s"%('\nsmall signal voltage gain= ',Av,'\n')

Vgst=  3.00  V

Vdst=  2.00  V

Rd =  2.50 KOhm

Vgsq=  2.41  V

R1=  497.06  Kohm

R2=  125.19  Kohm

transconductance=  2.83  mA/V

output resistance=  33.33  KOhm

small signal voltage gain=  -6.58



## Ex6-pg332¶

In [5]:
import math

##Example 6.6
Vtn=0.8;
Kn=1.;##(mA/V^2)
Idq=0.5;
Vdd=5.;
Rd=7.;##(Kohm)
Vgsq=math.sqrt(Idq/Kn)+Vtn;
print"%s %.2f %s"%('\nVgsq= ',Vgsq,' V\n')
Vs=-Vgsq
Vdsq=Vdd-Idq*Rd-Vs;
print"%s %.2f %s"%('\nVdsq=',Vdsq,' V\n')
g_m=2.*Kn*(Vgsq-Vtn);
print"%s %.2f %s"%('\ntransconductance= ',g_m,' mA/V\n')
Av=-g_m*Rd;
print"%s %.2f %s"%('\nsmall signal voltage gain=\n',Av,'')

Vgsq=  1.51  V

Vdsq= 3.01  V

transconductance=  1.41  mA/V

small signal voltage gain=
-9.90


## Ex7-pg336¶

In [6]:
import math

##Example 6.7
Vdd=12.;
R1=162.;
R2=463.;
Rs=0.75;
Kn=4.;
Vtn=1.5;
##lambda=y
y=0.01;
Rsi=4.;
Idq=7.97;
Vgsq=2.91;
g_m=2.*Kn*(Vgsq-Vtn);
print"%s %.2f %s"%('\ntransconductance= ',g_m,' mA/V\n')
ro=(y*Idq)**-1.;
print"%s %.2f %s"%('\noutput resistance= ',ro,' KOhm\n')
Ri=R1*R2/(R1+R2);
print"%s %.2f %s"%('\namplifier input resistance= ',Ri,' Kohm\n')
x=Rs*ro/(Rs+ro);
Av=g_m*x*(Ri/(Ri+Rsi))/(1.+g_m*x);
print"%s %.2f %s"%('\nsmall signal voltage gain=\n',Av,'')

transconductance=  11.28  mA/V

output resistance=  12.55  KOhm

amplifier input resistance=  120.01  Kohm

small signal voltage gain=
0.86


## Ex9-pg340¶

In [7]:
import math

##Example 6.9
Rs=750.;##Ohm
ro=12500.;
g_m=11.3*10**-3;
x=1./g_m;
y=x*Rs/(x+Rs);
Ro=y*ro/(y+ro);
print"%s %.2f %s"%('\noutput resistance= ',Ro,' ohm\n')

output resistance=  78.66  ohm



## Ex11-pg348¶

In [8]:
import math

##Example 6.11
Vtnd=1.;
Vtnl=1.;
Kn=30.;
##let W/L=x
xl=1.;
Vdd=5.;
Av=10.;
##Av=sqrt(xd/xl)
xd=(Av)**2*xl;
print"%s %.2f %s"%('\nwidth to length ratio of driver transistor=\n',xd,'')
Knd=xd*Kn*0.001/2.;
Knl=xl*Kn*0.001/2.;
print"%s %.2f %s"%('\nconduction parameter Knd= ',Knd,' mA/V^2\n')
print"%s %.2f %s"%('\nconduction parameter Knl= ',Knl,' mA/V^2\n')
##Vgsd-Vtnd=(Vdd-Vtnl)-sqrt(Knd/Knl)*(Vgsd-Vtnd)
y=math.sqrt(Knd/Knl);
Vgsd=(y+5.)/(1.+y);
print"%s %.2f %s"%('\nVgsd= ',Vgsd,' V\n')
Vdsd=Vgsd-1.;
print"%s %.2f %s"%('\nVdsd= ',Vdsd,' V\n')

width to length ratio of driver transistor=
100.00

conduction parameter Knd=  1.50  mA/V^2

conduction parameter Knl=  0.01  mA/V^2

Vgsd=  1.36  V

Vdsd=  0.36  V



## Ex12-pg352¶

In [9]:
import math

##Example 6.12
Vtnd=0.8;
Vtnl=-1.5;
Knd=1.;
Knl=0.2;
##lambda=y
yd=0.01;
yl=0.01;
Idq=0.2;
gmd=2.*math.sqrt(Knd*Idq);
print"%s %.2f %s"%('\ntransconductance of the driver= ',gmd,' mA/V\n')
roD=1./(yd*Idq);
print"%s %.2f %s"%('\noutput resistances= ',roD,' Kohm\n')
Av=-gmd*roD/2.;
print"%s %.2f %s"%('\nsmall signal voltage gain= \n',Av,'')

transconductance of the driver=  0.89  mA/V

output resistances=  500.00  Kohm

small signal voltage gain=
-223.61


## Ex13-pg354¶

In [10]:
import math

##Example 6.13
Vtn=0.8;
Vtp=-0.8;
Kn=80.*10**-3;
Kp=40.*10**-3;
##x=W/L
xn=15.;
xp=10.;
##lambda=y
yn=0.01;
yp=0.01;
Ibias=0.2;
gm=2.*math.sqrt(Kn*xn*Ibias/2.);
print"%s %.2f %s"%('\ntransconductance of the NMOS driver= ',gm,' mA/V^2\n')
ron=1./(yn*Ibias);
print"%s %.2f %s"%('\noutput resistances= ',ron,' Kohm\n')
Av=-gm*ron/2.;
print"%s %.2f %s"%('\nsmall signal voltage gain= \n',Av,'')

transconductance of the NMOS driver=  0.69  mA/V^2

output resistances=  500.00  Kohm

small signal voltage gain=
-173.21


## Ex14-pg357¶

In [11]:
import math

##Example 6.14
Kn1=500.*10**-3;
Kn2=200.*10**-3;
Vtn1=1.2;
Vtn2=Vtn1;
Idq1=0.2;
Idq2=0.5;
Vdsq1=6.;
Vdsq2=6.;
Ri=100.;
Rsi=4.;
Rs2=(10.-Vdsq2)/Idq2;
print"%s %.2f %s"%('\nRs2= ',Rs2,' KOhm\n')
Vgs2=math.sqrt(Idq2/Kn2)+Vtn2;
print"%s %.2f %s"%('\ngate to source voltage for M2= ',Vgs2,' V\n')
Vs2=-1.;
Vg2=Vs2+Vgs2;
print"%s %.2f %s"%('\ngate voltage of M2= ',Vg2,' V\n')
Vg1=Vg2;
Rd1=(5.-Vg1)/Idq1;
print"%s %.2f %s"%('\nresistor Rd1= ',Rd1,' KOhm\n')
Vs1=Vg1-Vdsq1;
print"%s %.2f %s"%('\nsource voltage of M1= ',Vs1,' KOhm\n')
Rs1=(Vs1+5.)/Idq1;
print"%s %.2f %s"%('\nresistor Rs1= ',Rs1,' KOhm\n')
Vgs1=math.sqrt(Idq1/Kn1)+Vtn1;
print"%s %.2f %s"%('\ngate to source voltage for M1',Vgs1,' V\n')
R1=Ri*10./(Vgs1+Idq1*Rs1);
print"%s %.2f %s"%('\nR1= ',R1,' KOhm\n')
##Ri=R1*R2/(R1+R2)
R2=Ri*R1/(R1-Ri);
print"%s %.2f %s"%('\nR2= ',R2,' KOhm\n')

Rs2=  8.00  KOhm

gate to source voltage for M2=  2.78  V

gate voltage of M2=  1.78  V

resistor Rd1=  16.09  KOhm

source voltage of M1=  -4.22  KOhm

resistor Rs1=  3.91  KOhm

gate to source voltage for M1 1.83  V

R1=  382.61  KOhm

R2=  135.38  KOhm



## Ex15-pg358¶

In [12]:
import math

##Example 6.15
Vtn1=1.2;
Vtn2=1.2;
Kn1=0.8;
Kn2=0.8;
##x=R1+R2+R3=300
x=300.;
Rs=10.;
Idq=0.4;
Vdsq1=2.5;
Vdsq2=2.5;
Vs1=Idq*Rs-5.;
print"%s %.2f %s"%('\ndc voltage at source of M1= ',Vs1,' V\n')
Vgs=math.sqrt(Idq/Kn1)+Vtn1;
print"%s %.2f %s"%('\ngate to source voltage= ',Vgs,' V\n')
R3=(Vgs+Vs1)*x/5.;
print"%s %.2f %s"%('\nR3= ',R3,' KOhm\n')
Vs2=Vdsq2+Vs1;
print"%s %.2f %s"%('\nvoltage at source of M2= ',Vs2,' V\n')
##y=R2+R3
y=(Vgs+Vs2)*x/5.;
print"%s %.2f %s"%('\nR2+R3= ',y,' KOhm\n')
R2=150.;
R1=x-y;
print"%s %.2f %s"%('\nR1=',R1,' KOhm\n')
R3=y-R2;
print"%s %.2f %s"%('\nR3= ',R3,' KOhm\n')
Vd2=Vdsq2+Vs2;
print"%s %.2f %s"%('\nvoltage at drain of M2 = ',Vd2,'V\n')
Rd=(5.-Vd2)/Idq;
print"%s %.2f %s"%('\ndrain resistance= ',Rd,' KOhm\n')

dc voltage at source of M1=  -1.00  V

gate to source voltage=  1.91  V

R3=  54.43  KOhm

voltage at source of M2=  1.50  V

R2+R3=  204.43  KOhm

R1= 95.57  KOhm

R3=  54.43  KOhm

voltage at drain of M2 =  4.00 V

drain resistance=  2.50  KOhm



## Ex17-pg361¶

In [13]:
import math

##Example 6.17
Kn=0.8;
Vtn=1.2;
Vgs=1.91;
Rd=2.5;
gm=2.*Kn*(Vgs-Vtn);
print"%s %.2f %s"%('\ntransconductance= ',gm,' mA/V\n')
Av=-gm*Rd;
print"%s %.2f %s"%('\nsmall signal voltage gain= ',Av,' \n')

transconductance=  1.14  mA/V

small signal voltage gain=  -2.84



## Ex18-pg364¶

In [1]:
import math

##Example 6.18
##Determine the small signal voltage gain of a circuit in fig.6.55
Idss=12.;
Vp=-4.;
##lambda=y
y=0.008;
import numpy
from numpy.polynomial import Polynomial as P
p = P([26.4, 17.2, 2.025])
p.roots()

print('',p.roots(),' V\n')
Vgsq=-2.01
Idq=Idss*(1.-Vgsq/Vp)**2;
print"%s %.2f %s"%('\nquiescent drain current= ',Idq,' mA\n')
gm=(-2*Idss/Vp)*(1.-Vgsq/Vp);
print"%s %.2f %s"%('\ntransconductance= ',gm,' mA/V\n')
ro=(1/(y*Idq));
print"%s %.2f %s"%('\noutput resistance= ',ro,' KOhm\n')
Rd=2.7;
Rl=4.;
x=Rd*Rl/(Rd+Rl);
Av=-gm*ro*x/(ro+x);
print"%s %.2f %s"%('\nsmall signal voltage gain= ',Av,' \n')

('', array([-6.48281115, -2.01101602]), ' V\n')

quiescent drain current=  2.97  mA

transconductance=  2.99  mA/V

output resistance=  42.09  KOhm

small signal voltage gain=  -4.63



## Ex19-pg366¶

In [15]:
import math

##Example 6.19
Idss=12.;
Vp=-4.;
Rl=10.;
##lambda=y
y=0.01;
Av=0.9;
##gm=(-2*Idss/Vp)*(1-Vgs/Vp)
gm=2.;
Vgs=(1.+gm*Vp/(2.*Idss))*Vp;
print"%s %.2f %s"%('\ngate to source voltage= ',Vgs,' V\n')
Idq=Idss*(1.-Vgs/Vp)**2;
print"%s %.2f %s"%('\nquiescent drain current= ',Idq,' mA\n')
Rs=(-Vgs+10.)/Idq;
print"%s %.2f %s"%('\nRs= ',Rs,' KOhm\n')
ro=(1./(y*Idq));
print"%s %.2f %s"%('\noutput resistance= ',ro,' KOhm\n')
x=Rl*ro/(Rl+ro);
t=x*Rs/(x+Rs);
Av=gm*t/(1.+gm*t);
print"%s %.2f %s"%('\nsmall signal voltage gain= ',Av,' \n')

gate to source voltage=  -2.67  V

quiescent drain current=  1.33  mA

Rs=  9.50  KOhm

output resistance=  75.00  KOhm

small signal voltage gain=  0.90