**Charge Neutrality Equation in Semiconductor:**

The semiconductor crystal is electrically neutral under thermal equilibrium conditions. The electrons are distributed among the different energy states, producing both negative and positive charges but the net charge density is zero. This charge neutrality condition is used for determination of the thermal-equilibrium electron and the hole concentrations as a function of impurity doping concentration.

**Compensated Semiconductors:**

A semiconductor containing both donor and acceptor impurity atoms in the same region is called a **compensated semiconductor**, It is formed by diffusing donor impurities into a P-type material (N_{A} > N_{D}) or by diffusing acceptor impurities into an N-type material (N_{D} > N_{A}). If N_{D} = N_{A}, we have a completely compensated conductor. Compensated conductors are produced quite naturally during device fabrication.

Energy hand diagram of a compensated semiconductor is shown in Fig. 6.40. The figure depicts how the electrons and holes can be distributed among the various states.

The charge density of negative and positive charges can be equated for charge neutrality condition and thus we have

where p_{0 }and n_{0} are the thermal-equilibrium concentrations of holes and electrons in the valence and conduction bands respectively. The parameter p_{A }is the concentration of holes in the acceptor energy states, so N^{–}_{A}Â = N_{A}Â – p_{A}Â is the concentration of negatively charged acceptor states. Similarly, n_{D} is the concentration of electrons in the donor energy states, so N^{+}_{DÂ }= N_{D}Â – n_{D}Â is the concentration of positively charged donor states. For complete ionization n_{D} and P_{A} are both zero so that Eq. (6.140) becomes

If is expressed as n^{2}_{i}/n_{0}, then

The positive sign in the quadratic equation is required to be used, since, in the limit of an intrinsic semiconductor when N_{A} = N_{D} = 0, the electron concentration must be a positive quantity, or n_{0}Â = n_{i}.

Above Eq. (6.144) is used to determine the electron concentration in an N-type semiconductor or when N_{D} > N_{A}. This equation is also valid for N_{A} = 0.