A computer consists of electronics, electronic chips that store data in memory, compute mathematical and logical operations. This requires flow of current across circuit, holding of voltage at a junction in a circuit at a fixed value, changing the voltage at a point in a circuit etc. It also requires controlling the computations, by selection of desired mathematical operation etc.
All these operations and functions happen with digital numbers 0 and 1. These are stored as voltage levels in the electronic circuits. The electronic devices that hold/store 1 and 0 are called registers. These registers are made of logic gates called AND, OR, NAND, NOR, and inverter. All these logic gates are made of a few transistor devices and other circuit elements.
In order to change data value in a register or to retrieve data, we need control logic. This requires a switch which either enabled (short circuit) or disabled (open circuit). This function is performed by the logic gates that consist of transistor devices.
Basically, all the electronic components inside the computer are made of transistors at the atomic level or, at micrometer to 100 nano-meters or even less.
A transistor is an electronic device. It is made of semiconductor materials like
Silicon, Germanium etc. It consists of two semiconductor junction diodes called p-n and n-p. These are called bi-polar junction transistors, as the action happens at the junction of the p-n and n-p diodes of different polarities.
A transistor is an active device as compared to a resistor, inductor, capacitor devices which are electrical circuit elements. It consists of 3 terminals called base, emitter, and collector.
A transistor is an amplifier device which amplifies the current supplied to it through its base, by about 50 time or more at the collector. This function of amplification is used in signal amplifiers, sound speakers etc. The current at the input is a fraction of milli-amperes and the current at the output is in milli amperes.
The transistor operators with its input and output voltages between 0 V and 5 Vs.
A transistor conducts electric current signal if the input voltage is more than a threshold value like 2.5 V. Below that it acts as an open circuit. Thus it is used as a switch in electronic circuits. It is used in control circuits to control flow of current through other circuits.