## Carrier concentration vs. Fermi energy

For a doped semiconductor, the density of electrons in the conduction band is,

$$n = N_c(T)\exp\left(\frac{E_F-E_c}{k_BT}\right).$$
The density of holes in the valence band is,

$$p = N_v(T)\exp\left(\frac{E_v-E_F}{k_BT}\right).$$
The density of ionized donors is,

$$N_D^+=\frac{N_D}{1+2\exp\left(\frac{E_F-E_D}{k_BT}\right)}.$$
and the density of ionized acceptors is,

$$N_A^-=\frac{N_A}{1+4\exp\left(\frac{E_A-E_F}{k_BT}\right)}.$$
The factor of 4 is valid in the formula for the acceptors if the semiconductor has a light hole and a heavy hole band as Si and Ge do.

The four quantities $n$, $p$, $N_D$, and $N_A$ can only be determined if the Fermi energy, $E_F$, is known. Typically, $E_F$ must first be determined from the charge neutrality condition,

$$n+N_A^- = p+N_D^+.$$
The Fermi energy can be found by solving the charge neutrality condition numerically. One way to do this is to program the formulas for *n*, *p*, *N*_{d}^{+}, and *N*_{a}^{-} in a spreadsheet. Then choose a temperature and calculate *n*, *p*, *N*_{d}^{+}, *N*_{a}^{-} for every value of the Fermi energy between *E*_{v} and *E*_{c}. For one of these *E*_{f} values, the charge neutrality condition will be satisfied.

When *n* + *N*_{a}^{-} and , *p* + *N*_{d}^{+} are ploted as a function of *E*_{F}, the Fermi energy is where the two lines cross. A new plot like the one below can be generated by pressing the 'Replot' button.

Normally it is not necessary to determine *E*_{f} numerically and the following approximation is sufficient.

**n-type** *N*_{d} > *N*_{a}:

*n* = *N*_{d} - *N*_{a}

*p* = *n*_{i}²/*n*

*E*_{f} = *E*_{c} - *k*_{B}Tln(*N*_{c}/(*N*_{d} - *N*_{a}))

**p-type** *N*_{a} > *N*_{d}:

*p* = *N*_{a} - *N*_{d}

*n* = *n*_{i}²/*p*

*E*_{f} = *E*_{v} + *k*_{B}Tln(*N*_{v}/(*N*_{a} - *N*_{d}))

The plot is generated with the following code:
for (i=0; i<500; i++) {
Ef = i*Eg/500;
n=Nc*pow(T/300,1.5)*exp(1.6022E-19*(Ef-Eg)/(1.38E-23*T));
p=Nv*pow(T/300,1.5)*exp(1.6022E-19*(-Ef)/(1.38E-23*T));
Namin = Na/(1+4*exp(1.6022E-19*(Ea-Ef)/(1.38E-23*T)));
Ndplus = Nd/(1+2*exp(1.6022E-19*(Ef-Ed)/(1.38E-23*T)));
}