Pages

Saturday, December 22, 2012

MATLAB code for n-channel MOSFET output characteristics

MOSFET is the most widely used semiconductor device in the present era. It's important to understand the working of MOSFET and graphical explanation helps in obtaining a fairly good idea on MOSFETs. Here is the MATLAB code for plotting the output characteristics of  an n-channel MOSFET. The graph is also given below. Use this video for VIDEO and AUDIO guidance and better explanation.
180 nm technology is assumed since it is the latest in use.
Early effect is not considered.

MATLAB code
%n-channel enhancement mode MOSFET output characteristics 
clear all;
%kn=un*cox = 100 microA/Volts
kn=1e-4;
%Let W/L= 2
W=360*(10^(-9));
L=180*(10^(-9));
beta=kn*W/L;
%Vth is the threshold voltage
Vth=1;
%Sweep drain to source voltge from 0 to 10V
vds=0:0.5:10;
%Ask the user to enter gate to source voltage
vgs=input('ENTER THE Vgs in volts');
%Estimate length of the array
m=length(vds);
for i=1:m

if vgs < Vth
current(1,i)=0;
elseif vds(i) >= (vgs - Vth)
current(1,i)=0.5* beta * (vgs - Vth)^2;
elseif vds(i) < (vgs - Vth)
current(1,i)= beta*((vgs-Vth)*vds(i) - 0.5*(vds(i)^2));
end

end
plot(vds,current(1,:),'b')
xlabel('Vds, V')
ylabel('Drain Current,A')
title('I-V Characteristics of a MOSFET')



OUTPUT CHARACTERISTICS
Vgs=4V


1 comment:

  1. Dear Sir I ask you to help me in my search for: modeling of static and dynamic characteristics TO MOSFET WITH MATLAB CODE
    with all due respect

    ReplyDelete