How Does a Transistor Work? The Switch That Built the Modern World
By the BrainSnail editorial team. How these articles are written and checked, and how to tell us when one is wrong.
A modern phone contains about fifteen billion transistors, each one a switch that turns a current on or off when told to, and each one smaller than a virus. Everything the phone does, every pixel, every calculation, every message, is the result of those switches being flipped in patterns, billions of times a second. The device was invented at Bell Labs in December 1947, on a bench, from a slab of germanium, two strips of gold foil and a paper clip, and it is the most manufactured object in human history.
What came before
The first electronic switch and amplifier was the vacuum tube, a glass bulb in which a heated filament boiled electrons off a cathode and a small voltage on a metal grid controlled whether they reached the anode. Tubes worked, and radio, television, radar and the first computers were built from them, but they were the size of a light bulb, ran hot, burned out like light bulbs, and needed a warm-up. ENIAC, the first general-purpose electronic computer, used 17,000 of them and failed about every two days. A machine of a billion tubes was not a possibility, and the search for a solid device that did the same job began in the 1930s.
Semiconductors
The answer was in a class of materials that neither conduct like copper nor insulate like glass. Silicon, the second most common element in the Earth's crust, has four outer electrons that it shares with four neighbours in a rigid crystal, leaving none free to carry current; pure silicon is nearly an insulator. Add a trace of phosphorus, which has five outer electrons, and the fifth is left over and free to move, making an n-type semiconductor with spare electrons. Add boron instead, with three, and there is a missing electron, a hole, which behaves like a mobile positive charge, making p-type. The trick of the transistor is putting the two types side by side. Where n meets p, the spare electrons and holes near the junction cancel, leaving a thin layer with no carriers that current cannot cross in one direction and can in the other, which is a diode, and two junctions back to back can be controlled.
The switch
The transistor in nearly every chip today is the MOSFET, the metal-oxide-semiconductor field-effect transistor, and it works like a tap:
- •Two pockets of n-type silicon, the source and the drain, sit a short distance apart in a p-type base
- •Between them, on top of a very thin layer of insulating oxide, lies a metal or polysilicon gate
- •With no voltage on the gate, the p-type silicon between source and drain has no free electrons, and no current flows: the switch is off
- •A positive voltage on the gate attracts electrons up to the surface of the p-type silicon, forming a thin n-type channel that joins source to drain, and current flows: the switch is on
- •The gate draws almost no current itself, since it is insulated, so a tiny signal controls a larger one, which is amplification, and a switch that controls other switches is logic
From switch to computer
Two transistors in series make an AND gate, which passes current only if both are on; two in parallel make an OR; and one arranged to invert makes a NOT. From those three gates every logical operation and every arithmetic one can be built, and a processor is a few billion of them wired so that the pattern of ons and offs represents numbers and instructions. Memory is transistors too: a bit of RAM is a transistor and a capacitor holding or not holding a charge, and flash memory traps electrons on an insulated gate so that they stay when the power is off. The invention that turned the transistor into the computer was the integrated circuit of 1958, which made many transistors on one slice of silicon at once instead of wiring them individually, and the whole of the industry since has been about making that slice hold more.
Smaller every year
In 1965 Gordon Moore noticed that the number of transistors on a chip was doubling every year, a pace he revised in 1975 to every two years, and it went on doing so for half a century, from a few dozen to tens of billions, by shrinking each transistor. The first commercial ones were the size of a pea; a modern gate is a few nanometres across, a few dozen silicon atoms, and is made by projecting patterns of ultraviolet light onto the wafer through masks in machines that cost several hundred million dollars each and are built by one company in the Netherlands. At that scale electrons leak through barriers by quantum tunnelling and heat is the limiting problem, and the doubling has slowed. Whether the next decades come from stacking transistors in three dimensions, from new materials, or from a different kind of computer altogether is the open question of the industry. What is not in question is that the three men who built the first one, John Bardeen, Walter Brattain and William Shockley, shared the Nobel Prize in 1956 for the device that has since been made in greater numbers than there are grains of sand on Earth.
Adding one and one with switches
To see how switches become arithmetic, consider adding two single binary digits, each either 0 or 1. There are four cases: 0 plus 0 is 0, 0 plus 1 and 1 plus 0 are both 1, and 1 plus 1 is 2, which in binary is written 10, a 0 with a 1 carried into the next column. So the answer needs two outputs, a sum digit and a carry digit. The carry is 1 only when both inputs are 1, which is exactly an AND gate. The sum is 1 when one input or the other is 1 but not both, a combination called exclusive or.
An exclusive or can itself be built from the AND, OR and NOT gates described above, and the two gates together are called a half adder. Chain a slightly larger version, a full adder that also accepts a carry coming in from the column to its right, and you can add numbers of any length column by column, exactly as you learned to add on paper. Each gate is a handful of transistors, so adding two 64-bit numbers takes a few thousand of them, all switching within a single tick of the processor's clock, less than a billionth of a second.
Why silicon replaced germanium
The first transistors were made of germanium, which was easier to purify in the 1940s, yet almost every chip today is silicon. One reason is heat. Silicon holds its electrons more tightly, so it takes more energy to shake them loose, and a silicon device keeps behaving as a switch at temperatures where germanium starts to conduct by itself and can no longer be turned fully off. Military and aerospace buyers in the 1950s wanted parts that would work in hot equipment, and Texas Instruments began selling silicon transistors in 1954 partly to meet that demand.
The deeper reason is the oxide. Heat silicon in oxygen or steam and it grows a skin of silicon dioxide, a hard, stable glass that is an excellent insulator and bonds tightly to the crystal beneath. Germanium's oxide is unstable and even dissolves in water. That glassy skin made two things possible. It could protect the junctions and be etched into patterns, which led to the flat planar process developed at Fairchild Semiconductor in 1959, and it could serve as the thin insulating layer under the gate of the MOSFET. Without a good oxide of its own, the modern chip would be very hard to make.
The radio that went everywhere
The first product to bring transistors into ordinary homes was the pocket radio. The Regency TR-1, released in the United States in 1954, used four transistors in place of the bulky, power-hungry valves of earlier radios, and it was small enough to carry. Within a few years Japanese companies, including the firm that became Sony, were selling transistor radios in large numbers around the world.
Cheap portable radios changed listening habits, especially among young people, who could take music to the beach or their bedroom rather than gathering around the family set. They spread news and music to places without mains electricity too, because a transistor radio could run for weeks on small batteries. For many people, the word transistor simply meant a portable radio.
The takeaway
A transistor is a switch in a crystal of silicon: a voltage on an insulated gate creates or removes a conducting channel between two contacts, turning a current on or off with no moving parts and almost no control current, which lets it amplify a signal or serve as a logic gate. Invented in 1947 and printed by the billion onto chips since 1958, it has shrunk to a few nanometres, and every computer, phone and screen is built from patterns of them switching.