raycat
An interactive explainer·electronicsРусский

How a transistor works

How a sliver of silicon with no moving parts switches current on and off billions of times a second, and why switches like that are enough to build a computer. Every figure is live: turn the voltage dials, flip the inputs and watch the electrons run.

A ginger cat looks at a giant cutaway transistor. A glowing amber channel under the gate carries electrons from source to drain.
Illustration generated with the Nano Banana Pro model (Gemini 3 Pro Image). It is an artistic impression; the figures below show how a transistor really works.
10 µm

Inside a transistor

A transistor is a switch for electric current with no moving parts. A voltage on its third terminal turns it on and off. This is a field-effect transistor, or MOSFET: transistors were built like this from the 1960s to the early 2010s, and every transistor in your phone still works on the same principle. You can turn the model, cut it open and take it apart.

ModelA silicon substrate, two doped islands called the source and the drain, a thin insulator and the gate on top. The proportions are exaggerated: the real insulator under the gate is only a few atoms thick. Switch the type to see how transistors are built today.

Turn the gate dial. Once the voltage passes the threshold, electrons gather under the gate and connect the source to the drain. Add a voltage on the drain and current runs across this bridge. Take the voltage off the gate and the bridge disappears. That is all a transistor does: the voltage on one terminal opens or closes the path for current between the other two. Next, let’s see why silicon can do this.

The gistA transistor is a tap for electrons. The gate does not touch the channel: it controls the current with its electric field alone, so it uses almost no energy itself.
3 µm

Why silicon

Electric current is moving charge, usually electrons. In a metal every atom contributes a free electron that wanders through the whole piece, which is why copper conducts so well. In an insulator such as glass, every electron is tightly bound to its atom, and no current flows.

Silicon sits in between. Each of its atoms has four outer electrons and shares each of them with a neighbour, forming a strong crystal lattice in which every electron is tied up in a bond. To break free, an electron needs 1.12 electronvolts of energy; this is called the band gap. Heat sometimes supplies it, but rarely: at room temperature only about one electron in five trillion atoms is free.

Where an electron has escaped, it leaves an empty spot behind, a hole. An electron from a neighbouring bond hops into it, and the hole moves. It behaves like a positive charge, so in silicon both electrons and holes carry current.

Fig. 1Copper, glass and silicon under the same voltage. Heat them up: silicon starts to conduct much better, and copper slightly worse. The figure shows billions of times more free charges in silicon than there really are, or you would not see any.

Pure silicon conducts poorly, and how well depends strongly on temperature. To make a transistor out of it, we need to control the number of free charges. That is what dopants are for.

1 µm

Doping: n and p

Replace one silicon atom with a phosphorus atom. Phosphorus has five outer electrons: four go into bonds with the neighbours, and the fifth is left over. It is nearly free, and heat is enough to shake it loose. Silicon like this is called n-type, for negative: the current is carried by negative electrons. The phosphorus atom that gave up its electron becomes a fixed positive ion.

A boron atom, on the other hand, has only three outer electrons, so one bond is an electron short: a hole appears in the lattice. This is p-type, for positive: the current is carried by positive holes, and boron becomes a negative ion.

It takes very little. One phosphorus atom per million silicon atoms raises the number of free charges a million-fold. Adding impurities like this is called doping. In the most heavily doped parts of a transistor there are only a few hundred silicon atoms per dopant atom.

Fig. 2A silicon lattice, flattened into a plane. Pick a dopant and switch on the voltage: electrons run toward plus, holes toward minus. The figure also shows far more dopant atoms than a real crystal has.
350 nm

The p–n junction

The interesting part happens where n-type and p-type silicon meet. Electrons from the n side cross over and fill holes on the p side. Near the boundary no free charges are left, only the fixed dopant ions: positive on the n side and negative on the p side. This strip is called the depletion layer. Its ions create an electric field that stops any further crossing. The voltage across the boundary is about 0.7 volts.

Now apply a voltage with plus on the p side. The outside field weakens the built-in one, the depletion layer narrows, and charges flow across the boundary. The current grows very fast: ten times for every 60 millivolts. Reverse the voltage and the depletion layer widens, while the current all but disappears. This is a diode: it lets current through in one direction only.

Fig. 3Circles with plus and minus are the fixed dopant ions, dots are free electrons, rings are holes. On the right: the current through the diode versus the voltage.
130 nm

The gate opens a channel

A field-effect transistor is two p–n junctions facing each other. The source and the drain are heavily doped n-type islands in a p-type substrate. Between them lies p-type silicon, and whatever voltage you apply between source and drain, one of the two junctions is blocking. No current flows: the transistor is off.

Above the gap sits the gate, separated from the silicon by a very thin insulator. Put a positive voltage on the gate. Its field pushes the holes down and pulls electrons up to the surface. Once the voltage passes the threshold, 0.35 volts in our model, there are more electrons than holes at the surface, and a thin layer of p-type silicon turns into n-type. This layer is the channel, a bridge of electrons between source and drain. The transistor is on.

