Computer

A machine with its program in memory

Date
1948
Era
Modern age
Rebuild stage
V Electric age
Difficulty

Plate

Legend
  1. 1Racks of vacuum tubes
  2. 2Cathode-ray memory tube: one dot per bit
  3. 3Switch panel for keying in data
  4. 4Teleprinter and punched paper tape
  5. 5Relay: a switch moved by an electromagnet
  6. 6Vacuum tube: its grid switches the current
  7. 7Transistor: the solid-state switch

Anatomy

BA5 plus 3 makes 8; in binary 0101 plus 0011 makes 1000; carries: c1 c2 c3
Wires at 5 V (logic 1) and the LEDs they lightGate blocks: XOR, AND and OR, five to a columnJumper wires at 0 V (logic 0)Toggle switches: A on the back row, B in front, the bit worth 8 on the leftTwo four-bit numbers are keyed in on the toggles, A on the back row and B on the front one, with the bit worth 8 on the left and the bit worth 1 on the right, as on paper. Each column below is a full adder of five gates. An XOR and an AND compare the column's two bits; a second XOR adds the carry coming in from the right and gives the sum bit; a second AND and an OR make the carry for the next column. The rightmost column takes its carry from the 0 V rail, and the leftmost one sends its carry to the fifth LED. On the plate's breadboard these 20 gates come four to a chip, in two 74HC86, two 74HC08 and one 74HC32. The figure draws each gate as its own block so the wiring can be followed, and leaves out the chips' power leads and the 10 kΩ resistors that hold each input at 0 V while its switch is down. At 5 V a typical XOR answers in 11 ns, an AND in 7 ns and an OR in 6 ns, so each column adds 13 ns to the carry's trip, and in this model the slowest change of inputs settles after 52 ns; real wiring, supply and temperature shift these values. The figure plays each nanosecond as 40 ms, so the carry can be seen moving from column to column. On the way a sum LED may flash and go out again before it settles, and the readout, which reads the LEDs, passes through wrong sums. Real adders do this too: in a computer, the result is taken in on a clock edge timed to come after it has settled.

A computer is a programmable calculating machine; the modern kind keeps its program in its own memory and works in binary, with switches that are either on or off. The first to run a program from electronic memory was the Manchester “Baby”, on 21 June 1948, and phones and laptops still follow its plan.

What it is

A computer carries out a program, a list of instructions, on data. In the stored-program design described here, the program sits in the same memory as the numbers it works on, so the machine can load a new one, change it, or write another, without being rebuilt. That idea sets the stored-program computer apart from earlier programmable machines, which took their instructions from tape, cards, plugs or switches.

Today’s computers work in binary, with the digits 0 and 1, because two states are easy to make reliable: a switch is open or closed. ENIAC and some other early machines still counted in decimal. For a society rebuilding its tools, it calculates, controls machines such as pumps and power networks, and carries messages.

How it works

Binary numbers. Binary is positional like our decimal numerals, but each place is worth twice the one to its right: 1, 2, 4, 8, 16. Thirteen is 8 + 4 + 1, written 1101. Eight binary digits, or bits, cover the whole numbers from 0 to 255.

Two battery circuits with a bulb: two push-buttons in series on the left, two in parallel on the right Buttons in series light the bulb only if both are pressed; in parallel, either one is enough.

Gates. Two switches in series light a lamp only when both are closed: an AND gate. Two in parallel light it when either is closed: an OR gate. A relay whose contact opens when its coil is powered makes a NOT gate, turning 1 into 0. A relay is worked by an electromagnet, a vacuum tube by the voltage on its grid, a transistor by the signal on its base or gate. AND, OR and NOT together can express any rule from input bits to output bits.

Adding with gates. In binary, 1 + 1 makes 10: sum 0, carry 1. The sum bit is 1 when exactly one input is 1, a rule called exclusive OR (XOR); the carry is 1 only when both are, which is AND. Together they form a half adder. A full adder also takes the carry from the column to its right, and eight in a chain add two 8-bit numbers, column by column, as a pupil does on paper.

Memory. Two NOR gates (OR followed by NOT), each output feeding one input of the other, form a latch: a pulse on one free input sets it to 1, a pulse on the other resets it to 0, and it holds that bit while the power stays on. Manchester stored bits as charged dots on a cathode-ray tube, EDSAC as sound pulses in tubes of mercury. Each word, a group of bits, has a number, its address.

