The machine of the ACE report, the two programs it prints, and a coding agent that ran them on the computer they were written for.
Published manuscript · v1.1
01 / A COMPUTER ON PAPER
In 1945, at the National Physical Laboratory, Alan Turing wrote a report called Proposed Electronic Calculator: a design for a stored-program computer, which the report’s cover calls an Automatic Computing Engine. It describes the memory, the logical control, the arithmetic and the circuits, down to the valves. It was never built as written. The Pilot ACE that ran at NPL in 1950 was a smaller and different design. I asked a coding agent to build the machine the report describes and to run the programs in it.
02 / A MACHINE THAT WAITS FOR ITS MEMORY
The memory is mercury delay lines. Each holds 1,024 pulses, a microsecond apart, going round and round: 32 words, which Turing calls minor cycles, of 32 digits each. A word can only be read as it comes out of the end of the line. So after an ordinary instruction the machine does not go to the next word in the line but the one after: by the time it is ready, the next “would have gone by before we were ready to apply it; we should always just miss the boat”. The simulation keeps time in minor cycles, because where a word sits decides how long the machine waits for it.
03 / PROGRAMS IN POPULAR FORM
Section 13 gives each instruction three forms: machine form, the 32 digits; permanent form, on punched cards kept in a library; and popular form, a short notation for people to read. Programs are tables of instructions in popular form, such as TS 6 - TS 2 or B, BURY, and a table can name another as a subsidiary. Turing describes how a job is assembled: copy the cards it needs, sort them by name, “renumber them consecutively in the binary scale”, and fill those numbers in wherever one instruction names another. The agent wrote that procedure as a program.
04 / THE CARDS AND THE TABLE
Turing did not offer these tables as finished programs. Section 13 opens: “This account must necessarily be very incomplete and crude because the whole project as yet exists only in imagination.” They were written to show how the machine would be programmed. The report prints two complete tables. INDEXIN, thirteen instructions, fetches a word whose position is held in a temporary storage. It is printed twice: in popular form, and in Figure 38 as the thirteen cards that would be punched for it, digit by digit. Three of the cards do not say what the table says. Where the table has ADD ‘A’ the card has a different multiplier switched on. Where the table has OR the card has AND. And where the table moves TS 8 the card moves TS 4. The figure was read digit by digit twice, by the agent and then blind by a different model, with the same result on all thirteen rows. No person has checked it yet.
05 / INDEXIN DOES NOT RUN AS PRINTED
Run as printed, INDEXIN fetches nothing, and it does no better from the cards. It needs three corrections. The instruction it builds has the code for storing a word where it needs the code for fetching one, and it ends by burying a return address where it should dig one up. Carpenter and Doran’s 1986 edition of the report points out both. The third we have not found written down. INDEXIN shifts the digits it has built sixteen places to move them into place, and then takes the half of the result they have just left. With all three corrections it works, and, given a position in TS 27 as its description says, leaving out any one of them stops it. All three are slips. But the first would not have shown in Turing’s own use of it: CALPOL hands INDEXIN a whole fetching order rather than a position, and INDEXIN merges all of it into the order it builds, so the right code arrives from there.
06 / CALPOL NEVER STOPS
The second table, CALPOL, works out a polynomial of degree fifteen. As printed it never stops: the machine comes back to a state it has been in before, exactly, so it goes round for ever. With five changes it gives the right answer, and gives it again the second time it is used, for the polynomial tried and with whole numbers. Three are slips. One is a place where the report says two different things and CALPOL follows the one the simulation does not take. One is needed only because of how the agent’s UNBURY returns. Carpenter and Doran call section 13 “brilliant” and say it “contains numerous coding errors”, and they analysed CALPOL in a paper in 1977. I have not read that paper, so none of the five is claimed as new here. They are listed, each with its kind, in the repository.
07 / THE TABLES HE ONLY DESCRIBED
Both printed tables call others the report describes in a sentence or two and does not print: BURY and UNBURY, which keep return addresses; DISCRIM, which chooses between two ways on; PLUSIND, MULTIP, ADD, TRANS 45 and BINDEC. These were written for the machine from Turing’s descriptions, and they are ours. Writing them turned up two things. BURY cannot be written the obvious way, with logical operations, because DISCRIM is given its question in the storage they write to. And DISCRIM done as its outline says gives the wrong answer for any word whose last digit is a 1, because that digit counts as a sign: it says no such word contains a 1.
The machine, the assembler and every table run in the browser. You can write a table, see it in machine form, watch every instruction the machine obeys, and run INDEXIN and CALPOL as printed or corrected.
WHAT THIS DOES NOT SHOW
- This is the machine at the level of its instructions. The circuits of Figures 12 to 36 are not simulated, and where the text and the figures disagree about what an instruction does, a choice was made. There are nine such choices, and each is listed with both readings. Where the report says nothing at all, fifteen more conventions are listed.
- Carpenter and Doran’s 1986 notes point out several of the same problems, and their 1977 paper analyses CALPOL, which I have not read. Some of what is reported here as not found before may be in it.
- The machine, the assembler, the tables the report only describes and the corrections all came from one agent in one session. Each correction is labelled as a slip, a conflict within the report, or a consequence of the tables written here.
- A second model, OpenAI’s Codex, reviewed the repository independently. It found that the simulation fetched the next instruction only after the arithmetic had finished, where section 11 overlaps the two; that, the wording of one correction, and the claim that CALPOL never stops were put right in version 1.1. It also re-read Figure 38 blind.
- The DISCRIM result depends on reading its outline literally. Turing may have meant the sign to be dealt with in a way the outline does not mention.
- I found no earlier program that runs the machine of the 1945 report, as opposed to the Pilot ACE. I searched the web and GitHub, and that is not proof there is none.
- Figures 19 and 38 are redrawn here from a transcription. The originals are at the Turing Archive.
- Running a design that existed only on paper is not new: Rojas and colleagues implemented Zuse’s Plankalkül, people who ran Lovelace’s Note G found its error, and Swade’s team built Babbage’s Difference Engine No. 2. Haigh, Priestley and Rope’s ENIAC in Action is the closest scholarly model. Copeland’s Alan Turing’s Automatic Computing Engine was not read.
A program printed as an example is still a program. The way to read it is to run it.
If a computer was only ever a design, were its example programs ever more than drafts?
Turing wrote INDEXIN and CALPOL for a machine that existed only in the same report, with nothing to run them on. The errors are the ordinary kind: a digit, a register, a name. What running them adds is not cleverness but a way of finding the ones that only show when a word is actually in the wrong place.
Thematic notebook / Published record
Closing thought
The two programs in Turing’s 1945 report do not run as printed on the machine the report describes. INDEXIN needs three corrections, all slips; CALPOL five changes, three of them slips. Three of the thirteen cards Turing drew for INDEXIN disagree with its table, a reading checked blind by a second model.