In [1]:

```
from __future__ import division
from math import sqrt
# given data
E=2.1 #in eV
E=E*1.602*10**-19 # in J
m=9.107*10**-31 # in kg (mass of electron)
# Formula E=1/2*m*v**2
v=sqrt(2*E/m)
print " Velocity of electron at Fermi-level is : %0.1e"%(v)," m/s"
```

In [2]:

```
# given data
E=5.5 # in eV (Fermi energy)
E=E*1.6*10**-19 # in J
miu_e=7.04*10**-3 #in m**2/V-s (Mobility of electrons)
n=5.8*10**28 # in /m**3 (Number of conduction electrons/m**3)
e=1.6*10**-19 # in coulomb
m=9.1*10**-31 #in kg
#(i) Relaxation time,
tau=miu_e/e*m
print "(i) Relaxation time is : ",(tau)," second"
sigma=(n*e*miu_e)
#(ii) Resistivity of conductor,
rho=1/sigma
print "(ii) Resistivity of conductor is : %0.2e"%(rho)," ohm-meter"
# (iii) Let Velocity of electrons with fermi energy = v
v=sqrt(2*E/m)
print "(iii) Velocity of electron with Fermi-level is : %0.4e"%(v)," m/s"
```

In [3]:

```
# given data
n_i=2.5*10**13 # in /cm**3
rho=0.039 # in ohm-cm
sigma_n=1/rho
e=1.602*10**-19 # in C
miu_e=3600 # in cm**2/V-s
#since sigma_n = n*e*miu_e = N_D*e*miu_e
N_D=sigma_n/(e*miu_e)
n=N_D # (approx)
print "Concentration of electrons is : %0.2e"%(n)," /cm**3"
p=n_i**2/n
print "Concentration of holes is : %0.1e"%(p)," /cm**3"
```

In [4]:

```
from __future__ import division
# given data
SiliconAtom=5*10**22 # unit less (Number of silicon atom)
DonorImpurity=1/10**6
n_i=1.45*10**10 # in cm**-3
e=1.602*10**-19 # in C
miu_e=1300 # taking miu_e for Si as 1300 cm**2/V-s
# (i) Donor atom concentraion
# Formula N_D= Number of silicon atoms/cm**3 * donor impurity
N_D=SiliconAtom*DonorImpurity
print "(i) Donor atom concentration is : ",(N_D)," per cm**3"
# (ii) Mobile electron concentration
n=N_D # (approx.)
print "(ii) Mobile electron concentration is : ",(n)," per cm**3"
# (iii) Hole concentration
p=n_i**2/N_D
print "(iii) Hole concentration is : %0.3e"%(p)," /cm**3"
#(iv) conductivity of doped silicon sample
sigma=n*e*miu_e
print "(iv) conductivity of doped silicon sample is : ",(sigma)," S/cm"
rho=1/sigma
#(v) resistance of given semiconductor
l=0.5 # in cm
a=(50*10**-4)**2
R=rho*l/a
print "(v) Resistance of give semiconductor is : %0.f"%(R)," ohm"
```

In [5]:

```
# given data
n_i=1.4*10**18 # in m**3
N_D=1.4*10**24 # in m**3
n=N_D # (approx)
p=n_i**2/n
# let Ratio of electron to hole concentration = r
r=n/p
print "Ratio of electron to hole concentration is : ",(r)
```

In [6]:

```
# given data
n_i=2.5*10**13 # in cm**3
e=1.6*10**-19 # in coulomb
miu_h=1800 # in cm**2/V-s
miu_e=3800 # in cm**2/V-s
sigma_i=n_i*e*(miu_e+miu_h)
print "Intrinsic conductivity is : ",(sigma_i)," /ohm-cm"
rho_i=1/sigma_i
print "Intrinsic resistiviry is : %0.2f"%(rho_i)," ohm-cm"
```

In [7]:

