from __future__ import division
import math
# Python Code Ex13.3 Intrinsic concentration of charge
# carriers in semiconductors: Page-432 (2010)
#Variable declaration
k = 1.38e-023; # Boltzmann constant, J/mol/K
h = 6.626e-034; # Planck's constant, Js
eV = 1.6e-019; # Joule equivalent of 1 eV
T = 300; # Room temperature, kelvin
m_0 = 9.1e-031; # Rest mass of an electron, kg
#Calculation
m_e = 0.12*m_0; # Effective mass of electron, kg
m_h = 0.28*m_0; # Effective mass of electron, kg
E_g = 0.67; # Energy gap of Ge, eV
# Intrinsic carrier concentration of Ge, per metre cube
n_i = 2*(2*math.pi*k*T/h**2)**(3/2)*(m_e*m_h)**(3/4)*math.exp(-E_g*eV/(2*k*T));
#Result
print"\nThe intrinsic carrier concentration of Ge ="
print round((n_i*10**-18),2)*10**18,"per metre cube"
from __future__ import division
import math
# Python Code Ex13.4 Comparison of intrinsic carrier densities of
#two semiconductors at room temperature Page-433 (2010)
#Variable declaration
eV = 1.6e-019; # Joule equivalent of 1 eV
m = 9.1e-031; # Rest mass of an electron, kg
m_e = m; # Effective mass of electron, kg
m_h = m; # Effective mass of electron, kg
Eg_A = 0.36; # Energy gap of A, eV
Eg_B = 0.72; # Energy gap of B, eV
k = 1.38e-023; # Boltzmann constant, J/mol/K
h = 6.626e-034; # Planck's constant, Js
k_T = 0.052/2; # Thermal energy, eV
#Calculation
# As n_i_ratio = ni_A/ni_B = math.exp(-Eg_A/(2*k_T))/math.exp(-Eg_A/(2*k_T))
# Intrinsic carrier density ratio of A and B
n_i_ratio = math.exp(-Eg_A/(2*k_T))/math.exp(-Eg_B/(2*k_T));
#Result
print"\nThe ratio of intrinsic carrier density =", round(n_i_ratio)
from __future__ import division
import math
# Python Code Ex13.5 Shift in position of fermi level
#with change in concentration of impurities: Page-436 (2010)
#Variable declaration
k_T = 0.03; # Thermal energy, eV
# Energy difference between fermi level and topmost valence level, eV
dE_Fv = 0.4;
#Calculation
# The hole concentration in P-type material is
# p = N_A = N_v*math.exp(-EF-Ev)/(k_T) = N_v*math.exp(-dE_Fv)/(k_T)
# The new value of hole concentration in P-type material is
# p_prime = 3*N_A = N_v*math.exp(-EF_prime-Ev)/(k_T)=
# N_v*math.exp(-dE_F_primev)/(k_T)
# Solving for dE_F_primev by removing exponetial term
# Energy difference between new fermi level and topmost valence level, eV
dE_F_primev = dE_Fv - k_T*math.log(3);
#Result
print"\nThe energy diff. between new fermi level and topmost valence level ="
print round(dE_F_primev,2),"eV"
from __future__ import division
import math
# Python Code Ex13.6 Electrical resistivity of Ge: Page-439 (2010)
#Variable declaration
e = 1.602e-019; # Charge on an elctron, C
# Intrinsic carrier density of Ge at room temperature, per metre cube
n_i = 2.37e+019;
mu_e = 0.38; # Mobility of electrons, metre square per volt per second
mu_h = 0.18; # Mobility of holes, metre square per volt per second
T = 300; # Room temperature, kelvin
#Calculation
# Intrinsic electrical conductivity, per ohm per metre
sigma_i = n_i*e*(mu_e + mu_h);
rho_i = 1/sigma_i; # Intrinsic electrical resistivity, ohm-metre
#Result
print"\nThe intrinsic electrical resistivity =",round(rho_i,2)," ohm-metre"
from __future__ import division
import math
# Python Code Ex13.7 Electrical conductivity of intrinsic and
# extrinsic Si: Page-439 (2010)
#Variable declaration
NA = 6.023e+23; # Avogadro's number
A_Si = 28.09e-03; # Kilogram atomic mass of Si, kg
e = 1.602e-019; # Charge on an elctron, C
n_impurity = 1/1e+08; # Donor impurity atoms per Si atom
n_i = 1.5e+016;#Intrinsic carrier density of Si at room temp.,per metre cube
mu_e = 0.13; # Mobility of electrons, metre square per volt per second
mu_h = 0.05; # Mobility of holes, metre square per volt per second
T = 300; # Room temperature, kelvin
#Calculation
sigma_i = n_i*e*(mu_e + mu_h)#Intrinsic electrical conductivity, per ohm per m
Si_density = 2.23e+03; # Density of silicon, kg per metre cube
N_Si = NA * Si_density/A_Si; # Number of Si atoms, per metre cube
N_D = N_Si*n_impurity; # Density of donor impurity, per metre cube;
sigma_ext = (N_D)*e*mu_e#Extrinsic electrical conductivity of Si, per ohm per m
#Result
print"\nThe intrinsic electrical conductivity of Si ="
print round((sigma_i*10**4),2)*10**-4," per ohm per metre"
print"\nThe extrinsic electrical conductivity of Si ="
print round(sigma_ext,2)," per ohm per metre"
from __future__ import division
import math
# Python Code Ex13.8 Resistance of intrinsic Ge Rod: Page-440 (2010)
#Variable declaration
e = 1.602e-019; # Charge on an elctron, C
T = 300; # Room temperature, kelvin
l = 1e-02; # Length of the Ge rod, m
b = 1e-03; # Width of the Ge rod, m
t = 1e-03; # Thickness of the Ge rod, m
n_i = 2.5e+019; # Intrinsic carrier density of Ge, per metre cube
mu_e = 0.39; # Mobility of electrons, metre square per volt per second
mu_h = 0.19; # Mobility of holes, metre square per volt per second
#Calculation
# Intrinsic electrical conductivity, per ohm per metre
sigma_i = n_i*e*(mu_e + mu_h);
A = b*t; # Surface area of the Ge rod, metre square
rho = 1/sigma_i; # Electrical resistivity of Ge Rod, ohm-metre
R = rho*l/A; # Resistance of Ge Rod, ohm
#Result
print"\nThe resistance of Ge Rod =",round((R*10**-3),1)*10**3,"ohm"
from __future__ import division
import math
# Python Code Ex13.9 Hall effect in Si semiconductor: Page-442 (2010)
#Variable declaration
e = 1.602e-019; # Charge on an elctron, C
T = 300; # Room temperature, kelvin
R_H = -7.35e-05; # Hall co-efficeint of Si specimen, metre cube per coulomb
sigma = 200; # Electrical conductivity of Si, per ohm per metre
#Calculation
n = -1/(e*R_H); # Electron density in the Si specimen
# Electron mobility in the Si specimen, metre cube per volt per second
mu_e = sigma/(n*e);
#Result
print"\nThe density of electron =",round((n*10**-22),2)*10**22,"metre cube"
print"\nThe mobility of electron ="
print round(mu_e,3),"metre cube per volt per second"
from __future__ import division
import math
# Python Code Ex13.10 Forward current of a p-n diode in terms of
# reverse saturation current using diode equation: Page-450 (2010)
#Variable declaration
e = 1.6e-019; # Charge on an electron, coulomb
k = 1.38e-023; # Boltzmann constant, J/mol/K
V = 0.35; # Potential difference applied across a Ge diode, volt
T = 300; # Room temperature, kelvin
Io = 1;#Reverse saturation current, micro-ampere, for simplicity assume I0 = 1
#Calculation
# "Diode Equation" for net forward current, milliamperes
Iv = Io*(math.exp(e*V/(k*T))-1);
#Result
print"\nThe net forward current =",round((Iv*10**-5),2)*10**5,"Io"
from __future__ import division
import math
# Python Code Ex13.11 Finding voltage from net forward current
#using Diode Equation: Page-450 (2010)
#Variable declaration
e = 1.6e-019; # Charge on an electron, coulomb
k = 1.38e-023; # Boltzmann constant, J/mol/K
T = 300; # Room temperature, kelvin
Io = 1;# Reverse saturation current, micro-ampere, for simplicity assume I0 = 1
#Calculation
Iv = 0.9*Io; # "Diode Equation" for net forward current, milliamperes
# As Iv = Io*(math.exp(e*V/(k*T))-1), solving for V
# Potential difference applied across p-n junction, volt
V = math.log(Iv/Io+1)*k*T/e;
#Result
print"\nThe potential difference applied across p-n junction ="
print round(V,2),"volt"