For example, in the case of silicon, which is a semiconductor, doping can be done by adding atoms with either one more or one less valence electron than silicon. If atoms with one more valence electron are added (such as phosphorus), the extra electrons become loosely bound and can easily move around the crystal lattice, creating a negative charge carrier known as an n-type semiconductor. On the other hand, if atoms with one less valence electron are added (such as boron), the resulting holes (missing electrons) can move around the lattice, creating a positive charge carrier, leading to a p-type semiconductor.
By carefully controlling the type and concentration of dopants, the electrical conductivity of a crystal can be precisely adjusted for various applications. Doping is essential in the fabrication of transistors, diodes, and other semiconductor devices that form the backbone of modern electronics.