A type of transistor known as a bipolar junction transistor (BJT) employs both electrons and holes as charge carriers. A type of field-effect transistor called a unipolar transistor only employs one kind of charge carrier.
A bipolar transistor can be used for switching or amplification by allowing a tiny current to be injected at one of its terminals and controlling a much greater current flowing between two other terminals.
BJTs are regions in a single crystal of material that have two junctions between the n-type and p-type semiconductor types.
We can create the junctions in a variety of ways, for as by doping the semiconductor differently as it grows or by depositing metal pellets to create alloy junctions.
The active region, cut-off region, and saturation region are the three modes of a transistor. The transistor functions as a switch in the cut-off and saturation modes. During the cutoff zone, the transistor is off, and during the saturation period, it is on.
Last but not least, a transistor can function as a switch because a little electric current running through one part of it induces a greater current to flow through the other.