Contents
kp=50e-6;w=10e-6;l=2e-6;vt0=0;
vdaxis=0:0.1:15;
vgaxis=0:1:5;
[vd,vg]=meshgrid(vdaxis,vgaxis);
const=kp*w/l
const =
2.5000e-04
Saturation Current
idsat=const*(vg-vt0).^2/2;
figure;plot(vdaxis,idsat*1e3);grid on;
xlabel('v_{DS}, Drain--Source Voltage, V');
ylabel('i_{D}, Saturation Drain Current, mA');
moose=axis;
Triode Current
idtriode=const*((vg-vt0).*vd-vd.^2/2);
Boundary
idboundary=const*vd.^2/2;
figure;plot(vdaxis,idsat*1e3);hold on;
plot(vdaxis,idtriode*1e3);
plot(vdaxis,idboundary*1e3,'k');grid on;
hold off;
xlabel('v_{DS}, Drain--Source Voltage, V');
ylabel('i_{D}, Drain Current, mA');
axis(moose);
Actual current
id=idtriode.*(idtriode>=idboundary)+idsat.*(idsat<idboundary);
figure;plot(vdaxis,id*1e3);hold on;
plot(vdaxis,idboundary*1e3);grid on;
hold off;
xlabel('v_{DS}, Drain--Source Voltage, V');
ylabel('i_{D}, Drain Current, mA');
axis(moose);
Circuit and load line
vdd=12;r=4800;
imax=vdd/r;
figure;plot(vdaxis,idsat*1e3);hold on;
plot(vdaxis,idtriode*1e3);
plot(vdaxis,idboundary*1e3,'k');
plot([0,vdd],[imax*1e3,0],'m');grid on;
hold off;
xlabel('v_{DS}, Drain--Source Voltage, V');
ylabel('i_{D}, Drain Current, mA');
axis(moose);
Saturation Calculations
vgdemo=4;
clear iddemo vddemo
iddemo(1)=const*(vgdemo-vt0).^2/2
vddemo(1)=vdd-iddemo(1)*r
iddemo =
2.0000e-03
vddemo =
2.4000e+00
Triode Calculations
a=const*r^2/2
b=1+const*(vgdemo-vt0)*r-const*vdd*r
c=const/2*vdd^2-const*(vgdemo-vt0)*vdd
argsqrt=b^2-4*a*c
if(argsqrt>=0)
iddemo(2)=(-b-sqrt(argsqrt))/(2*a);
vddemo(2)=vdd-iddemo(2)*r;
end;
if(argsqrt>0)
iddemo(3)=(-b+sqrt(argsqrt))/(2*a);
vddemo(3)=vdd-iddemo(3)*r;
end;
vddemo
iddemo
a =
2880
b =
-8.6000e+00
c =
6.0000e-03
argsqrt =
4.8400e+00
vddemo =
2.4000e+00 6.6667e+00 3.0000e+00
iddemo =
2.0000e-03 1.1111e-03 1.8750e-03
Test answers
test(1)=(iddemo(1)<const*vddemo(1)^2/2);
test(2)=(iddemo(2)>const*vddemo(2)^2/2);
test(3)=(iddemo(3)>const*vddemo(3)^2/2);
vddemo
iddemo
idboundarydemo=const*vddemo.^2/2
comparison=[' < ',' > ',' > ']
test
figure;plot(vdaxis,idsat*1e3);hold on;
plot(vdaxis,idtriode*1e3);
plot(vdaxis,idboundary*1e3,'k');
plot([0,vdd],[imax*1e3,0],'m');
plot(vddemo,iddemo*1e3,'o');
plot(vddemo(find(test>0)),iddemo(find(test>0))*1e3,'*');grid on;
hold off;
xlabel('v_{DS}, Drain--Source Voltage, V');
ylabel('i_{D}, Drain Current, mA');
axis(moose);
vddemo =
2.4000e+00 6.6667e+00 3.0000e+00
iddemo =
2.0000e-03 1.1111e-03 1.8750e-03
idboundarydemo =
7.2000e-04 5.5556e-03 1.1250e-03
comparison =
< > >
test =
0 0 1