```
# given data
rho_i=0.47 # in ohm-meter
sigma_i=1/rho_i
miu_e=0.39 # in m**2/V-s
miu_h=0.19 # in m**2/V-s
e=1.6*10**-19 # in C
# since sigma_i=n_i*e*(miu_e+miu_h)
n_i=sigma_i/(e*(miu_e+miu_h))
# so Density of electrons = Intrinsic Concentration,n_i
print "Density of electons is : %0.3e"%(n_i)," /m**3"
E=10**4 # in V/m
v_n=miu_e*E
print "Drift velocity of electrons is : ",(v_n)," m/s"
v_h=miu_h*E
print "Drift velocity of holes is : ",(v_h)," m/s"
```

In [8]:

```
# given data
n_i=1.5*10**10 # in /cm**3
miu_e=1300 # in cm**2/V-s
miu_h=450 # in cm**2/V-s
e=1.6*10**-19 # in C (charge of electrons)
sigma_i=n_i*e*(miu_e+miu_h)
print "Conductivity of silicon (intrinsic) is : ",(sigma_i)," /ohm-cm"
N_A=10**18 # in /cm**3
print "conductivity of the resulting P-type silicon semiconductor"
sigma_p=e*N_A*miu_h
print (sigma_p)," /ohm-cm"
```

In [9]:

```
# given data
n_i=2.5*10**13 # in /m**3
miu_e=3800 # in cm**2/V-s
miu_h=1800 # in cm**2/V-s
e=1.6*10**-19 # in C (charge of electrons)
sigma_i=n_i*e*(miu_e+miu_h)
print "Intrinsic conductivity is : ",(sigma_i)," /ohm-cm"
# Let Number of germanium atoms/cm**3 = no_g
no_g=4.41*10**22
# since Donor impurity = 1 donor atom / 10**7 germanium atoms, so
DonorImpurity=10**-7
N_D=no_g*DonorImpurity
n=N_D # (approx)
p=n_i**2/N_D
# so
sigma_n=e*N_D*miu_e
print "conductivity in N-type germanium semiconductor is : %0.2f"%(sigma_n)," /ohm-cm"
```

In [10]:

```
# given data
e=1.6*10**-19 #in C
miu_e=.38 # in m**2/V-s
miu_h=.18 # in m**2/V-s
l=25 # in mm (length)
l=l*10**-3 # in m
w=4 # in mm (width)
w=w*10**-3 # in m
t=1.5 # in mm (thickness)
t=t*10**-3 # in m
V=10 # in V
l=25 # in mm
l=l*10**-3 #in m
E=V/l
#(i)
v_e=miu_e*E
v_h=miu_h*E
print "Electron drift velocity is : ",(v_e)," m/s"
print "Hole drift velocity is : ",(v_h)," m/s"
n_i=2.5*10**19 #in /m**3
#(ii)
sigma_i=n_i*e*(miu_e+miu_h)
print "Intrinsic conductiviry of Ge is : ",(sigma_i)," /ohm-cm"
#(iii)
a=w*t
I=sigma_i*E*a # in amp
I=I*10**3 # in m A
print "Total current is : ",(I)," mA"
```

In [11]:

```
# given data
k_desh=1.38*10**-23 # in J degree**-1
e=1.602*10**-19 # in C
miu_e=3600 # in cm**2/V-s
miu_h=1700 # in cm**2/V-s
T=300 # in K
D_e=miu_e*k_desh*T/e
print "Diffusion constant of electrons is : %0.f"%(D_e)," cm**2/s"
D_h=miu_h*k_desh*T/e
print "Diffusion constant of holes is : %0.2f"%(D_h)," cm**2/s"
```

In [12]:

```
# given data
e=1.6*10**-19 # in coulomb
Resistivity=9*10**-3 # in ohm-m
R_H=3.6*10**-4 # in m**3 coulomb**-1 (Hall Coefficient)
sigma=1/Resistivity
rho=1/R_H
n=rho/e
print "Density of charge carriers is : %0.5e"%(n)," /m^3"
miu=sigma*R_H
print "Mobility is : ",(miu)," m^2/V-s"
```

In [13]:

