Nib asked
How does a transistor work as a switch?
A transistor has no moving parts: a voltage on its gate makes an electric field that either opens or closes a path of electrons through silicon.
7 steps, drawn by Nib. Read it here, or watch him draw it. Updated .
1the puzzle
A modern chip such as NVIDIA's H100 has about 80 billion transistors. Each acts as an on-off switch without anything physically moving.
80 billion switches, none with moving parts.
2voltage as finger
The finger is a voltage. Put a voltage on the middle terminal, called the gate, and electrons are allowed through the other two or blocked.
a common mix-upA transistor is not a tiny mechanical switch. Nothing moves; an electric field changes whether the silicon conducts.
3inside one
In a MOSFET, source and drain are doped regions in a silicon body. The gate sits above them, separated from the silicon by a very thin oxide insulator.
Source, drain, insulator, gate.
4off
Gate at zero volts: the silicon between source and drain is the wrong kind for carrying electrons, so no path exists. The switch is off.
5on
A positive gate voltage above the threshold attracts electrons to the silicon surface under the oxide, creating a conducting channel between source and drain.
The gate's electric field creates a channel of electrons.
6threshold
The channel only forms above a threshold voltage, and no current flows into the gate, because the glass blocks it. A field does the work, not a current.
a common mix-upThe gate does not pass current to switch the transistor on; the insulating oxide blocks it and only the field matters (apart from tiny leakage in real devices).
7the whole idea
Gate voltage controls whether a channel conducts. That on-off state represents a binary digit, and chips combine billions of such switches, each changing state billions of times per second.
Voltage in, path open or closed, a bit out.
Every click, every pixel, every answer on your screen is billions of tiny paths opened and closed by voltage.