How do diodes and transistors work?
When you take some p material and n material and put them together, you get a diode (see the schematic diagram below). If you make the p side positive and the n side negative, then holes move from the p side to the junction, while electrons move from the n side to the junction. At the junction, the electrons ‘fill’ the holes, thereby destroying both the free electron and the hole. So the process can continue indefinitely: the diode conducts in this direction. If you reverse the polarity, holes and electrons both move away from the junction. This leaves no charge carriers near the junction, so there is no conduction. Thus a diode conducts current in only one direction—the direction of the arrow in its circuit symbol. Diodes are useful in rectification (turning AC to DC), in logic circuits and in many other applications in electronics. A junction transistor consists of a thin layer of one type of semiconductor sandwiched between two layers of the other type, as shown in the schematic d