```
# given data
E_x=100 # in V/m
e=1.6*10**-19 # in C
R_H=0.0145 # in m**3/coulomb
miu_n=0.36 # in m**2/volt-second
# Formula R_H=1/(n*e)
n=1/(R_H*e)
sigma=n*e*miu_n
J=sigma*E_x
print "Current density is : %0.f"%(J)," A per m**2"
```

In [14]:

```
# given data
Resistivity=9 # in milli-ohm-m
Resistivity=9*10**-3 # in ohm-m
miu=0.03 # in m**2/V-s
sigma=1/Resistivity
R_H=miu/sigma
print "Half coefficient is : %0.1e"%(R_H)," m**3/C"
```

In [15]:

```
# given data
E_x=5 # in V/cm
miu_e=3800 # in cm**2/V-s
B_z=0.1 # in Wb/m**2
d=4 # in mm
d=d*10**-3 # in m
v=miu_e*E_x #in cm/second
v=v*10**-2 # in m/second
V_H=B_z*v*d # in V
V_H=V_H*10**3 # in m V
print "Hall voltage is : ",(V_H)," mV"
```

In [16]:

```
# given data
rho=200 # in Kilo ohm-cm
rho=rho*10**-2 # in kilo ohm m
rho=rho*10**3 # in ohm meter
sigma=1/rho
V_H=50 # in mV
V_H=V_H*10**-3 #in V
I=10 # in miu A
I=I*10**-6 #in A
B_z=0.1 # in Wb/m**2
w=3 #in mm
w=w*10**-3 #in meter
R_H=V_H*w/(B_z*I)
print "Mobility of holes in p-type silicon bar is : "
miu_h=sigma*R_H
print str(miu_h)," m**2/V-s"
```

In [17]:

```
# given data
N_D=1*10**21 # in /m**3
B_Z=0.2 # in T
J=600 # in A/m**2
n=N_D
d=4 #in mm
d=d*10**-3 # in meterr
e=1.6*10**-19 # in C (electron charge)
# Formula V_H*w/(B_Z*I) = 1/(n*e) , hence V_H=B_Z*I/(n*e*w)
# where I=J*w*d
# putting I=J*w*d in V_H=B_Z*I/(n*e*w), we get
V_H=B_Z*J*d/(n*e) # in V
V_H=V_H*10**3 # in mV
print "Hall Voltage is : ",(V_H)," mV"
```

In [18]:

```
# given data
w=0.1 # in mm
B_Z=0.6 # in T
R_H=3.8*10**-4 # in m**3/C
I=10 # in mA
I=I*10**-3 #in A
V_H=R_H*B_Z*I/w # in V
V_H=V_H*10**6 # in V
print "Hall voltage is : ",(V_H)," micro volt"
```

In [19]:

```
# given data
Resistivity=9.23*10**-3 # in ohm-m
R_H=3.84*10**-4 #in m**3/C (Hall Coefficient)
sigma=1/Resistivity
rho=1/R_H
e=1.6*10**-19 # in C (electron charge)
n=rho/e
print "Density of charge carriers is : %0.3e"%(n)," /m**2"
miu=sigma*R_H
print "Mobility is : ",round(miu,4)," m**2/V-s"
```

In [20]:

```
from math import atan, degrees
# given data
B=0.48 # in Wb/m**2
R_H=3.55*10**-4 # in m**3/C
Resistivity=.00912 # in ohm
sigma=1/Resistivity
theta_H=degrees(atan(sigma*B*R_H) )
print "Hall angle is : ",round(theta_H,4)," degree"
```

In [21]:

```
# given data
T=27 # in degree C
T=T+273 # in K
# Let E_C - E_F =E_CF
E_CF=0.3 # in eV
# Formula E_C - E_F = k*T*log(n_C/N_D)
# Let log(n_C/N_D) = L, so
L=E_CF/T
T_desh=55 # in degree C
T_desh=T_desh+273 # in K
#At temperature T_desh
new_fermi_level= T_desh*L # where L=log(n_C/N_D)
print "The new position of Fermi Level is : ",(new_fermi_level)," V"
```

In [22]:

