Chapter16-MOSFET Digital Circuits

Ex3-pg1013

In [2]:
import math

##Example 16.3
Vdd=5.;
Vtnd=0.8;
Vtnl=0.8;
Kn=35.;
Vo=0.1;
Vi=4.2;
##W/L=Y
yl=0.5;
##Kd/Kl=x
x=(Vdd-Vo-Vtnl)**2/(2.*Vo*(Vi-Vtnd)-Vo**2);
print"%s %.2f %s"%('\nKd/Kl=\n',x,'')
##Kd/Kl=yd/yl
yd=12.6
yl=0.5
iD=Kn*yl*(Vdd-Vo-Vtnl)**2/2.;
print"%s %.2f %s"%('\ndrain current = ',iD,' microA\n')
P=iD*Vdd;
print"%s %.2f %s"%('\npower dissipation= ',P,' microW\n')
Kd/Kl=
 25.09 

drain current =  147.09  microA


power dissipation=  735.44  microW

Ex4-pg1017

In [3]:
import math
 
##Example 16.4
Vdd=5.;
Vtnd=0.8;
Vtnl=-2.;
Kn=35.;
Vo=0.1;
Vi=5.;
##W/L=Y
yl=0.5;
##Kd/Kl=x
x=(-Vtnl)**2/(2.*Vo*(Vi-Vtnd)-Vo**2);
print"%s %.2f %s"%('\nKd/Kl=\n',x,'')
##Kd/Kl=yd/yl
yd=2.41
yl=0.5
iD=Kn*yl*(-Vtnl)**2/2.;
print"%s %.2f %s"%('\ndrain current= ',iD,' microA\n')
P=iD*Vdd;
print"%s %.2f %s"%('\npower dissipation = ',P,' microW\n')
Kd/Kl=
 4.82 

drain current=  35.00  microA


power dissipation =  175.00  microW

Ex5-pg1021

In [4]:
import math

##Example 16.5
Voh=4.2;
Vol=0.1;
##x=Kd/Kl
x=25.1;
Vdd=5.;
Vtnl=0.8;
Vohu=4.2;
Vil=0.8;
Vtnd=0.8;
Vih=Vtnd+(Vdd-Vtnl)/x*((1+2*x)/math.sqrt(1.+3.*x)-1.);
print"%s %.2f %s"%('\nVih= ',Vih,' V\n')
Volu=(Vdd-Vtnl+x*(Vih-Vtnd))/(1.+2.*x);
print"%s %.2f %s"%('\noutput voltage corresponding to Vih= ',Volu,' V\n')
NMl=Vil-Volu;
print"%s %.2f %s"%('\nnoise margin= ',NMl,' V\n')
NMh=Vohu-Vih;
print"%s %.2f %s"%('\nnoise margin= ',NMh,' V\n')
Vih=  1.61  V


output voltage corresponding to Vih=  0.48  V


noise margin=  0.32  V


noise margin=  2.59  V

Ex9-pg1041

In [5]:
import math
 
##Example 16.9
Vdd=5.;
Vtn=1.;
Vtp=-1.;
##Kn=Kp hence Kn/Kp=x=1;
x=1.;
Vit=(Vdd+Vtp+math.sqrt(x)*Vtn)/(1.+math.sqrt(x));
print"%s %.2f %s"%('\ninput voltage= ',Vit,' V\n')
Vipt=Vit;
Vopt=Vipt-Vtp;
print"%s %.2f %s"%('\noutput voltage at the transition point for PMOS = ',Vopt,' V\n')
Vint=Vit;
Vont=Vint-Vtn;
print"%s %.2f %s"%('\noutput voltage at the transition point for NMOS= ',Vont,' V\n')
Vdd=10.;
Vit=(Vdd+Vtp+math.sqrt(x)*Vtn)/(1.+math.sqrt(x));
print"%s %.2f %s"%('\ninput voltage = ',Vit,'V\n')
Vipt=Vit;
Vint=Vit;
Vopt=Vipt-Vtp;
print"%s %.2f %s"%('\noutput voltage at the transition point for PMOS = ',Vopt,'   V\n')
Vont=Vint-Vtn;
print"%s %.2f %s"%('\noutput voltage at the transition point for NMOS = ',Vont,'   V\n')
input voltage=  2.50  V


output voltage at the transition point for PMOS =  3.50  V


output voltage at the transition point for NMOS=  1.50  V


input voltage =  5.00 V


output voltage at the transition point for PMOS =  6.00    V


output voltage at the transition point for NMOS =  4.00    V

Ex10-pg1045

In [6]:
import math

##Example 16.10
Cl=2.*10**-6;
Vdd=5.;
f=100000.;
P=f*Cl*Vdd**2;
print"%s %.2f %s"%('\npower dissipation in the CMOS inverter= ',P,' microW\n')
power dissipation in the CMOS inverter=  5.00  microW

Ex11-pg1047

In [7]:
import math

##Example 16.11
Vtn=1.;
Vtp=-1.;
Vdd=5.;
Vth=1.;
Vil=Vtn+3.*(Vdd+Vtp-Vth)/8.;
print"%s %.2f %s"%('\ninput voltage at the transition points Vil= ',Vil,' V\n')
Vih=Vtn+5.*(Vdd+Vtp-Vtn)/8.;
print"%s %.2f %s"%('\ninput voltage at the transition points Vih= ',Vih,'  V\n')
Vohu=1.*(2.*Vil+Vdd-Vtn-Vtp)/2.;
print"%s %.2f %s"%('\noutput voltage = ',Vohu,' V\n')
Volu=1.*(2.*Vih-Vdd-Vtn-Vtp)/2.;
print"%s %.2f %s"%('\noutput voltage = ',Volu,' V\n')
NML=Vil-Volu;
print"%s %.2f %s"%('\nnoise margin = ',NML,' V\n')
NMH=Vohu-Vih;
print"%s %.2f %s"%('\nnoise margin= ',NML,' V\n')
input voltage at the transition points Vil=  2.12  V


input voltage at the transition points Vih=  2.88   V


output voltage =  4.62  V


output voltage =  0.38  V


noise margin =  1.75  V


noise margin=  1.75  V

Ex15-pg1080

In [7]:
import math
 
##Example 16.15
Vdd=3.;
Kn=60.;
Vtnd=0.5;
##W/L=x
xd=2.;
Vtnl=-1.;
xl=0.5;
R=2.;##(MOhm)
Vgsl=0.;
##solution with Depletion load
iD=Kn*xl*(Vgsl-Vtnl)**2/2.;
print"%s %.2f %s"%('\nfrain currents in M1 and M3 = ',iD,' microA\n')
P=iD*Vdd;
print"%s %.2f %s"%('\npower dissipation in the circuit= ',P,'microW\n')
##iD=Kn/2*x*(2*Vgsd-Vtnd)Vdsd-Vdsd^2
Q=50.5
p=0.25 - 5*(50.5) + 50.5
print(p)

##solution with Resistor load
##(Vdd-Q)/R=Kn/2*xd*(2*Vgsd-Vtnd)Q-Q^2


Q=0.005;
p1=0.25 - 5*(0.005) + 0.005
print(p1)
iD=(Vdd-Q)/R;
print"%s %.2f %s"%('\ndrain current = ',iD,' microA\n')
P=iD*Vdd;
print"%s %.2f %s"%('\npower dissipation in the circuit = ',P,' microW\n')
frain currents in M1 and M3 =  15.00  microA


power dissipation in the circuit=  45.00 microW

-201.75
0.23

drain current =  1.50  microA


power dissipation in the circuit =  4.49  microW