One family of transistors is known as bipolar transistor(bipolar junction transistors BJTs) of which there are two basic types called NPN and PNP. These names relate to the way in which the silicon is doped .
A bipolar transistor is comprised of base, emitter, and collector and is a current-controlled
device with a low input impedance.
The first transistor was invented at Bell Laboratories in 1947 by Nobel-Prize physicists John Bardeen, William Shockley, and Walter Wratain.
The transistor is an active semiconductor device having three or more electrodes and capable of performing functions as : amplification, signal mixing, rectification and switching.
Germanium and silicon are the main materials used, with impurities introduced to determine the conductivity type (n-type has an excess of free electrons; p-type, a deficiency).
Basically, a transistor is two diodes placed back-to-back with a common middle layer, the middle layer in this case being much thinner than the other two.
In the analog world, a transistor can be used as a voltage amplifier, a current amplifier, or a switch. In the digital world, a transistor is primarily considered to be a switch. The structure of a transistor between the collector and emitter terminals is similar to that of two diodes connected back-to-back.
Two diodes connected in this way would typically not conduct; however, when signals are applied to the base terminal, the transistor can be turned ON or OFF. If the transistor is turned ON, it acts like a CLOSED switch and allows current to flow between the collector and the emitter.
If the transistor is turned OFF, it acts like an OPEN switch and no current flows.
We may consider the collector and emitter as data terminals, and the base as the control terminal.