The physics of semiconductors can be viewed with various levels of rigor. I intend for this writeup to be a nonrigorous introduction to semiconductors that should be understandable to most people. Readers who desire more detailed analysis are encouraged to visit the node semiconductor.
I must point out that in trying to provide an understandable explanation of semiconductor physics, I must be occasionally superficial or even inaccurate. Rigorous analysis of solids requires quantum mechanics and results in ideas that are not intuitive and not easily explained. However, the presentation I give in this writeup is meant to be intuitive, and is a good way of thinking about semiconductors for both laymen and engineers.
I will use the semiconductor silicon as an example throughout this writeup. Silicon is a crystal with a well-known arrangement of atoms called the diamond structure. Every silicon atom has four valence electrons--electrons in the outermost energy shell which are least tightly binded to and furthest away from the nucleus. While the diamond structure is three-dimensional, we can make a two-dimensional diagram that helps us discuss the properties of silicon.
Si:Si:Si:Si:Si:Si:Si
.. .. .. .. .. .. ..
Si:Si:Si:Si:Si:Si:Si
.. .. .. .. .. .. ..
Si:Si:Si:Si:Si:Si:Si
.. .. .. .. .. .. ..
Si:Si:Si:Si:Si:Si:Si
.. .. .. .. .. .. ..
Si:Si:Si:Si:Si:Si:Si
.. .. .. .. .. .. ..
Si:Si:Si:Si:Si:Si:Si
.. .. .. .. .. .. ..
Si:Si:Si:Si:Si:Si:Si
Each Si stands for one silicon atom. Each dot represents a valence electron.
As temperature approaches absolute zero (0K) and the semiconductor is removed from any energy sources (such as light), all of the electrons can be considered to be tightly binded to their atoms. In this situation, the semiconductor acts like an insulator--applied voltage does not result in current flow because there are no "free electrons." As the temperature is increased from 0K or if light is introduced onto the semiconductor, some electrons can obtain enough energy to become "free" and contribute to current flow. It should be noted that such electrons aren't truly free--they are somehow still bound to the silicon crystal. This is one of those cases where we really need quantum mechanics to explain what is happening. In this writeup, the term "free electron" refers to an electron which can contribute to current flow.
So here comes the tricky part. Valence electrons can acquire enough energy to contribute to current. We shall say that these electrons have left the valence band--an energy band that contains bound, nonconductive electrons--and joined the conduction band--an energy band that contains "free electrons." All of these terms have rigorous physical meanings, but we can treat them simply as terminology. When an electron leaves the valence band, a hole is said to be left there. Strangely enough, this hole behaves like a positively-charged particle and contributes to conduction in a similar way to the free electron! Again, an explanation for this phenomenon requires quantum mechanics and I hope the reader can simply accept it. I will put it another way--thermal and optical energy cause the generation of electron-hole pairs. The electrons and holes act as independent "carriers" of current.
At room temperature and typical light intensities, pure silicon has concentrations of 1010/cm3 free electrons and holes. Since free electrons and holes are created simultaneously, the concentrations are equal. 1010 might seem like a big number, but it results in negligible current flow. As a comparison, a metal typically has a free electron concentration of about 5x1022/cm3. It shouldn't be surprising that metals have far higher conductivity than pure semiconductors.
The really important part
Elements can be added to semiconductors to change their properties. The elements are called dopants or impurities and the process is known as doping. Doping is usually accomplished by the microfabrication technique ion implantation. Silicon atoms are said to have a valence of 4, since they have 4 valence electrons. Dopants to silicon have valences of either 3, in which case they are called acceptors, or 5, in which case they are called donors.
Let's look at what happens when the donor arsenic (As) is added to the silicon crystal.
Si:Si:Si:Si:Si:Si:Si
.. .. .. .. .. .. ..
Si:Si:Si:Si:Si:Si:Si
.. .. .. .. .. .. ..
Si:Si:Si:Si:Si:Si:Si
.. .. .. ..... .. ..
Si:Si:Si:As:Si:Si:Si
.. .. .. .. .. .. ..
Si:Si:Si:Si:Si:Si:Si
.. .. .. .. .. .. ..
Si:Si:Si:Si:Si:Si:Si
.. .. .. .. .. .. ..
Si:Si:Si:Si:Si:Si:Si
Notice that the crystal is very similar to before except that there is one additional electron (and a different nucleus in one spot). At room temperature, this additional electron almost always becomes a free electron in the conduction band. The silicon is said to be n-doped (n means "negative") and is called an n-type semiconductor. It is important to see that this electron does not have a corresponding hole.
If acceptor atoms (always Boron for Si) are added to the silicon, the crystal looks like this:
Si:Si:Si:Si:Si:Si:Si
.. .. .. .. .. .. ..
Si:Si:Si:Si:Si:Si:Si
.. .. .. .. .. .. ..
Si:Si:Si:Si:Si:Si:Si
.. .. .. . .. .. ..
Si:Si:Si: B:Si:Si:Si
.. .. .. .. .. .. ..
Si:Si:Si:Si:Si:Si:Si
.. .. .. .. .. .. ..
Si:Si:Si:Si:Si:Si:Si
.. .. .. .. .. .. ..
Si:Si:Si:Si:Si:Si:Si
Here there's an extra hole without a corresponding free electron. The semiconductor is said to be p-doped and is called a p-type semiconductor.
Adding dopants to a semiconductor increases its conductivity because there are more current carriers. N-type semiconductor and p-type semiconductor behave quite similarly. However, the behavior in a junction of the two materials is very unusual and deserves a separate treatment (see p-n junction). The interesting behavior of p-n junctions (for instance, they allow current to flow in only one direction) can be exploited to produce many semiconductor devices, such as diodes, MOSFETs, and bipolar junction transistors.
For practical doping levels, it is fair to assume that the free electron concentration is equal to the concentration of donor atoms and the hole concentration is equal to the concentration of acceptor atoms. However, if both donors and acceptors are present, free electrons created by the acceptors tend to fill the holes created by the donors. If there is a higher concentration of donors than acceptors, the semiconductor is n-type and the free electron concentration is approximately the difference between the two doping concentrations. If there is a higher concentration of acceptors, the semiconductor is p-type, and the hole concentration is again the difference between the two doping concentrations.
There's one more thing I want to note. In literature on semiconductor physics, the term "electron" often means "free electron." Whether "electron" means "free electron" or "any electron" is usually clear from the context.
Suggestions for further reading: