# lab report ( material and device )

please follow the instructor ( lab4(2) ).everything is on the file. The report has to be maximum to pages ( no more than two pages )

This the code for matlab

( q=1.6e-19; //electronic charge

eps_Si=12*8.85e-14; // dielectric constant of Si in F/cm

T=300; //Temperature in Kelvin

Vth=0.0259*T/300; //kT/q in V

ni=1.5e10; //intrinsic carrier concentration in Si at 300K

A=1e-3; //area of pn diode cross section

Na=1e16; //p-side doping conc. in cm-3

Nd=1e16; //n-side doping conc in cm-3

Vbi= Vth*log(Na*Nd/ni^2); //built in voltage from expression

V=-10; //applied voltage

xp=sqrt((2*eps_Si*(Vbi-V)/q)*(Nd/(Na*(Na+Nd)))); //p-side depletion in cm

xn=sqrt((2*eps_Si*(Vbi-V)/q)*(Na/(Nd*(Na+Nd)))); //n-side depletion in cm

Wd=xn+xp; //total depletion region width

C_d=1e12*eps_Si*A/Wd; //depletion capacitance in pF

x=[-xp:xp/1000:0, xn/1000:xn/1000:xn]; //x-axis setup

y=x./(abs(x));

y(1001)=0; //set origin to 0

charge=(Na*y.*(y<0))+(Nd*y.*(y>0)); //charge density in numbers/cm2

E=(q/eps_Si)*cumsum(charge.*[0,diff(x)]); ///integrate charge using gauss’ law

V=-cumsum(E.*[0,diff(x)]); //integrate electric field to get potential

plot(x,charge)