#calculation of pinch-off voltage
a=0.1*(10**-6) #channel height in m
Nd=8*(10**23) #Electron Concetration in m-3
er=11.80 #relative dielectric constant
es=8.854*(10**-12)*er #permittivity of silicon in F/m
q=1.6*(10**-19) #charge of electron in C
Vp=(q*Nd*(a**2))/(2*es) #pinch-off voltage
print"Pinch-off volatge in(Volts)is=",round(Vp,2),"Volts" #answer is wrong in book
import math
#(a)Calculate the pinch-off Voltage in Volts
a=0.2*(10**-4) #channel height in cm
Nd=1*(10**17) #Electron density in /cm3
er=11.80 #relative dielectric constant
es=8.854*(10**-14)*er #permittivity of silicon in F/cm
q=1.6*(10**-19) #charge of electron in C
Vp=(q*Nd*(a**2))/(2*es) #pinch-off voltage
print"The pinch-off volatge in(Volts)is=",round(Vp,2),"V"
#(b)Calculate the pinch-off current
un=800 #electron mobility in cm2/V.s
L=8*(10**-4) #channel length in cm
Z=50*(10**-4) #channel width in cm
a=0.2*(10**-4) #channel height in cm
Nd=1*(10**17) #Electron density in /cm3
er=11.80 #relative dielectrin constant
es=8.854*(10**-14)*er #permittivity of silicon in F/cm
q=1.6*(10**-19) #charge of electron in C
Ip=(un*(q**2)*(Nd**2)*Z*(a**3))/(L*es) #pinch-off voltage
Ip=Ip*1000 # in mA
print"The pinch-off current in(mA)is=",round (Ip,2),"mA"
#(c)Calculate the built-in voltage
Nd=1*(10**17) #Electron density in /cm3
Na=1*(10**19) #hole density in /cm3
w0=26*(10**-3)*math.log((Nd*Na)/((1.5*(10**10))**2))
print"Built-in voltage in(volts)is=",round(w0,3),"V"
#(d) Calculate the drain current
Vd=10 #drain voltage in volt
Vg=-1.5 #gate voltage in volt
Vg=-1*Vg #we take only magnitude
x=sqrt(((Vd+Vg+round(w0,3))/round(Vp,2))**3)
x=x*2/3
y=sqrt(((Vg+round(w0,3))/(round(Vp,2)))**3)
y=y*2/3
Id=(Vd/round(Vp,2))-x+y
Id=round(Ip,2)*Id
print"The drain current (mA)is=",round(Id,2),"mA" #answer is wrong in book
#(e) Calculate the saturation drain current at Vg=0
Vg=-1.5 #gate voltage in volt
Vg=-1*Vg #we take only magnitude
x=(Vg+round(w0,3))/(round(Vp,2))
y=sqrt(((Vg+round(w0,3))/(round(Vp,2)))**3)
y=y*2/3
Idsat=(1.0/3)-x+y
Idsat=round(Ip,2)*Idsat
print"The saturation drain current (mA)is=",round(Idsat,3),"mA" #answer is wrong in book
#(f) Calculate the cut-off frequency
fc=(2*un*q*Nd*(a**2))/(math.pi*es*(L**2));
fc=fc/(10**9) #in GHz
print"The cut-off frequency(Ghz)=",round(fc,1),"GHz"
#calculate Pinch-Off Voltage Of a MESFET
a=0.1*(10**-6) #channel height in meter
Nd=8*(10**23) #Electron Concetration /m3
er=13.10 #relative dielectric constant
es=8.854*(10**-12)*er #permittivity of GaAs in F/m
q=1.6*(10**-19) #electronic charge in C
Vp=(q*Nd*(a**2))/(2*es)#pinch-off voltage
print"Pinch-off volatge in(Volts)is=",round(Vp),"V"
#(a) Calculate the pinch-off voltage
a=0.1*(10**-6) #channel height in meter
Nd=8*(10**23) #Electron Concetration in /m3
er=13.1 #relative dielectric constant
e=8.854*(10**-12)*er #permittivity of GaAs in F/m
q=1.6*(10**-19) #electronic charge in C
Vp=(q*Nd*(a**2))/(2*e) #pinch-off voltage
print"Pinch-off volatge in(Volts)is=",round(Vp,2),"V"
#(b)Calculate the velocity ratio
un=0.08 #electron mobility in m2/V.s
vs=2*(10**5) #saturation drift velocity in m/s
L=14*(10**-6) #channel length in meter
n=(Vp*un)/(vs*L)
print"The velocity ratio is=",round(n,3)
#(c) Calculate the saturation current at Vg=0
L=14*(10**-6) #channel length in meter
Z=36*(10**-6) #channel width in meter
Ipsat=(q*Nd*un*a*Z*round(Vp,2))/(3*L)
Ipsat=Ipsat*1000 #in mA
print"The saturation current at Vg=0 is=",round(Ipsat,3),"mA"
#(d) Calculate the drain current
Vd=5 #drain voltage
Vg=-2 #gate voltage
Vg=-1*Vg
u=sqrt((Vd+Vg)/Vp)
p=sqrt((Vg)/Vp)
Id=(3*((u**2)-(p**2))-2*((u**3)-(p**3)))/(1+(n*((u**2)-(p**2))))
Id=Id*Ipsat
print"The drain current (mA)is=",round(Id,2),"mA"
import math
#(a) Calculate the cut-off frequency
gm=0.05 #device transconductance in mho
Cgs=0.60*(10**-12) #gate source capacitance in Farad
fco=(gm)/(2*math.pi*Cgs)
fco=fco/(10**9) #in GHz
print"The cut-off frequency(in GHz)is=",round(fco,2),"GHz"
#(b)Calculate the maximum operating frequency
Rd=450 #drain resistance in ohms
Rs=2.5 #source-gate resistance in ohms
Rg=3 #gate metallization resistance in ohms
Ri=2.5 #input resistance
fmax=(fco/2)*sqrt(Rd/(Rs+Rg+Ri))
print"The maximum operating frequency(in Ghz)is=",round(fmax,2),"GHz"
#Calculate the Drain Current
q=1.60*(10**-19) #charge of electron in C
n=5.21*(10**15) #two-dimensional electron gas density in /m2
W=150*(10**-6) #gate width in meter
v=2*(10**5) #electron velocity in m/sec
Ids=q*n*W*v
Ids=1000*Ids #in mA
print"The drain current in(mA) is=",int(Ids),"mA"
#(a) Calculate the conduction band-edge difference between GaAs and AlGaAs
Ega=1.8 #AlGaAs bandgap in volt
Egg=1.43 #GaAs bandgap in volt
AEc=Ega-Egg
print"The conduction band-edge difference(in Volt) is=",AEc,"V"
#(b) Calculate the sesitivity of the HEMT
q=1.6*(10**-19) #charge of electron in C
Nd=2*(10**24) #donar concentration /m3
wms=0.8 #metal-semiconductor schottky barrier potential in volt
Vth=0.13 #threshold voltage in volt
er=4.43 #AlGaAs dielectric constant
e=er*(8.854*(10**-12))
S=-sqrt((2*q*Nd*(wms-AEc-Vth))/(e)) #sesitivity of the HEMT
S=S/(10**6)
S=-1*S
print"The sensitivity of the HEMT (mV/nm) is=",int(round(S)),"mV/nM"
import math
#(a) Calculate the surface potential ws(inv) for strong inversion
kt=26*(10**-3)
Na=3*(10**17) #doping concentration in /cm3
Ni=1.5*(10**10)
wsinv=2*kt*math.log(Na/Ni)
print"The strong potential w(inv) for strong inversion(in volts) is=",round(wsinv,3),"V"
#(b)Calculate the insulator Capacitance
eir=4 #relative dielectric constant of SiO2
ei=8.854*(10**-12)*eir #permittivity of SiO2 in F/m
d=0.01*(10**-6) #insulator depth in meter
Ci=ei/d
Ci=Ci*(1000)
print"The insulator Capacitance(in mF/m**2) is=",round(Ci,2),"mF/m2"
#(c) Calculate the threshold voltage
q=1.6*(10**-19)
Na=3.0*(10**23)
er=11.8
e=8.854*(10**-12)*er #permittivity of SiO2 in F/m
Vth=wsinv+((2/(Ci*(10**-3)))*sqrt(e*q*Na*(wsinv/2)))
print"The threshold voltage(in Volts) is=",round(Vth,2),"V"
#(a)Calculate the insulator capacitance
eir=3.9 #constant of SiO2
ei=8.854*(10**-12)*eir #permittivity of SiO2 in F/m
d=0.05*(10**-6) #insulator thickness in meter
Ci=ei/d
print"The insulator capacitance(in F/m**2) is=","{:.2e}".format(Ci),"F/m2"
#(b)Calculate the saturation drain current
Z=12*(10**-6) #channel depth in meter
Vg=5 #gate voltage in volt
Vth=0.10 #threshold voltage in volt
vs=1.70*(10**5) #electron velocity in m/s
Idsat=Z*round(Ci,6)*(Vg-Vth)*vs
Idsat=Idsat*1000 #in mA
print"The saturation drain current(in mA) is=",round(Idsat,2),"mA"
#(c)Calculate the transconductance in the saturation region
Z=12*(10**-6) #channel depth in meter
vs=1.70*(10**5) #electron velocity in m/s
gmsat=Z*Ci*vs
gmsat=gmsat*10**3
print"the transconductance in the saturation region(in millimhos) is=",round(gmsat,2),"millimhos"
#(d)Calculate the maximum operating frequency in the saturation region
vs=1.70*(10**5)
L=4*(10**-6) #channel length in meter
fm=vs/(2*math.pi*L)
fm=fm/(10**9) #in GHz
print"The maximum operating frequency in the saturation region(in GHz) is=",round(fm,2),"GHz"
# Calculate the power dissipation per bit
n=3 #number of phases
f=10*(10**6) #clock frequency in Hertz
V=10 #applied voltage in volts
Qmax=0.04*(10**-12) #maximum stored charges in Coulomb
p=n*f*V*Qmax
p=p*(10**6) #in mW
print"The power dissipation per bit(micro watt)is=",int(p),"micro Watt"
#(a)Calculate the insulator capacitance
eir=3.9 #insulator relative dielectric constant
ei=8.854*(10**-12)*eir #permittivity of material in F/m
d=.15*(10**-6) #insulator thickness in meter
Ci=ei/d
Ci=Ci*(10**5)
print"The insulator capacitance(in nF/cm**2) is =",int(round(Ci)),"nF/cm2"
#(b)Calculate the maximum stored charges per well
Nmax=2*(10**12) #electron density in /cm2
q=1.6*(10**-19) #charge of electron in C
A=.5*(10**-4) #insulator cross-section in cm2
Qmax=Nmax*A*q
Qmax=Qmax*(10**12) #in pC
print"The maximum stored charges per well(picocoulombs)is=",int(Qmax),"pC"
#(c) Calculate the required applied gate voltage
Nmax=2*(10**12)
q=1.6*(10**-19)
Vg=(Nmax*q)/(Ci*10**-9)
print"The required applied gate voltage(in Volts) is=",int(round(Vg)),"V"
#(d)Calculate the clock frequency
P=.67*(10**-3) #power dissipation allowable per bit in Watt
n=3
f=P/(n*Vg*Qmax*(10**-12))
f=f/(10**6) #in MHz
print"The clock frequency(in MHz) is=",int(f),"MHz"