The addition of a small percentage of foreign atoms in the regular crystal lattice of silicon or germanium produces dramatic changes in their electrical properties, producing n-type and p-type semiconductors.
The addition of pentavalent impurities such as antimony, arsenic or phosphorus contributes free electrons, greatly increasing the conductivity of the intrinsic semiconductor. Phosphorus may be added by diffusion of phosphine gas (PH3).
The addition of trivalent impurities such as boron, aluminum or gallium to an intrinsic semiconductor creates deficiencies of valence electrons, called "holes". It is typical to use B2H6 diborane gas to diffuse boron into the silicon material.
The application of band theory to n-type and p-type semiconductors shows that extra levels have been added by the impurities. In n-type material there are electron energy levels near the top of the band gap so that they can be easily excited into the conduction band. In p-type material, extra holes in the band gap allow excitation of valence band electrons, leaving mobile holes in the valence band.