e = 1.6*10**-19
n = 10**22
rho = 2.7*10**(-6)
print"using following terms J = Current density ; s(sigma) = 1/rho = conductivity ; F = Electric field "
print"Using relations J = s*F = n*e*v = n*e*u*F ; we get"
mu_ = 1.0/(n*e*rho)
print"The mobility of electrons in aluminium is ,mu_ =","{:.2e}".format(mu_),"cm**2(Vs)**-1"
#The answer given in the book is 240.4 cm**2/Vs which is wrong
e = 1.6*10**-19
apsilen = 11.9*8.85*10**-12
A= 7.85*10**-9
S= 3*10**24
Nd = (2/(S*e*apsilen*(A**2)))
print"The doping density in silicon is ,Nd =","{:.2e}".format(Nd),"m**-3"
Nd = 10**16
Nc = 2.8*10**19
kBT=0.026
Vf=0.3
e = 1.6*10**-19
A= 10**-3
print" for W-n type Si schottky barrier "
T = 300
phi_b = 0.67
print"schottky barrier heights(in volts) =","{:.2e}".format(phi_b),"eV"
R = 110
Is = A*R*(T**2)*(exp(-(phi_b)/(kBT)))
print"The reverse saturation current is ,Is =","{:.2e}".format(Is),"A"
print"using relation I= Is*(exp((e*V)/(nkBT))-1) and neglecting 1"
I = Is*(exp((Vf)/(kBT)))
print"I=","{:.1e}".format(I),"A"
print" for Si p+ -n junction diode "
Na = 10**19
Db = 10.5
Tb = 10**-6
Lb = sqrt(Db*Tb)
print"The electron carrier diffusion length is,Lb =","{:.2e}".format(Lb),"cm"
pn = 2.2*10**4
Io = A*e*pn*(Db/Lb)
print"The saturation current current is Io =","{:.1e}".format(Io),"A"
I1 = Io*(exp((Vf)/(kBT)))
print"The diode current for HBT is ,I =","{:.1e}".format(I1),"A"
print"Since diode current for HBT is almost 6 orders of magnitude smaller than the value in the Schottky diode "
print"hence for the p-n diode to have the same current that the schottky dode has at .3 V , the voltage required is .71V"
kBT=0.026
mo = 9.1*10**-31
m=0.08*mo
T = 300
phi_b1 = 0.7
phi_b2 = 0.6
R = 120*(m/mo)
print"The effective richardson constant is ,R* =",round(R,2)," A cm**-2 k**-2"
Js1 = R*(T**2)*(exp(-(phi_b1)/(kBT)))
print"The saturation current density is ,Js(phi_b=0.7) =","{:.1e}".format(Js1),"A/cm**2"
Js2 = R*(T**2)*(exp(-(phi_b2)/(kBT)))
print"The saturation current density is ,Js(phi_b=0.6) =","{:.2e}".format(Js2),"A/cm**2"
apsilen = 11.9*8.85*10**-12
Nd = 10**16
Nc = 2.8*10**19
kBT = 0.026
I=10*10**-3
e = 1.6*10**-19
A= 10**-3
print" for W-n type Si schottky barrier "
T = 300
phi_b = 0.67
R = 110
Is = A*R*(T**2)*(exp(-(phi_b)/(kBT)))
V = kBT*(log(I/Is))
E = kBT*log(Nc/Nd)
print"The fermi level positionin the neutral semiconductor(Efs) with respect to the conduction band is,Ec-Efs= E = ","{:.2e}".format(E),"eV"
Vbi= phi_b-(E)
print"The built in voltage is ,Vbi=","{:.2e}".format(Vbi),"V"
Cd = A*sqrt((e*Nd*apsilen)/(2*(Vbi-V)))
print"The diode capacitance is ,Cd =","{:.2e}".format(Cd),"F"
R = kBT/I
print"The resistance is ,R =","{:.2e}".format(R),"ohm"
RC = R*Cd
print"The RC time constant is ,RC(schottky) =","{:.2e}".format(RC),"s"
print" for Si p+ -n junction diode "
Tb = 10**-6
print"In the p-n diode the junction capacitance and the small signal resistance will be same as those in the schottky diode"
Cdiff = ((I*Tb)/(kBT))
print"The diffusion capacitance is ,Cdiff = (I*Tb)/(kBT) = ","{:.2e}".format(Cdiff),"F"
RC1 = R*Cdiff
print"The RC time constant is ,RC(p-n) = ","{:.2e}".format(RC1),"s"
print"From the above RC time constant value it can be concluded that p-n diode is almost 1000 times slower"
# Note: due to approximation, the value of diode capicitance and diffusion capacitance are differ from that of the textbook
apsilen = 11.9*8.85*10**-14
phi_b = 0.66
mo = 9.1*10**-31
m=0.34*mo
e = 1.6*10**-19
h = 1.05*10**-34
n1 = 10**18
n2 = 10**20
print"Assume that the built in potential Vbi is same as barrier potential becouse of highly doped semiconductor"
W1 = (sqrt((2*apsilen*phi_b)/(e*n1)))/10**-8
print"The depletion width is ,W(n=10**18) =","{:.2e}".format(W1)," Angstrom"
W2 = (sqrt((2*apsilen*phi_b)/(e*n2)))/10**-8
print"The depletion width is ,W(n=10**20) =","{:.2e}".format(W2)," Angstrom"
F1 = phi_b/(W1*10**-8)
print"The average field in depletion region for(n=10**18), F1 =","{:.2e}".format(F1),"V/cm"
F2 = phi_b/(W2*10**-8)
print"The average field in depletion region for(n=10**18), F2 =","{:.2e}".format(F2),"V/cm"
F1 = F1/10**-2
F2 = F2/10**-2
T = exp(-(4.0*(2.0*m)**.5*(e*phi_b)**(3.0/2.0))/(3.0*e*F1*h))
print"The tunneling current for(n=10**18),T =","{:.2e}".format(T),"V/cm"
T1 = exp(-(4.0*(2.0*m)**.5*(e*phi_b)**(3.0/2.0))/(3.0*e*F2*h))
print"The tunneling current for(n=10**20), T1 =","{:.2e}".format(T1),"V/cm"
# in the textbook author has used approximate value for depletion width and hence it affect the value of all other answer
# NOTE: In the textbook author has used approximate answer for tunneling current
n = 10**18
W = 25*10**-4
R = 100*10**3
e = 1.6*10**-19
D= 5000*10**-8
mu_=100.0
Ro = 1.0/(n*e*mu_*D)
print"The sheet resistance of the film is ,Ro =","{:.2e}".format(Ro)," ohm/square"
L = (R*W)/Ro
print"The length of the desired resistor is ,L =","{:.2e}".format(L)," cm"