← Laboratorium

Computerfrom transistor to processor — build one out of switches

Every computer is billions of tiny switches that can do only one thing: let current through or stop it. Climb the ladder: turn silicon into a transistor, transistors into gates, gates into an adder and memory — and finally start your own processor and write a program for it.

  1. 1silicon
  2. 2gates
  3. 3adder
  4. 4memory
  5. 5processor
  6. 6Internet

Silicon crystal

The p-n junction — a diode

0.62 V

Current
—
Depletion layer
—
State
—

Model of an ideal silicon diode (Shockley equation, Is = 10⁻¹⁴ A, room temperature). A real diode also has resistance and a small leakage current in reverse bias.

The MOSFET as a switch

0.00 V

Threshold UP
0.70 V
Drain current
0.0 mA
Channel
none
Switch
open

Simplified model: below the threshold the current is ≈ 0, above it I ≈ ½·k·(UG − UP)², limited by a resistor to 20 mA. In a processor the transistor works as a switch: either “open” or “closed”.

Moore’s law

tap a point · ←/→

From vacuum tubes to billions of transistors

  • The vacuum tube (Fleming’s vacuum diode), and in 1906 the triode — the first electronic “switches.” Hot, big, and unreliable.
  • ENIAC: about 18,000 tubes, about 27 tons. Some tube was always burning out.
  • John Bardeen and Walter Brattain at Bell Labs build the point-contact transistor; William Shockley soon develops the junction transistor. All three share the Nobel Prize in Physics in 1956.
  • Jack Kilby (Texas Instruments) — the first integrated circuit (made of germanium); in 1959 Robert Noyce (Fairchild) — the planar silicon chip, ancestor of today’s chips.
  • Intel 4004 — the first single-chip microprocessor: about 2,300 transistors.
  • The largest processors and graphics cards have tens or even hundreds of billions of transistors.

A Polish connection: Jan Czochralski. In 1916 he discovered a method of pulling a crystal out of molten metal. Today almost all single-crystal silicon for electronics is grown this way — cylinders up to 30 cm across, sliced into the wafers that become processors.

How it works

Semiconductors and doping

Silicon has 4 valence electrons, and each atom shares them with four neighbors. Pure silicon conducts poorly. Doping with phosphorus (5 electrons) gives free electrons — n-type; doping with boron (3 electrons) gives “holes” — p-type. Where p meets n, a junction forms that lets current through in one direction only.

I = Is·(eU/UT − 1)UT ≈ 26 mV at room temperature

Transistor = a voltage-controlled switch

ID ≈ ½·k·(UG − UP)² for UG > UPsimplified model; below the threshold ID ≈ 0

Binary

N = b7·2⁷ + b6·2⁶ + … + b1·2 + b0e.g. 1101₂ = 8 + 4 + 1 = 13

Adder

S = A ⊕ B ⊕ Cin, Cout = A·B + Cin·(A ⊕ B)⊕ — XOR, · — AND, + — OR
A − B = A + B + 1 (mod 2⁸)two’s complement

Clock

T = 1/f, d = c·T = c/fat 3 GHz: T ≈ 0.33 ns, d ≈ 10 cm

Moore’s law

N(t) ≈ N0·2(t − t0)/2 yearsan observation, not a law of nature; progress is slowing down today

All the models on this page are simplified: gates switch in a single step, the processor has 16 bytes of memory, and the transistor is described by a simple formula. But the ideas are exactly the same as in real hardware.

Challenges

  1. Light the LED with a transistorIn “Silicon” mode, raise the gate voltage until at least 5 mA flows through the LED.not completed
  2. Build XOR from NAND gatesIn the sandbox, use only NAND gates, two switches, and an LED.not completed
  3. Add 5 + 7 on the adderSet A = 5 and B = 7 with the bits of the 8-bit adder and wait until the carry reaches the end.not completed
  4. Store 1 bit in a flip-flopSet Q = 1, then switch off both inputs S and R — the bit must stay.not completed
  5. Run the count-to-10 programThe mini processor must display 1, 2, …, 10 and stop.not completed
  6. Write a program that multiplies 3 × 4Modify the multiplication example so that the processor displays 12 by adding in a loop.not completed

Did you know…?

  • A large graphics card today has about 80–200 billion transistors — about 10–25 times more than there are people on Earth (about 8 billion).
  • In September 1947, operators of the Harvard Mark II computer found a moth inside it and taped it into their logbook with a note about the “first actual case of bug being found.” The word “bug” for a fault was known even earlier, though — it is more of an amusing anecdote than the birth of the term.
  • Marian Rejewski broke Enigma as early as 1932 — seven years before the war broke out — with mathematics rather than spy tricks: he solved a system of equations on permutations.

Keys

Q W E R T Y
switch modes
← →
on the tabs: neighboring mode; on the Moore chart: neighboring processor
1…8
“Bits” mode: flip the bits of the byte
Space P
“CPU” mode: one step / start and pause the processor
Delete + −
sandbox: delete selected, zoom in, zoom out
Esc
stops the processor, the clock, and counting; cancels drawing a wire