The cycle. A register called the program counter holds the address of the next instruction. The processor fetches that instruction, decodes it, executes it, and starts again. An instruction may add a number from memory to the accumulator, store a result, or jump elsewhere if a value is negative; that conditional jump lets a program loop and choose. Keyboards and sensors bring data in; screens, printers and motors take results out.

How to build

A modern processor needs a chip factory, but its logic can be learnt on a table.

A breadboard with two slide switches, each lighting an LED through a resistor, fed by a battery holder Test each switch and LED on its own first; an LED always needs a resistor in series.

Gather the parts. A solderless breadboard, two or three AA cells in a holder (3 to 4.5 V) or a 5 V USB supply, two double-pole changeover switches, two LEDs, two resistors of 330 to 470 ohms, and wire. Each LED goes in with its long leg (anode) towards the switch and its short leg (cathode) to 0 V. Write the truth table first: for inputs A B = 00, 01, 10, 11, the sum is 0, 1, 1, 0 and the carry 0, 0, 0, 1.

Wire the carry. Take the supply to the common of the first pole of A, its “on” contact to the common of the first pole of B, and that “on” contact through a resistor to an LED, whose other leg returns to 0 V. It lights only for 11: that is AND.

Wire the sum. On the second poles, join the “on” contact of A to the “off” contact of B, and the “off” contact of A to the “on” contact of B. Feed the common of A from the supply and take the common of B through a resistor to the second LED, cathode to 0 V. It lights when the switches differ: XOR. Check the four cases against the table.

Chain a bigger adder. A full adder is two half adders plus an OR gate merging their carries. From here, logic chips are easier: a 4-bit adder takes two 74HC86 (XOR), two 74HC08 (AND) and one 74HC32 (OR). Power them as the datasheet shows (pin 14 to plus, pin 7 to 0 V, a 100 nF capacitor across the two). Each carry out feeds the next carry in and the first carry in goes to 0 V; each switch input gets a 10-kilohm resistor to 0 V, and each output LED a 1-kilohm resistor.

Run a computer on paper. Draw eight numbered memory boxes, an accumulator and a program counter set to 0. Write LOAD 5 in box 0, ADD 6 in box 1, STORE 7 in box 2, STOP in box 3, then 3 in box 5 and 4 in box 6. Play the processor: read the box the counter points to, do it, add one to the counter. Box 7 ends up holding 7. Now code each instruction as two digits, the operation then the address, with LOAD 1, ADD 2, STORE 3 and STOP 0: the program becomes 15, 26, 37, 00, numbers among the data.

Safety. Batteries or a 5 V USB supply only, never mains. Every LED needs its resistor. A shorted battery or power bank can heat its wires enough to burn. Disconnect the supply before rewiring. A chip output cannot power a relay coil: drive the coil through a transistor rated for its current, with a diode across it, striped end (cathode) towards the positive supply, to absorb the spike at switch-off.

History and evolution

Simplified sketch of the brass demonstration piece of Babbage’s Difference Engine: columns of wheels between pillars A simplified sketch of the part of his first Difference Engine, one seventh of it, that Babbage had assembled in 1832; it still works.

Charles Babbage’s Analytical Engine, conceived in 1834, had a store, a mill for arithmetic and a program on punched cards; it was never built. Ada Lovelace published a sequence of operations for it in 1843. Herman Hollerith’s electric card tabulators counted the US census of 1890.

In 1936 Alan Turing described a universal machine that reads its instructions from the same tape as its data. Konrad Zuse showed his relay-built Z3 in Berlin on 12 May 1941. From February 1944, Tommy Flowers’s electronic Colossus helped break the German Lorenz cipher at Bletchley Park; it stayed secret until the 1970s. ENIAC, by J. Presper Eckert and John Mauchly in Philadelphia, announced in 1946, was general-purpose but programmed by moving cables. Each has a claim to be first, depending on whether one asks for electronics, generality or a stored program.

John von Neumann’s 1945 report on the EDVAC, drawn from work with Eckert, Mauchly and others, described a machine keeping program and data in one memory. The first to run was the Manchester “Baby” of Frederic Williams, Tom Kilburn and Geoff Tootill, on 21 June 1948. Maurice Wilkes’s EDSAC at Cambridge followed on 6 May 1949 and soon served users.

Manchester ran a transistor computer in November 1953. Integrated circuits, first made in 1958, entered computers in the 1960s, and in 1971 Intel’s 4004 put a whole processor on one chip.


Type a name, a date, a material, a domain…