Contents

fet1.m FET Characteristic curves and bias

A couple of plot commands

vg2;
set(0,'DefaultFigurePosition',[0,0,800,600]);


kp=50e-6;w=10e-6;l=2e-6;vt0=1;
vdaxis=0:0.1:15;
vgaxis=0:1:5;
[vd,vg]=meshgrid(vdaxis,vgaxis);
const=kp*w/l
VA=150;
lambda=1/VA;
vdd=12;
const =
   2.5000e-04

Saturation Current

idsat=const*(vg-vt0).^2/2;

Triode Current

idtriode=const*((vg-vt0).*vd-vd.^2/2);

Boundary

idboundary=const*vd.^2/2;

Actual current

id=idtriode.*(idtriode>=idboundary)+idsat.*(idsat<idboundary);
id=id.*(1+lambda*vd);
figure;plot(vdaxis,id*1e3);hold on;
xlabel('v_{DS}, Drain--Source Voltage, V');
ylabel('i_{D}, Drain Current, mA');
title(['V{t0} = ',num2str(vt0),' V']);

Curve for Current Mirror Transistor

% Saturation Current
idsatm=const*(vg-vt0).^2/2;

% Triode Current
idtriodem=const*((vg-vt0).*(vdd-vd)-(vdd-vd).^2/2);

% Boundary
idboundarym=const*(vdd-vd).^2/2;

% Actual current
idm=idtriodem.*(idtriodem>=idboundarym)+idsatm.*(idsatm<idboundarym);
idm=idm.*(1+lambda*(vdd-vd));
idm(vd>vdd)=0;

plot(vdaxis,idm(5,:)*1e3,'b-');
moose=axis;
plot(vdaxis,idboundary*1e3,'k--');grid on;
plot(vdaxis,idboundarym.*(vd<vdd)*1e3,'k--');grid on;
axis(moose);
hold off;

Plot for logic

kp=50e-6;w=10e-6;l=2e-6;vt0=0;
vdaxis=0:0.1:5;
vgaxis=[[0:1:2],2.5,[3:1:5]];
[vd,vg]=meshgrid(vdaxis,vgaxis);
const=kp*w/l
VA=150;
lambda=1/VA;
vdd=5;
const =
   2.5000e-04

Saturation Current

idsat=const*(vg-vt0).^2/2;

Triode Current

idtriode=const*((vg-vt0).*vd-vd.^2/2);

Boundary

idboundary=const*vd.^2/2;

Actual current

id=idtriode.*(idtriode>=idboundary)+idsat.*(idsat<idboundary);
id=id.*(1+lambda*vd);

Curve for Current Mirror Transistor

% Saturation Current
idsatm=const*(vg-vt0).^2/2;

% Triode Current
idtriodem=const*((vg-vt0).*(vdd-vd)-(vdd-vd).^2/2);

% Boundary
idboundarym=const*(vdd-vd).^2/2;

% Actual current
idm=idtriodem.*(idtriodem>=idboundarym)+idsatm.*(idsatm<idboundarym);
idm=idm.*(1+lambda*(vdd-vd));
idm(vd>vdd)=0;

Curve for Current Mirror Transistor

% Saturation Current
idsatm=const*(vg-vt0).^2/2;

% Triode Current
idtriodem=const*((vg-vt0).*(vdd-vd)-(vdd-vd).^2/2);

% Boundary
idboundarym=const*(vdd-vd).^2/2;

% Actual current
idm=idtriodem.*(idtriodem>=idboundarym)+idsatm.*(idsatm<idboundarym);
idm=idm.*(1+lambda*(vdd-vd));
idm(vd>vdd)=0;

figure;plot(vdaxis,id*1e3);hold on;
ax = gca;
ax.ColorOrderIndex = 1;
xlabel('v_{DS}, Drain--Source Voltage, V');
ylabel('i_{D}, Drain Current, mA');
title(['V{t0} = ',num2str(vt0),' V']);
plot(vdaxis,flipud(idm*1e3)); % flip up down because VGS are
                              % reversed for this transistor
moose=axis;
plot(vdaxis,idboundary*1e3,'k--');grid on;
plot(vdaxis,idboundarym.*(vd<vdd)*1e3,'k--');grid on;
axis(moose);
legend(cellstr(num2str(vgaxis', 'V_{in}=%-3.1f')),...
       'Location','EastOutside');
hold off;