Transistors & Switches
Transistors to Processors · Hardware Foundations track
4 min read
In this module
The Building Block of Every Computer
Deep inside every processor, every memory chip, every digital device: a single component, repeated billions of times. The transistor. An electrically controlled switch. Apply a voltage to one terminal and current flows between the other two. Remove it and the current stops. That binary on/off behaviour is, quite literally, the entire foundation of computing.
Understanding transistors isn't academic indulgence. Once you see how these switches work, everything built on top — logic gates, arithmetic circuits, full processors — follows as a logical chain.
MOSFET: The Modern Transistor
The transistor type used in virtually every modern processor is the MOSFET (Metal-Oxide-Semiconductor Field-Effect Transistor). A MOSFET has three terminals:
- Gate - the control terminal. A voltage applied here determines whether the switch is on or off.
- Source - where charge carriers (electrons or holes) originate and enter the channel.
- Drain - where charge carriers exit the channel when the switch is on.
A thin insulating oxide layer sits between the gate and the semiconductor channel beneath it. Apply voltage to the gate and the electric field punches through the oxide, creating a conducting channel between source and drain. No current flows through the gate itself — which means MOSFETs burn almost no power just to hold a state.
A MOSFET is an electrically controlled switch with three terminals: gate, source, and drain. Applying voltage to the gate opens or closes the channel between source and drain, allowing or blocking current flow. This is the fundamental building block of all modern digital circuits.
NMOS and PMOS
MOSFETs come in two complementary flavours:
- NMOS (N-channel MOSFET) - conducts when the gate voltage is high. Think of it as a switch that turns on when you apply a
1. - PMOS (P-channel MOSFET) - conducts when the gate voltage is low. It turns on when you apply a
0.
These two types behave as mirror images of each other, and that symmetry turns out to be extraordinarily useful.
CMOS: Why It Dominates
Modern chips use CMOS (Complementary Metal-Oxide-Semiconductor) technology, which pairs NMOS and PMOS transistors together. In a CMOS circuit, every logic operation is built from a pull-up network of PMOS transistors and a pull-down network of NMOS transistors. At any given time, only one network is active, which means there is essentially no static power consumption - current flows only during the brief moment a transistor switches state.
This is why CMOS replaced everything that came before it. Older NMOS-only designs drew constant current, generating heat that capped transistor density. CMOS removed that ceiling and the industry never looked back — four decades of density growth followed.
The smallest CMOS circuit is the inverter: one PMOS above the output, one NMOS below it. Park the input at 0 V and then at VDD and check that one transistor is always off, so there's no route from supply to ground. Then drag slowly through the middle, where the shaded band marks the stretch in which both conduct and current runs straight through. The NAND view shows the same pull-up and pull-down split with two inputs.
CMOS inverter
A PMOS connects the output to VDD, an NMOS connects it to ground, and both gates share the input. Drag the input voltage.
Thresholds (illustrative): Vtn = 0.30 V, |Vtp| = 0.30 V
- NMOS off (Vgs = 0.00 V ≤ Vtn 0.30 V)
- PMOS on (Vsg = VDD − Vin = 1.00 V > |Vtp| 0.30 V)
- Vout ≈ 1.00 V (logic 1)
The PMOS ties the output to VDD and the NMOS is off, so nothing connects VDD to ground. Static current is only leakage.
Vout comes from an illustrative long-channel square-law model with matched transistors. Real chips differ in the details but keep the same shape.
CMOS pairs NMOS and PMOS transistors so that at any moment only one type conducts. This eliminates static power draw, allowing billions of transistors to coexist on a single chip without melting it.
Moore's Law and Transistor Scaling
In 1965, Gordon Moore observed that the number of transistors on a chip was doubling roughly every year - a pace he later revised to every two years in 1975. This observation, known as Moore's Law, held remarkably true for decades:
- 1971 - Intel 4004: approximately 2,300 transistors
- 1989 - Intel 486: approximately 1.2 million transistors
- 2006 - Intel Core 2: approximately 291 million transistors
- 2020s - Apple M-series and AMD EPYC: tens of billions of transistors
Each generation shrinks transistors further. Modern chips use manufacturing processes measured in just a few nanometres - thousands of times smaller than a human hair. At these scales, quantum effects begin to matter, and engineers employ increasingly creative techniques like FinFET (fin-shaped) and gate-all-around transistor designs to maintain control over the switching channel.
From Switches to Logic
A single transistor can hold a bit: on or off, one or zero. The interesting thing happens when you wire transistors together. Small combinations of NMOS and PMOS transistors implement Boolean operations — AND, OR, NOT — and from those you build adders, multiplexers, registers, caches, and eventually full processors.
A NOT gate takes just two transistors. Input high: the NMOS conducts, output is pulled low. Input low: the PMOS conducts, output goes high. Every layer of abstraction in computing is built on arrangements like that, starting here.