```
from math import log
# given data
N_A=8*10**14 # in /cm**3
N_D=N_A
n_i=2*10**13 # in /cm**3
k=8.61*10**-5 # in eV/K
T=300 # in K
V_0=k*T*log(N_D*N_A/n_i**2)
print "Potential barrier is : %0.2f"%(V_0)," V"
```

In [23]:

```
# given data
# (i) when
I_D=2 # in mA
I_D=I_D*10**-3 # in A
V_D=0.5 # in V
R1=V_D/I_D
print "Resistace is : ",(R1)," ohm"
# (ii) when
I_D=20 # in mA
I_D=I_D*10**-3 # in A
V_D=0.8 # in V
R2=V_D/I_D
print "Resistace is : ",(R2)," ohm"
# (ii) when
I_D=-1 # in miu A
I_D=I_D*10**-6 # in A
V_D=-10 # in V
R3=V_D/I_D # in ohm
R3=R3*10**-6 # in M ohm
print "Resistace is : ",(R3)," M ohm"
```

In [24]:

```
from math import exp
# given data
E_G=0.72 # in eV
E_F=E_G/2 # in eV
k=8.61*10**-5 # in eV/K
T=300 # in K
# Formula n_C/n = 1/1+%e**(E_G-E_F)/k*T
# Let n_C/n = N
N=1/(1+exp((E_G-E_F)/(k*T)))
print "Fraction of the total number of electrons (conduction band as well as valence band) : %0.2e"%(N)
```

In [25]:

```
# given data
I_0=.15 # in micro amp
I_0=I_0*10**-6 # in A
V=0.12 # in V
V_T=26 # in mV
V_T=V_T*10**-3 # in V
I=I_0*(exp(V/V_T)-1) # in amp
I=I*10**6 # in micro amp
print "Large reverse bias current is : %0.f"%(I)," micro amp"
```

In [26]:

```
# given data
I=.01 # in A
I_0=2.5*10**-6 # in amp
nita=2 # for silicon
V_T=26 # in mV
V_T=V_T*10**-3 # in V
# Formula I=I_0*(%e**(V/(nita*V_T))-1)
V=nita*V_T*log(I/I_0+1)
print "Forward voltage is : %0.2f"%(V)," V"
```

In [27]:

```
# given data
N_D=10**21 # in m**-3
N_A=10**22 # in m**-3
D_e=3.4*10**-3 # in m**2/s
D_h=1.2*10**-3 # in m**2/s
L_e=7.1*10**-4 # in m
L_h=3.5*10**-4 # in m
n_i=1.602*10**16 # in /m**3
e=1.6*10**-19 # in C (electron charge)
# Formula I_0=a*e*[D_h/(L_h*N_D) + D_e/(L_e*N_A)]*n_i**2
#and
# Reverse saturation current density = I_0/a = [D_h/(L_h*N_D) + D_e/(L_e*N_A)]*e*n_i**2 , So
CurrentDensity= (D_h/(L_h*N_D) + D_e/(L_e*N_A))*e*n_i**2 # in A
CurrentDensity=CurrentDensity*10**6 # in micro A
print "Reverse saturation current density is : %0.2f"%(CurrentDensity)," micro amp"
```

In [28]:

```
# given data'
N_D=10**17*10**6 # in m**-3
N_A=0.5*10**16*10**6 # in atoms/m**3
epsilon_r=10 # in F/m
epsilon_o=8.85*10**-12 # in F/m
epsilon=epsilon_r*epsilon_o
e=1.602*10**-19 # in C (electron charge)
# (i) when no external voltage is applied i.e.
V=0
V_B=0.7 # in V
W=sqrt(2*epsilon*V_B/e*(1/N_A+1/N_D))
print "Junction width is : %0.3e"%(W)," m"
# (ii) when external voltage of -10 V is applied i.e.
V=-10 # in V
V_o=0.7 # in V
V_B=V_o-V
W=sqrt(2*epsilon*V_B/e*(1/N_A+1/N_D))
print "Junction width is : %0.3e"%(W)," m"
# Note: Answer in the book is wrong
```