There are surprisingly few electrons in the channel. Under a gate of 20 by 50 nanometres there are only about a hundred. In modern transistors, where the gate wraps the channel on several sides, there are a few hundred. And because the gate is insulated, almost no current flows into it: keeping the transistor on takes no energy. Energy is spent only to charge the gate once, like a tiny capacitor.

Fig. 4A cross-section of a field-effect transistor. Raise the gate voltage above the threshold and a channel appears between source and drain. Put a voltage on the drain and current flows along the channel. Near the drain the channel is thinner, and the electrons there move faster.
65 nm

How much current

The current through an open transistor depends on both voltages. While the drain voltage is small, the channel is nearly uniform and the transistor behaves like a resistor: the current is proportional to the voltage. The higher the gate voltage, the more electrons in the channel and the lower the resistance.

Raise the drain voltage further and the channel thins out near the drain: there the gate is working against a higher voltage. When the drain voltage reaches the difference between the gate voltage and the threshold, the channel pinches off at the drain and the current almost stops growing. This is saturation. In saturation the transistor holds the current set by the gate, and that is how amplifiers work.

Below the threshold the current does not vanish completely; it falls about tenfold for every 60–80 millivolts. This subthreshold current is the main reason a chip warms up even when it is doing nothing: billions of transistors that are off still leak a little.

Fig. 5Left: the current versus the drain voltage for several gate voltages. Right: the current versus the gate voltage, on a log scale. Drag the operating point along the graphs.
22 nm

Zero and one

A computer does not need a smoothly varying current but two states: zero and one, a low voltage and a high one. A transistor is perfect for this. But if you pair one transistor with a resistor, current flows through them the whole time the transistor is on, heating the chip.

The solution, found in 1963, is called CMOS, complementary logic. Next to the n-type transistor you place its mirror twin, a p-type transistor: its source and drain are p-type, its channel is made of holes, and it turns on not with a plus on the gate but with a zero. Put the p-type transistor on top, to the supply, and the n-type one at the bottom, to ground, and tie their gates together. A one at the input opens the lower transistor, and the output is zero. A zero opens the upper one, and the output is one. This is an inverter, the logical NOT. In either steady state one of the transistors is off, so no current flows from supply to ground.

Energy is spent only at the moment of switching, to recharge the gates of the next transistors: about a femtojoule each time. That is very little, but there are billions of transistors, switching billions of times a second. That adds up to the tens of watts a processor dissipates.

Fig. 6A CMOS inverter made of two transistors. Change the input voltage: on the right you can see the output flip from one to zero, and when current passes through the inverter. The Switch button shows a switching event in slow motion.
7 nm

Logic

Now connect four transistors differently: two n-type transistors in series between the output and ground, and two p-type transistors in parallel between the output and the supply. The output becomes zero only if both lower transistors are open, that is, when both inputs are one. This is a NAND gate. Swap the series and parallel connections and you get NOR.

Any logic function can be built from NAND gates. Tie both inputs together and you get NOT. NAND followed by NOT is AND. Three NAND gates make OR. So switches of a single kind, wired the right way, give you all the logic of a computer.

Fig. 7A gate made of four transistors. Click inputs A and B. The open transistors light up, together with the path that connects the output to the supply or to ground.
3 nm

Smaller and smaller

The smaller a transistor, the faster it switches, the less energy each switch takes, and the more transistors fit on a chip. In 1965 Gordon Moore noticed that the number of transistors on a chip was doubling every year; in 1975 he revised the forecast to every two years. This Moore’s law held for half a century: from 2,300 transistors in the Intel 4004 in 1971 to 92 billion in Apple’s M3 Max in 2023. NVIDIA’s Rubin accelerator of 2026 has 336 billion, though spread over two dies.

The chapter numbers in this article are names of manufacturing processes, from 10 micrometres in 1971 to 2 nanometres in 2025. But the names parted ways with real sizes long ago: in the “3 nm” process the gate is about 16–18 nanometres long, and neighbouring gates are 45–50 nanometres apart. Fewer than a hundred silicon atoms fit along the gate.

When gates became very short, they could no longer hold the channel: current started to leak underneath even with the transistor off. The way out was to grip the channel from more sides. In 2011 Intel stood the channel on its edge: the result is the FinFET, a thin silicon fin that the gate wraps on three sides. Since 2022, transistors with the gate all around the channel, GAA, have been in production: the channel is a stack of thin silicon sheets, and the gate surrounds each one.

Fig. 8Transistors per processor by year (log scale) and the shape of the transistor in different years. Move the year. Go back to the 3D model at the top and switch the transistor type to look at FinFET and GAA up close.
2 nm

All together

Let’s build from gates what all of this was for: addition. A full adder adds two bits plus the carry bit from the position below. It can be made from nine NAND gates, that is, 36 transistors. Four such adders in a chain add numbers from 0 to 15.

Click the bits of the numbers and watch the carry ripple along the chain: each gate switches with a small delay, so the result settles in front of you. The adders in a processor are 64 bits wide and cleverer, so that the carry does not have to wait. But underneath they are the same switches, opened by the voltage on a gate. A smartphone has about twenty billion of them.

Fig. 9A four-bit adder made of 144 transistors. Flip the bits of numbers A and B. Below: one bit up close, nine NAND gates and the value on every wire.