The purpose of a transistor depends on whether its function is analog or digital. In an analog application, transistors are amplifiers. A small current coming into the transistor is changed to a larger current going out. In a digital application, a transistor is an on/off switch. See
transistor and
transistor density.