A transistor is made by joining one Positive Typed semiconductor in between two Negative Typed semiconductors, or one Negative Typed semiconductor in between two Positive Typed semiconductors. The first is called an NPN Transistor . The second is called a PNP Transistor . All transistors have three terminals, called (B)ase , (E)mitter, and (C)ollector . Therefore a transistor can be connected as a two port network. The Input port is at the B-E junction. The Output port is at the C-E junction. Hence, the transistor is called a Bipolar junction Device
Just like a diode, a Transistor needs to be biased to conduct or non-conduct current to turn a transistor on or turn it off. This makes a transistor act like a Switch . Just like a diode, a Transistor allows current to flow in one direction when the Transistor conducts current. An NPN transistor passes a positive half cycle of the signal. A PNP transistor passes a negative half cycle of the signal.
When a transistor conducts current, it will act as a voltage Amplifier, either Inverting or Non-Inverting, depending on the way resistors are connected to the transistor.