The Pilot ACE Emulator.

Last updated: 8 August 2011: David Green

This emulator is an attempt to provide an historically correct 'virtual' Pilot ACE computer. So far as possible, I have made it a valid representation of the Pilot ACE. The current version of the emulator can be downloaded as EP20110808.ZIP.

Operation of the emulator is by means of the switches on the screen. Left click them with the mouse. A few features that cannot be handled that way (for example, card handling) are implemented from pop-up boxes selected from a menu.

The Pilot ACE was a complicated computer, so these operating instructions are unavoidably lengthy. If you just want to see the Pilot ACE working, check Getting Started

Main panel

1. Minimum Requirements

The minimum screen size is 1000 x 768 and the emulator will not work with smaller screens.

The code was written using the Windows XP platform. It may work with earlier 32-bit versions of Windows but it has not been tested with them. The Windows implementation is pretty clunky. However, the emulator appears to do what is intended and the quest for Windows perfection has been set aside for now.

2. Contents

This document contains the following sections:

1. Minimum Requirements
2. Contents
3. Contents of the Emulator Package
4. Getting Started Running a demonstration program to see the emulator work.
5. Some History The Evolution of the Pilot ACE (and especially the instruction code).
  5.1 10 May 1950.
  5.2 November 29th - December 1st 1950.
  5.3 1951-1956.
  5.4 Thereafter.
6. Running the Emulator
  6.1 General Operating Considerations.
  6.2 Introductory Window.
  6.3 Emulator Window, Menu Items.
    6.3.1 Emulator Options.
    6.3.2 Card Handling.
  6.4 The Emulator Console.
    6.4.1 Card Punch Insert.
    6.4.2 Card Reader Insert.
    6.4.3 Monitor (Scope) Panel.
    6.4.4 First Row of Keys on Main Panel.
    6.4.5 Second Row of Keys on Main Panel.
  6.5 cheating.
    6.5.1 Text Input.
    6.5.2 Diagnostic Report.
    6.5.3 Instruction Trace.
  6.6 Limitations
7. Programs
  7.1 Demonstration Programs
    7.1.1 The ‘Successive Digits’ program.
    7.1.2 The ‘Day of the Week’ program.
    7.1.3 The 'Smallest Factor' Version 1.
    7.1.4 The 'Smallest Factor' Version 2.
    7.1.5 The 'Smallest Factor' Version 3.
    7.1.6 The 'Bouncing Ball' program.
    7.1.7 The Sixth Powers in DL10 program.
    7.1.8 DEUCE Program ZV02 - Easter Day.
  7.2 Donald Davies' other programs,
    7.2.1 Squares and cubes of 1 to 1625.
    7.2.2 Fourth powers, cubes and squares of numbers up to 255.
    7.2.3 Smallest factor using double speed division.
    7.2.4 All Factors saved in DL 10.
    7.2.5 Cubes saved in DL 10.
    7.2.6 Table of sin(x) in DL9.
    7.2.7 Table of cos(x) on Drum.
    7.2.8 Three Programs Not Implemented.
8. Subroutines
  8.1 Use of Subroutines
  8.2 Subroutine Library
  8.3 Multiplication
    8.3.1
Fast Signed Multiplication subroutines M01-M04.
    8.3.2 Double Length Multiplication M09.
  8.4 Division
    8.4.1
Non-restoring division Version 1.
    8.4.2 Non-restoring division Version 2.
    8.4.3 Non-restoring division (extracting two digits per cycle).
    8.4.4 Integer division.
  8.5 High accuracy (e.g. Double length arithmetic)
    8.5.1
Double length signed division (H1).
    8.5.2 Double length multiplication (H2).
  8.6 Floating arithmetic
    8.6.1
Floating Binary Point.
    8.6.2 Prepare in Floating Form.
    8.6.3 Floating Addition and Subtraction.
    8.6.4 Floating Multiplication.
    8.6.5 Floating Division.
  8.7 Read, Card Input
    8.7.1
Subroutine R1.
    8.7.2 Subroutine R2.
  8.8 Output, punched cards
    8.8.1
Subroutine P1, Punch Decimal Number
  8.9 Power series
    8.9.1
Subroutine K1.
    8.9.2 Using K1 to calculate ln(1+X), (0 ≤ X ≤ 1).
  8.10 Square Root.
9. References
  9.1 Pilot ACE
  9.2 DEUCE
  9.3 General
  9.4 Sources
    9.4.1 The NPL Archive.
    9.4.2 AlanTuring.net.
    9.4.3 Donald Davies's Simulator.
    9.4.4 A Java version of Donald Davies simulator.
10. Notes
  10.1 The Initial Card.
  10.2 Wilkinson's 1955 non-recurring Division Code.
  10.3 Donald Davies' "Pilot ACE Simulaton Program".
  10.4 A Java version of Donald Davies' simulator.
11. The Fine Print - Permissions
12. More Fine Print - Disclaimer

3. Contents of the Emulator Package EP20110808.ZIP

The zip file contains the emulator and some support files. Briefly,

PILOTACE.EXE is the emulator.

MAGSTORE.TXT preserves the contents of the drum store between runs of the emulator.

SETTINGS.TXT maintains the latest preferences chosen by the user, between runs of the emulator.

The following Pilot ACE programs in card format.

BOUNCE.CRD      Bouncing Ball
PROG02DD.CRD    Squares and cubes to 1625
PROG03DD.CRD    Fourth powers to 255
PROG07DD.CRD    Smallest Factor Version 1
PROG07DG.CRD    Smallest Factor Version 2
PROG09DD.CRD    Smallest factor Version 3
PROG13DD.CRD    Cubes in DL 10
PROG14DD.CRD    Sixth Powers
PROG15DD.CRD    Table of sin(x) in DL9
PROG17DD.CRD    Table of cos(x) on Drum
PROGJW01.CRD    Non-restoring division Version 2a
PROGJW01G.CRD   Non-restoring division Version 2b
PROGJW02G.CRD   Non-restoring division Version 3
PROGJW03.CRD    Square Root
PROGJW04.CRD    Non-restoring division Version 1
PROGK1-LN.CRD   Using Subroutine K1 to calculate ln(1+x), (0 ≤ X ≤ 1).
SUCDIGS.CRD     Successive Digits

The following Pilot ACE subroutines in card format.

subA1.CRD            Subroutine A1 in DL2, DL3 and DL4
subintdiv.CRD        Integer Division Subroutine in DL2
subH1-DL2.CRD        Subroutine H1 (with p=36) in DL2
subK1-DL2.CRD        Subroutine K1 in DL2
subM1-DL2hi.CRD      Subroutine M1 in m.c. 20-31 of DL2
subM1-DL2lo.CRD      Subroutine M1 in m.c. 0-11 of DL2
subM2-DL2hi.CRD      Subroutine M2 in m.c. 18-30 of DL2
subM2-DL2lo.CRD      Subroutine M2 in m.c. 0-12 of DL2
subM3-DL2hi-sh2.CRD  Subroutine M3 with 2-place shift, in m.c. 18-31 of DL2
subM3-DL2lo-sh2.CRD  Subroutine M3 with 2-place shift, in m.c. 0-13 of DL2
subM4-DL2hi-sh2.CRD  Subroutine M4 with 2-place shift, in m.c. 18-31 of DL2
subM4-DL2lo-sh2.CRD  Subroutine M4 with 2-place shift, in m.c. 0-13 of DL2
subM9-DL2q0.CRD      Subroutine M9 with q=0, in DL2
subP1-DL2m10n28.CRD  Subroutine P1 with m=10, n=28 in DL2
subR1-DL3m9.CRD      Subroutine R1 with m=9, in DL3
subR2-DL3m9n12.CRD   Subroutine R2 with m=9, n=12, in DL3

4. Getting Started

Quick Operating Instructions to see the emulator work.

To Install the emulator:

If you haven't already done so, create a folder C:\PILOTACE using Windows Explorer. Unzip the contents of the Emulator Package into this folder. The emulator and its support files should all be in C:\PILOTACE. The emulator expects to find its files in that folder and it puts output files there.

To Start the emulator:

The menu bar offers several options, including more pictures of Pilot ACE at various stages of its development and some useful information.

To Run the emulator:

To Run the Demonstration Program 'Successive Digits':

'Successive Digits' was the first program to run on the Pilot ACE, back in 1950.

This program can be run from the card deck SUCDIGS.CRD, as follows:

1. 'Load' SUCDIGS.CRD (in the Menu, click 'Card Handling' > 'Load an Input Card Deck' > 'Open...', select SUCDIGS.CRD (single click on it) and press the 'Open' button.

2. Press (click just below) the 'Initial Input' key in the Card Reader Insert. The cards will read in and the program will stop with {1 25-26} on the Input Statisicer lights (that is to say, NIS = 1; SOURCE = 25; DEST = 26, remembering that the numbers have their least significant digit on the left)

Suc Digs

3. Set P22 to one on the ID. (Press the corresponding black key near the bottom of the screen)

Suc Digs

4. Press the 'ONE SHOT' key. The OS lights will gradually turn on in sequence.

5. The program will stop on (1 25-26}, ready to repeat the calculation.

Suc Digs

6. To go again, press the 'CLEAR OPS' key to clear the OS, then return to step 3.

P22 works well on my computer but you may wish to try different speeds by choosing different P values. The larger the number, the faster the OS neons will light up; the lower, the slower; so you can experiment to find a speed that suits your computer. The P numbers can be altered while 'Suc Digs' is running. To turn off a bit on the ID, raise the corresponding black key (click just above it).

To quit the emulator:

Return to Contents

5. The Evolution of the Pilot ACE.

The ACE Pilot Model was designed and built at the National Physical Laboratory, Teddington in England. According to Donald Davies, "The main honours for the design and construction of the Pilot Model ACE are shared by Alan M. Turing, James H. Wilkinson and Edward A. Newman, aided by a sharp nudge from Harry D. Huskey, who really started the Pilot Model idea rolling." [CJ05 ix]

The ACE computer was Alan Turing's brainchild. You can find a lot more about Alan Turing at the web-site maintained by Jack Copeland and Diane Proudfoot. He started to design the machine in 1945 after the close of the Second World War. He envisaged a large, sophisticated computer but in 1947 the visiting American mathematician Harry Huskey proposed building a small Test Assembly. This project, designed to be as simple as possible while still producing a functioning computer, started in the spring of 1947 but was not completed. The idea was revived in 1949, now called the Pilot model ACE, and was completed in 1952.

The full story of the conception and construction of the Pilot ACE can be found in Copeland's book "Alan Turing's Automatic Computing Engine" [CJ05]

The Pilot Ace evolved through several stages and the instruction codes and console layout changed several times. The changes to the console can be seen in the succession of photographs displayed in the emulator picture gallery.

The console layout used in this emulator depicts the console now preserved in the Science Museum in London and the instruction code is the version described by Wilkinson in [WJ55].

Pilot ACE console

It is convenient to start our story with the eventful day when the machine first ran a program.

5.1 10 May 1950.

"Towards the end of the day on 10th May 1950 we had all the basic pulse circuits working, the control unit, one long delay line and a short delay line fitted with an additive and subtractive input. However, our only method of inserting instructions was via a set of 32 switches on which we could set up one instruction at a time in binary; our only method of output was a set of 32 lights to which a binary number could be sent".

"Unfortunately the amplifier on the delay line was barely adequate and the probability of remembering a pulse pattern for as long as a minute was not very high. We concocted a very elementary program consisting of a few instructions only; this took the number on the input switches, added it into the short delay line once per millisecond and put on the next light on the set of 32 output lights when the accumulator overflowed. The lights therefore came on at a speed which depended on the size of the number on the input switches. We laboriously fed this program again and again into the computer but each time the memory would fail before we could finish. On about the twentieth occasion we finally succeeded in inserting the whole program and all the lights flashed up instantaneously. We reduced the input number and they came on slowly one by one; we doubled it and the lights came on at twice the rate and we switched off for the day knowing the computer was working." [WJ05 99]

If you would like to relive the events of that day (but with a more reliable delay line), see the 'Successive Digits’ program.

"The first Pilot ACE program became known as 'Suc Digs'. It was designed to test out the loading and operation of instructions, the single length accumulator TS16, input and output of a simple kind, both kinds of jump instruction and shifting in TS26. This simple program became the last resort when testing the machine after a failure. If it couldn’t do 'Suc Digs', it was in a poor state, so 'Suc Digs' became an institution." [DD2].

5.2 November 29th and 30th and December 1st 1950.

By November, the ACE Pilot Model was working well enough for N.P.L. to risk a grand public demonstration. Day 1 for the popular press produced stories about the 'electronic brain'. Day 2 was for the technical press and day 3 for invited guests including F.C.Williams, Tom Kilburn and Maurice Wilkes.

"Most early computer builders have a 'hard luck story' for their first demonstration day. Ours was a good luck story. For the demonstration we had three main programs, two popular and one serious. Of the popular programs the first [the 'Day of the Week' program] took a date in decimal from input keys and gave out the corresponding day of the week on a cathode-ray tube while the second [the 'Smallest Factor'] took a six-figure decimal number and gave its highest factor. Popular programs provide a merciless test since the slightest error is readily apparent. The serious program traced the path of rays through a complex set of lens; it was virtually impossible for anybody not intimately connected with the computer to know for certain whether this was working correctly. In the event the Pilot ACE worked virtually perfectly for the whole of the demonstration period." [WJ05 100]

"The ‘popular’ program took in a six figure decimal number and ‘gave its highest factor’. Since the output allowed only numbers up to 999, I think it was actually the smallest factor. A bottle of beer was offered to the press for finding any six figure prime. Whenever a multiple of three or seven was called out, Wilkinson responded ‘divisible by 3’ or ‘divisible by 7’ before it was entered. This amazed the press more than the machine itself." [DD2]

5.3 1951-1956.

"The Pilot ACE had been designed purely as an experimental machine with the object of demonstrating the competence of the team as computer engineers. It was originally intended that when it was successfully completed a full-scale computer would be built. In the event it did not work out like this. At the time when it was successfully demonstrated it was the only electronic computer in a government department and indeed the only other working computers were EDSAC at Cambridge, SEAC at the National Bureau of Standards and an early version of the Manchester machine. We naturally came under very heavy pressure to use the Pilot ACE for serious computing. We accordingly embarked on a small set of modifications which included the addition of an automatic multiplier and improvements to the control unit which made programming a little less arduous. The computer was then put into general use and did yeoman service for a number of years." [WJ05 100]

In February 1952 the Pilot ACE was moved to the Mathematics Division of N.P.L. and put into continuous service. By March 1954 it had been enhanced by the addition of a magnetic drum memory.

Although not intended to be used for large-scale computation, it was in active operation until 1956.

5.4 Thereafter.

The final version of the Pilot Ace now stands in a glass case in the British Science Museum in London, for all to see.

Pilot ACE now

"During the period when the Pilot ACE was being built the English Electric Company became interested in electronic computers and a small group from the company joined us at N.P.L. ... After the success of the Pilot machine English Electric decided to gain experience by building engineered versions of this computer." [WJ05 102]

"DEUCE (Digital Electronic Universal Computing Engine) is a machine built by the English Electric Co. Ltd., from a design used by N.P.L. for the ACE Pilot Model (Automatic Computing Engine). The differences between DEUCE and the ACE Pilot Model concern certain rationalisations of design and the size of store." [EE59 7]

The first DEUCE was delivered in the spring of 1955. It is fortunate for us that DEUCE was very similar to the Pilot ACE because some documentation for the DEUCE 'Version 0' survives, and provides a guide to undocumented features of the Pilot ACE.

Thereafter, English Electric upgraded DEUCE in several ways. Within a few months they introduced the Automatic Instruction Modifier (AIM). Later they made it possible to read 64 columns of each card rather than 32 (and hence two instructions per row rather than the orignal one instruction per row). Later still, they made it possible to utilise all 80 columns of a card and also increased the memory size by the addition of seven extra delay lines.

The successive models were called the Mark 0, Mark I, Mark II and Mark IIA. By September 1961 there were two Mark 0, 19 Mark 1, five Mark 2 and four Mark 2A machines in service.

Meanwhile, work finally began on the 'Big' ACE in the autumn of 1954. It was completed in late 1958 and remained in service until 1967. Only one was made. [CJ05 77]

Return to Contents

6. Running the Emulator.

6.1 General Operating Considerations.

The original Pilot ACE was operated by means of the keys on the display panel and the keys on the peripheral card reader and card punch.

Just the same is true of the emulator. The 'virtual' Pilot ACE is controlled by the switches on the screen, and the switches are controlled by the mouse.

Programs were usually entered into the Pilot ACE by means of punched cards. The emulator uses virtual cards. They are files of type .CRD. (The *.crd files are text images; you can read them with any text editor).

The operator manually selected a batch of cards and placed them in the card reader stacker.

The emulator equivalent is to select a card file using the Menu: 'Card Handling' > 'Load Input Card Deck' > 'Open' and to choose a file in the normal Windows way (select a file and click on Open). The Card Position 1 neon in the Reader Insert will light up. Pressing the 'Run In' Key will light card position 2 and 3 neons, and the 'Ready' light - the first card is now ready at the read heads. (This step is not needed if the 'Initial Input' Key is used to run in a new program).

It would be impossible to instruct anyone not already familiar with the Pilot ACE on how to program it in a short introduction like this. However, the demonstration programs in the Section 7 will give a feel for the computer without the need for further information, and the references contain more details.

6.2 Introductory Window.

The introductory screen supplies some background information about Pilot ACE and the emulator.

There are photographs of the console as it existed in 1950, 1952, 1953 and 1956 and some useful references.

The emulator operates in a second window, accessed by pressing 'Run' in the menu.

6.3 Emulator Window, Menu Items.

6.3.1 Emulator Options.

In real life the Pilot ACE was very unfriendly. The only information that was available was on the lights or on cards punched out by the program. It was possible, but frowned upon, to single shot through a program. You had to be disciplined in the use of stopped instructions and you had to learn to read 'Chinese binary' pretty quickly (numbers were written with the least significant digit on the left).

The emulator will act just like that if you are feeling masochistic. On the other hand, it will record the progress of a run in a report called PILOTACE.RPT if asked to.

Menu: 'Emulator Options' > 'Preferences' will bring up a panel entitled 'Operating Preferences'. These options relate to the possibilities listed under 'cheating'.

Operating Preferences panel

Each little box is a Windows 'Check Box'; they click on and off. 'On' shows a tick mark; 'off' is blank. The larger boxes hold numbers (not greater than 99999) that you type in, and the 'Set Number' button must be clicked to register each new value. For the most part the options are self-explanatory but a few wrinkles are noted below.

6.3.2 Card Handling.

Load Imput Cards

This menu is needed to duplicate the physical action of placing cards in the hopper of the card reader or card punch.

6.4 The Emulator Console.

This screen is intended to be as accurate a depiction of the final Pilot ACE control panel as possible, as it appears in the Science Museum today.

6.4.1 Card Punch Insert.

In real life the operator would

a) Assemble a deck of blank cards and place them in the hopper, and
b) Feed the first card up to the punch knives using the 'Run In' key.

The equivalent actions with the emulator are

a) Nominate a card file using the menu 'Card Handling' > 'Load Punch Cards' > 'Open' >, then left-clicking on the desired file name and pressing 'Open' (or typing in a new file name and pressing 'Open' and answering 'Yes' to the question "Create the file?"). The 'Hopper' neon should light up.
b) Feed the first card up to the punch knives using the 'Run In' key. The 'Ready' neon should light up.

Punch Insert

Hopper Neon This neon was not present on the real punch. The operator could see at a glance if cards were in the punch hopper. We can't, so this neon has been introduced (a local engineering modification!) as a visual aid - it lights while a virtual card deck is specified.

Called Neon ON indicates the program has stimulated the punch.

Ready Neon ON indicates a card is ready at the punch knives.

Punching Neon ON indicates punching is in progress (the punch is both called and ready).

Run Out Neon Not implemented.

Stop Key Two positions: level or down. Pressed down, it stops the punch at the end of the current card and returns to the neutral (level) position. [**EE59 93]

Run In Key Two positions: level or down. Pressed down, it primes the punch (if cards are in the hopper, it runs a card up to the punch keys and turns on the ready neon, otherwise it has no effect) and returns to the neutral (level) position. [**EE59 93]

Run Out Key Two positions: level or down. Pressed down on the Pilot ACE it empties the punch (and hopper) and returns to the neutral (level) position. In the emulator the action is to close the current card file. [**EE59 93]

6.4.2 Card Reader Insert.

In real life the operator would

a)Assemble a deck of cards and place them in the hopper, and
b)Feed the first card to the read position using either the 'Run In' key or the 'Initial Input' key.

The equivalent actions with the emulator are

a) Nominate a card file using the menu 'Card Handling' > 'Load Input Card Deck' > 'Open' >, then left-clicking on the desired file name and pressing 'Open'.
b) Feed the first card to the read position using either the 'Run In' key or the 'Initial Input' key.

Reader Insert

Card Position Neons "There are six card positions in the reader: each has a lamp which is lit when a card is in that position. Position No.1 is the card feed at the top, position No.6 is the stacker at the bottom from which cards are removed. The cards are actually read beween positions 3 and 4. Once a card has passed beyond position 3 it cannot stop until it has reached position 6, the stacker; so when the reader is not running lamps 4 and 5 will be off. Cards can sit in positions 2 and 3 indefinitely. The computer can only read cards if position 3 is filled and the 'Ready' light is on." [**EE59 92]

Ready Neon ON if a card file has been loaded as described above, otherwise OFF.

Not Ready Neon Not implemented.

Running In Neon Not implemented.

Running Out Neon Not implemented.

Called Neon ON indicates the program has stimulated the reader.

Reading Neon ON when the reading is in progress

Missed Card Neon Not implemented

Initial Input Key This key is used only when a new program is read. It clears the entire high-speed store, calls the reader and runs the cards into positions 2 and 3 so that the machine starts to read the program.

Stop/Run In Key The Stop/Run In Key is generally used for running in data cards.
Key pressed: if there are cards in the hopper, cards feed into positions 2 and 3 and the Ready light comes on; should a card be in position 3 already, the cards do not move but the Ready light comes on; if the hopper is empty the request is ignored. Spring return to neutral (level) position. [**EE59 92]
Key raised: key moves but has no effect. Spring return to neutral (level) position.

Run Out Key Closes the card file.

Return to Contents

6.4.3 Monitor (Scope) Panel.

Nowhere can I find an explicit description of what the monitor was used for. Was it an oscilloscope to show wave forms or did it show the content of various delay lines?

Wilkinson [WJ05 100] recalls a program demonstrated in November 1950 which "took a date in decimal from input keys and gave out the corresponding day of the week on a cathode-ray tube". I take this to mean that the monitor could display the contents of a delay line.

DEUCE was able to display the contents of any delay line, the short tanks or TSCOUNT. I have assumed in the emulator that Pilot ACE could also display the contents of any delay line or the short tanks (but have chosen to ignore the TSCOUNT display).

"As in the actual machine, two chosen delay lines can be displayed ..." [DD1] I don't understand how Pilot ACE could do this with just one scope, so have ignored it.

Monitor Panel

? E ? Keys The original purpose of these keys is not documented. As they are close to the scope I have used them to control what is displayed on the scope. The five keys each has two positions: level (neutral) and down (include in count). They are used in combination to select a number from 0 to 31 (in backwards binary). The numbers select the following displays:

0.  switched off
1.  Delay Line 1
2.  Delay Line 2
3.  Delay Line 3
4.  Delay Line 4
5.  Delay Line 5
6.  Delay Line 6
7.  Delay Line 7
8.  Delay Line 8
9.  Delay Line 9
10. Delay Line 10
11. Delay Line 11
12-15 ignored - (blank screen)
16. If this key is depressed, the other keys are ignored and the short tanks are displayed.

? F ? Buttons There is no record of what these buttons were used for. The emulator ignores them.

? X ? Key Purpose unknown, ignored by the emulator

? Y ? Key Purpose unknown, ignored by the emulator

? Z ? Key Purpose unknown. I have used this key for m.c. slip. Each time the key is depressed, the lines on the monitor (for the delay lines - the short lines display is not affected) will move up 2 positions, and the key will spring back. (The DEUCE had three controls for the monitors: focus, brilliance and mc slip. There are three keys here, so perhaps 'X' and 'Y' were used for focus and brilliance?)

Return to Contents

6.4.4 First Row of Keys on Main Panel.

First Row Keys

? A ? Two neons and one key. Purpose unknown. For the present the emulator ignores them.

Hollerith Read Key and Neon Key pressed - stimulate reader for one card. Key is spring-loaded and will revert to neutral (level) position. [If there is a program deck in the reader, cards will continue to be read all the while each card has a one punched in column 35 of row 9.]

Hollerith Punch Key and Neon It is not clear how this key would have been used, so for the present the emulator ignores it.

[Note: For DEUCE: Read and Punch Keys: "There are two keys on the Control Panel which allow Read and Punch to be called or cleared manually, instead of by the trigger instructions x-31 and x-30. They are labelled Read and Punch. To call Read, press down the Read key. To clear Read, raise the Read key. To Read a single card, press down the Single Read key. To call Punch, press down the Punch key. To clear Punch, raise the Punch key. A lamp above the Read key is lit while Read is called, and a corresponding lamp above the Punch key is lit when Punch is called." [**BA57b #2.14]]

Request Stop Keys

The Request Stop facility will stop the computer on any instruction with particular NIS, Source or Destination or combination of these. [**BA57b]

While the first three request stop keys have obvious DEUCE equivalents, DEUCE had no keys that match the ?B? DISC and ?C? keys.

Key ?B? DISC. DEUCE had just one 'DISC' key where Pilot ACE had two. I have assumed that this DISC key was used to request a stop if the program encountered a discrimination instruction. That is, a stop will occur if destination=24 or destination=25. If this DISC key is pressed, the DEST key is ignored. [The justification for this is that it is useful to be able to force a route through a program during program testing - which may or may not have been it's original purpose. This can also be achieved by setting 24 or 25 on the destination keys, but involves more work.]

Key ?C? ON. On DEUCE, raising the External Tree Key switched on the Request Stop circuits. I have assumed this was achieved on Pilot ACE by pressing key ?C? instead.

"The usual procedure is to

  1. Stop the machine.
  2. Make the request.
  3. Run the computer on NORMAL or at STOP with single-shots, until Request Stop operates.
  4. Put key at STOP if it is not already there.
  5. Remove a Request Stop condition (see below).

"To make the Request:

  1. Press down the '? C ? On' key.
  2. Set the three Request Stop switches. They correspond in natural order to NIS, Source and Destination; the computer examines those of the NIS, Source and Destination of the instruction in CONTROL for which the corresponding Request stop switch is down.
  3. Set the NIS, Source and/or Destination at which the stop was requested on the IS keys. (The position of the characteristic key does not affect Request Stop.)

"The computer continues normally (full speed or single-shotting) until there is complete agreement between the part of the current instruction selected by the Request Stop switches and the reading on the corresponding IS keys; it then stops (however, the GO lamp will be on).

"For example, suppose the '? C ? On' key is down and (7 13-28) is set on the IS keys, then

  1. if all Request Stop switches are down, the computer stops when an instruction (7 13-28) is encountered;
  2. if only Source and Destination Request Stop switches are down the computer stops at the first (13-28) instruction it encounters, regardless of NIS.

"This example demonstrates that the Request Stop facility is made more selective by having more switches down." [**BA57b]

To remove the Request Stop condition:

"To go beyond this instruction, a condition of the Request Stop must be removed, i.e,

  1. '? C ? On' key no longer down, or
  2. all Request Stop switches up, or possibly an extra switch down, or
  3. one of the relevant IS keys altered.

"This is best done with the machine at stop. Then on release by a) or b) or c) above, this instruction is obeyed and the next instruction is treated like a Stopper." [**BA57b]

One Shots Dial

The one-shot dial supplies an exact number of up to 10 one-shots (dialling 0 supplies 10 one-shots). Left click the number you require.

TIL Key

While the key marked TIL is down, the TIL signal is given continuously.

Discriminate Key

The key has three positions:

  1. key up forces a positive branch for D24, or a zero branch for D25;
  2. key down forces a negative branch for D24, or a non-zero branch for D25;
  3. key level, instructions with destination 24 or 25 are obeyed normally.

Clear Store Key

Pressing the Clear Store key (spring return) clears the high-speed store (but not the drum).

Continuous TCI Key

The TCI signal is normally applied for the one minor cycle in which Control is to take a new instruction, and allows an instruction to enter TS COUNT from the instruction highway or via destination 0. The signal is applied while the Timei key (marked TCI) is down. A stream of instructions enter TS COUNT, and the last instruction to enter TS COUNT before the key is raised stays in TS COUNT and is displayed on the IS lamps.

External Tree Key

Normally this key is level. While it is down the External Tree facility is operating.

This facility allows NIS, Source, Destination and Characteristic of the instruction in TS COUNT to be ignored and the reading from 13 IS keys (the keys below the Instruction Staticiser lamps) and a characteristic key (labelled Char) to be taken instead. [**BA57b]

On DEUCE, key up actioned Request Stop. I have reallocated this action to key C down.

Continuous TT Key

The transtim signal, which allows transfer to take place from Source to Destination specified by the instruction held in TS COUNT (or by External Tree when this is operative) is applied (for a number of complete mc's) while the Transtim key (marked CONT TT) is held down.

6.4.5 Second Row of Keys on Main Panel.

Second Row Keys

Instruction Staticiser Keys and Neons

These give NIS, Source and Destination of the instruction in TSCOUNT if the computer is stopped. Otherwise they are only meaningful in so far as they may display periodicity should the computer be continually repeating a sequence of instructions.

Trigger A Neon The TCA lamp is lit when TCA is on.

Trigger B Neon The TCB lamp is lit when TCB is on.

Buzzer Neon and Key The Pilot ACE could alert the operator by turning on an 'alarum' neon and sounding a buzzer. [For DEUCE, the buzzer key had three positions which worked as follows: Level was neutral; Down was spring-loaded - it turned off the buzzer and the alarum neon and returned to neutral; Up killed the alarum buzzer but left the alarum neon operating normally ]. Here the buzzer is not emulated, and only pressing the key down has a discernable effect - it switches off the alarum neon.

Special Word Key See Input Dynamiciser

Clear ID Key Pressing this spring-loaded key sets the contents of the Input Dynamiciser to zero and turns the 32 ID neons off.

Stop Key This key should normally be up. When it is level the computer will stop and the program can be advanced one instruction at a time using the 'One Shot' key.

One Shot Key

Pressing down the one-shot key supplies a single shot (spring return). Raising the one-shot key supplies a rapid succession of one-shots (about 600 a minute). [**BA57b #2.5]

The one-shot key and one-shot dial are non-operative when the Punch or Reader is punching or reading respectively.

Clear OPS Key

The Clear OPS key clears the OS lamps each time it is pressed. It springs back to normal when released. Holding the Clear OS key down is non-productive, since the OS lamps are cleared only once as the key is depressed and will take up the configuration of any further number sent to D29 whatever the static position of the Clear OS key. [**BA57b #2.3]

Output Staticiser, a row of 32 Neons

"Answers from the computer are normally punched on cards. A single binary number may instead be displayed on the row of 32 Output Staticiser lamps. A number to be displayed on the lamps is transferred to D29 when the Punch is not punching. Actually, all numbers punched on cards are also displayed row by row on the OS lamps as they are punched, but they appear there for too short a time to be recognised by any but the most alert operator; the OS lamps are cleared immediately after the punching of each row and also at the beginning of any sequence of cards being punched." [**BA57b #2.3]

Input Dynamiciser: 32 Neons, Keys and Special Word Switches

"The Input Dynamiciser (ID) provides a means by which the operator may supply a single binary number for assimilation by the computer. The number set up appears on a row of 32 ID lamps and is then available at Source 0 for transfer to any selected destination. Source 0 gives the configuration on the ID lamps so long as the Reader is not reading cards; when the Reader is reading, the ID lamps are no longer effective, and Source 0 gives in turn the successive rows of the card being read." [**BA57b #2.4]

"The apparatus of the ID consists of 32 ID lamps already mentioned, 32 ID keys, a clear ID key, 32 Special Word switches and a Special Word key. Each ID key works the corresponding ID lamp; pressing the key lights the lamp, raising the key dowses the lamp; the key springs back from either position, leaving the lamp on or off as the case may be. This supposes that the Clear ID key is in the normal horizontal position; raising or lowering the Clear ID key dowses all the ID lamps; the Clear ID key will lodge in its upward position but spring back to normal from the downward, (this is the only distinction between the two extreme positions). When the Clear ID key is lodged upward (or held downward), an ID lamp remains on only so long as its corresponding ID key is held down." [**BA57b #2.4]

"The 32 Special Word switches provide a means of setting a standard pattern on the ID lamps. This standard pattern is first set on the 32 Special Word switches and then transferred to the ID lamps by raising or lowering the Special Word key. The 32 Special Word switches each have two positions, up and down; raising the Special Word key lights those ID lamps opposite Special Word switches which are down; lowering the Special Word key lights those ID lamps opposite the Special Word switches which are up, (this curious inversion of operation has no particular significance and is incorporated solely as an aid to memory). The Special Word key springs back to normal from either position, leaving on those ID lamps which have been lit (unless the Clear ID key is lodged upwards or held downward, in which case the ID lamps go out on releasing the Special Word key)." [**BA57b #2.4]

"Movement of the Special Word key does not affect those ID lamps not being lit by the movement; any which are already on are left on. Thus, moving the Special Word key up and then down lights all the ID lamps (provided the Clear ID key is normal)." [**BA57b #2.4]

Return to Contents

6.5 Cheating.

The emulator will read programs as text, and will report the Pilot ACE stores in instruction format, as integers and as decimal fractions. But of course, this is cheating.

The emulator produces a short report called PILOTACE.RPT. If it doesn't find a file of that name in the folder it creates a new file, otherwise it overwrites the old one. PILOTACE.RPT is a text file and it can be read by any normal document reading program (for example, Microsoft notepad).

Menu: 'Emulator Options' > 'Preferences' brings up a dialog box that allows you to choose which diagnostic procedures you may want to have reported. The emulator will preserve any changes you make to the preferences in a support file called SETTINGS.TXT, ready for your next run.

You will have to close the emulator to view the report file but restarting is not a big deal.

6.5.1 Text Input.

The following is an example of text input, (it is PROG14DD.TXT)

1 0  1  0-21 1  0  0 X
1 1  1 12-17 1  0  1  
1 2  1 28-10    0 31  
1 3  1  1-27 1  0  1  
1 4  1 16-12    1  1  
1 5  4 15-28 3 31 31  
1 5 24,7,30,31,31,31,3
1 6  1  1-26 1  0  1  
1 7  1 14-17    1  1  
1 8 24,16,1,0,0,0,0
1 9  1  1-14 3  0  2  
110  1 16-14    2  2  
111  2 30-30 3 31 31  
111 4,15,31,31,31,31,3
112  7 31-31 3 31 31  
112 31,31,31,31,31,31,3
113  1  1-12 3  0  2  
114  1 12-17 1  0  5  
115  7  3- 0    0  0 X
117  1  1-16 1  0  1  
118  1  0-21    0 12  
119  0 13- 1    0  0 X
119 16,22,0,0,0,0,0
120  1 27-17    0  0  
121  1 16-12 1  1  2  
122  1 16-27    0  0  
123  1 10-25 1  6 24  
124  1 26-17    0  0  
125  1 20-10    1  0  
126  1 16-26    0  0  
127  1 16-10 1  3 26  
128  1 14-17    1  1  
131  1 16-14    0  0  
S1 0

This code is in fixed format. It was for my use and was not intended to be user friendly. These are the rules:

There is a special, simple way to read in a text file:

6.5.2 Diagnostic Report.

The diagnostic report and diagnostic trace were originally to help me debug the emulator and simplify the testing of Pilot ACE code. However, they can be very informative so I have left them in. PILOTACE.RPT records:

Of course, if you really want to know what the programmers of the day had to contend with, you should eschew using text input or PILOTACE.RPT, and especially the trace facility below.

6.5.3 Instruction Trace.

The trace provides information in PILOTACE.RPT about the state of the machine each time the emulator starts a new instruction.

Clearly, this can result in a very large file, so two numbers in the range 0-99999 are requested. The diagnostic snapshots are not turned on until the first number of instructions has been processed and they are turned off when the second number of instructions is reached. If the output to the report exceeds the limit specified the trace automatically stops.

The following example shows that 'trace' reports a line for TSCOUNT and one for each of the short lines. For each it shows the 32 binary bits and interprets the word as an instruction; as a signed integer value; and as a signed decimal fraction (assuming the binary point is between P31 and P32). Which of these (if any) makes sense is for the user to decide.

status after updating tscount with instruction 22755;      minor cycle= 12
TSCOUNT 01000 01010 01110 00000 00000 00000 00    1 20 28 0  0  0  X
ts15    10011 01001 10000 00000 00000 00000 00   P4  5  3 0  0  0  X        1625   0.000000756
TS16    00000 00000 00000 00000 00000 00000 00                      
TS20    10001 11101 01001 00001 01000 00000 00   P0 15  5 1  8  0  X     2640625   0.001229636
ts26    10010 01111 00110 11100 00111 11111 11   P4 28 25 2  3 31  3    -3951671  -0.001840140
ts27    00000 00000 00000 00000 00000 00000 00                      
ds12 is empty
ds14[0] 00000 00000 00000 00000 00000 00000 00                      
ds14[1] 00000 00000 00000 00000 00000 00000 00                      

This particular example is the final instuction of running PROG02DD.CRD and shows the integers 1625 in TS15, 2640625 (=1625^2) in TS20 and 4291015625 (= 1625^3) in TS26. (As the emulator reports signed integers and prog02DD uses unsigned integers, interpret TS26 as 2^32-3951671 = 4291015625).

Note that the snapshot is at the time that TSCOUNT is refreshed, so the contents of the short stores are the result of the instruction previously held in TSCOUNT.

6.6 Limitations.

7. Programs

Hardly any original Pilot ACE software has survived. However, several of the most basic subroutines have and they are held in the Science Museum archives. They are reproduced in Section 8. Donald Davies, who was a member of the original Pilot ACE team, rewrote several programs in 1999 [DD2] so these are 'almost' original. I have written a few more, mainly by 'reverse engineering' DEUCE programs or coding Wilkinson's flow charts. Many of the early DEUCE programs were simply transcribed from Pilot ACE code into DEUCE code, often at N.P.L., so reverse engineering them produces routines that are probably close to the originals

In what follows, to "press" a key, click beneath it; to "raise" a key, click above it; to return a key to its middle position, click on its middle. Some keys were spring-loaded: these return to their neutral position automatically after a delay of about one second.

The various programs are provided as virtual card decks. These 'card decks' are text files and can be viewed with any text editor.

Each deck consists of an initial card followed by one or more triads - groups of three cards holding the contents of one delay line. Each triad holds, in the first four rows of the first card, special code to read the remaining 32 rows of the three triad cards.

The Initial Card was not documented. Fortunately an actual card exists in the Science Museum archives. How it works is described in Note 10.1.

On the Pilot ACE, the procedure to read in a new program was to select the appropriate deck of cards, place the cards in the hopper of the card reader, and then press the 'Initial Input' key.

For the emulator, the instruction "Load the program cards" means these two steps

Note also that you do not have to exit the emulator to change Pilot ACE programs. The initial input key clears all the stores and readies the virtual Pilot ACE for the new program.

7.1 Demonstration Programs

7.1.1 The ‘Successive Digits’ program.

As mentioned earlier, this was the first program to run on the Pilot ACE, on 10 May 1950. The original version of the program is lost and would anyway have used the instruction codes current in 1950.

In 1999, Donald Davies recreated the code using the 1955 instruction set. "This first program became known as 'Suc. Digs'... The output was a single binary digit, running along the lamps which showed the output register. The rate of travel was adjusted by choosing an input number which was added to the accumulator until it spilled into the sign digit, then making one shift of the output digit. ... There was no record of the [code] we used on the real machine, but [my version of Suc. Digs.] does the same thing - as far as I can remember." [DD2]

I think this is not entirely correct. The nature of the OS is that "If several words are sent to D28, the number set up on the lights will be equivalent to a number which has a one in every position where at least one of the words had a one" [WJ51A #7.2] and "The lights can only be cleared, that is the number registered in them returned to zero, by operating a manual switch" [WJ55 270]. So the output would not have shown a single digit but rather a line of ones gradually building from left to right. And Wilkinson states "we finally succeeded in inserting the whole program and all the lights flashed on instantaneously." [WJ05 99]

This program can be run from the card deck SUCDIGS.CRD (Section 4).

Alternatively, you can repeat the events of 10 May 1950 as follows:

1. Press 'Clear Store' key
2. Enter the instruction {0 0-1 s 16 17 X} on the ID keys. (Recall that the computer uses 'backwards binary' so that, for example, 16 is 00001, not 10000. And that a neon is off for 0 and on for 1. And that X indicates that P32 has the value 0 and the absence of X means P32 = 1. And that s indicates that P15 = 1. )
3. Press the 'One Shot' key (single shot).
4. Repeat 2. and 3. for the following instructions
5.  {1 15-15 s  0 20  }
6.  {0  0- 1   17 26 X}
7.  {1  0- 1 s 30 31 X}
8.  {1 15-15 s  0 19  }
9.  {1 25-26    0  0 X}
10. {1 28-29 s  0 31  }
11. {1  0-17    0  0  }
12. {1 28-16    0  0  }
13. {1 16-24 s  0 28  }
14. {1 26-28    0  0  }
15. {0  0- 0    0  0 X} ie. zero: clear the ID keys by pressing the 'Clear ID' key.
16. {1 19-26    0  0  }
17. {0  0- 0    0  0 X} ie. zero.
18. {1 26-25 s  0 21  }
19. At this stage the computer will halt with {1 25 26} on the IS neons. Clear the last instruction from the ID, set a value on the ID neons, say P22, and press 'One Shot'. The program will slowly light up the OS neons from left to right, then stop on {1 25 26} again, ready to repeat the program.
20. To repeat the program, a) clear the OS neons by pressing the 'Clear OPS' key, b) set a new value on the ID neons, and c) press 'One Shot'.

The code in steps 2 and 5-8 is a small boot-strap I have written. (15-15 is a dummy instruction. It does not change the content of memory but the timing number allows the program to put the subsequent code into the correct stores.) This is one way to get the program into the computer, but I don't know if Wilkinson used this code. The code in steps 9-18 is Donald Davies' 'Suc Digs' program.

If you tune the monitor to Delay Line 1 you will see the delay line updated as each instruction is entered.

7.1.2 The ‘Day of the Week’ program.

This was one of the three programs presented at the N.P.L. public demonstration on 29th November 1950. We don't yet have the full code for this program.

"For the demonstration we had three main programs, two popular and one serious. Of the popular programs the first [this Program] took a date in decimal from input keys and gave out the corresponding day of the week on a cathode-ray tube while the second [Smallest Factor] took a six-figure decimal number and gave its highest factor. The serious program traced the path of rays through a complex set of lens; it was virtually impossible for anybody not intimately connected with the computer to know for certain whether this was working correctly." [WJ05 100]

This is the only Pilot ACE program for which some original cards survive. Six original input cards are held in the archive at the Imperial College Library, London. Sadly the deck is not complete: the first card is a special card to initialise the computer and the last two cards are part of an incomplete triad. It seems possible that just one card is missing, and if so, it might be possible to resurrect the original code.

A similar program was written for DEUCE (Calendar, ZV06) but that code is also lost.

Code is available for a later DEUCE version ZV06T/1. However this is a more sophisticated program coded for a much upgraded version of DEUCE and so not a useful guide to what ZV06 might have been. "This demonstration program reads a date (A.D. only) set on the I.D., calculates the day of the week on which it falls and displays the answer in the scope. ... allowance is made for the change from the Julian to the Gregorian Calendar on 3rd - 13th September, 1752. Except on Mark 0 machines this program supersedes ZV06 (No. 5) because it is ... not restricted to the 19th and 20th centuries."

7.1.3 The 'Smallest Factor' Version 1.

Donald Davies, who was present at the demonstration in November 1950, later recalled that "The program took in a six figure decimal number and ‘gave its highest factor’. Since the output allowed only numbers up to 999, I think it was actually the smallest factor. A bottle of beer was offered to the press for finding any six figure prime. Whenever a multiple of three or seven was called out, Wilkinson responded ‘divisible by 3’ or ‘divisible by 7’ before it was entered. This amazed the press more than the machine itself."

This code in PROG07DD.CRD was developed by Donald Davies in 1999. "I have tried to reproduce the popular demonstration. ... I have made it to treat any odd number less than 232. Given a number in the input register, it tries division by 3, 5, 7,... until the quotient is smaller than the test divisor. If the remainder is zero, it signals a prime by the buzzer. If not, it outputs the smallest factor of the given number [on the OPS] and returns to the start in either case."

To run the program:

1. Load the program cards PROG07DD.CRD
2. The program stops with (1 0-15) on the IS lights
3. Enter a number on the ID lights (for example, the illustration below).
4. Press 'ONE SHOT'. The computer calculates the smallest factor and puts it on the OS lights.
5. To make another calculation, press 'CLEAR OPS', press 'CLEAR ID' and go to step 3.

"A useful number for demonstration is 999,997 which is 757 x 1321". The result for this calculation is shown below.

Smallest Factors of 999997

This would not have been a very usable demonstration. Inputting a six digit decimal number in backwards binary and reading a three digit result in backwards binary would have been incomprehensible to most people. Davies provided input and output in decimal in his emulator but not in the Pilot ACE code.

One way to enter the numbers as decimals is to use 4-bit binary-coded decimal in the ID, and to display the smallest factor in the same way in the OS. I have developed some code to do this in Version 2 below.

7.1.4 The 'Smallest Factor' Version 2.

Davies noted that "the program took in a six figure decimal number" but there is no record of how this was done.

I have extended the code to allow the decimals to be entered as individual 4-bit binary codes in the ID, and to display the smallest factor in the same way in the OS. This is PROG07DG.CRD.

To run the program:

1. Load the program cards PROG07DG.CRD
2. The program stops with (2 0-26) on the IS lights
3. Enter a number on the ID lights (for example, the illustration below).
4. Press 'ONE SHOT'. The computer calculates the smallest factor and puts it on the OS lights.
5. To make another calculation, press "CLEAR OPS', press 'CLEAR ID' and go to step 3.

Smallest Factor of 999997 in decimal

The numbers in this screen are hexadecimal (four bits separated by a space), reading in the normal way (least significant digit on the right and least significant bit on the right). The silver switches have been adjusted to highlight the position of the separating spaces and do not play an active role in the program. The ID shows the number 999997 and the OS shows its smallest factor 757. The calculation takes about 12 seconds on my computer.

7.1.5 The 'Smallest Factor' Version 3.

Further investigation reveals that there is a DEUCE program ZV03 'Million Factors Slow', "a demonstration programme [which] reads a number less than a million from the I.D., computes its smallest factor, if any, and displays this, or the word PRIME, in the scope". It is another very early program, DEUCE Program Number 7, so it was almost certainly derived from a similar Pilot ACE version.

For input, "On the I.D. set successively the digits of the number commencing with the most significant; the convention used is for the P1 - P10 keys to represent the digits 0-9. If the number has less than 6 digits set a P32 after the last one.

The "Programme stops on 1, 30-21 X with the smallest factor or the word PRIME displayed in the scope".

ZV03 is a candidate for reverse engineering, as we have the code, but it is not yet implemented.

7.1.6 The 'Bouncing Ball' program.

After the Lord Mayor's Show comes the dust cart. BOUNCE.CRD is a bouncing ball demonstration program. The program was written in 2011 and has no historical significance. However, it is authentic Pilot ACE code. It depicts a ball (in DL 8) bouncing within the confines of the monitor.

Bouncing Ball

To run the program:

1. Load the program cards BOUNCE.CRD
2. Switch the scope to DL 8.
3. The program runs until interupted.

Notice that the ball stays within the vertical boundaries but may run through the top or bottom of the monitor screen. This is perfectly normal (see Note 10.1). The ball can be confined within the screen by pressing the 'M.C.SLIP' key as many times as necessary.

There is no speed control. What you see is what you get.

7.1.7 The Sixth Powers in DL10 program.

This is Donald Davies' program 14. It list the 6th powers of the numbers from 1 to 32 in DL 10, calculating the successive powers by summing them from a constant sixth difference of 720. [DD1]

Sixth powers in DL10

To run the program:
1. Load PROG14DD.CRD. The program stops on {1 0-21 1}
2. Align monitor to DL 10.
3. Single shot (press 'ONE SHOT'). The monitor fills with the calculated 6th powers.
4. Single shot clears DL 10 and repeats step 3.

Notice that the numbers do not necessarily start from the top of the monitor screen. This is perfectly normal, (see Note 10.1). They can be lined up by pressing the 'M.C.SLIP' key as often as required.

7.1.8 DEUCE Program ZV02 - Easter Day.

Easter Day was a very early DEUCE program - number 6 - so presumably it was written before the spring of 1955. This would suggest it was derived from a similar Pilot ACE program and could be reverse engineered. Work-in-progress!

It "reads a year from the I.D. and displays in the scope the date of Easter Sunday in that year".

7.2 Donald Davies' other programs

The following programs, written by Donald Davies in about 1999, all work, but do not provide anything new to look at, or anything to look at at all.

7.2.1 Squares and cubes of 1 to 1625.

Donald Davies' program 2. For numbers from 1 to 1625 it forms the squares and cubes, using the iterations:

(n+1)3 = n3 + 3n2 + 3n + 1

(n+1)2 = n2 + 2n + 1

At the end, only the square and cube of 1625 is retained. By one-shots, 16253, 16252 and 1625 are output (to the OS), leaving the program ready to run again.

To run the program:
1. Load PROG02DD.CRD. The program stops on {1 28-15}
2. Single Shot (press 'ONE SHOT'), program stops on (1 20-28 ) with 16253 in the OS.

1625 cubed

3. Press 'CLEAR OPS'.
4. Single Shot, program stops on (1 15-28) with 16252 in the OS

1625 squared

5. Press 'CLEAR OPS'
6. Single shot, program stops on (1 28-15) with 1625 in the OS

1625

7. To repeat the program, 'CLEAR OPS' and return to step 2.

7.2.2 Fourth powers, cubes and squares of numbers up to 255.

Donald Davies' program 3. Same principle as the previous program.

To run the program:
1. Load PROG03DD.CRD. The program stops on {1 28-20}
2. Single Shot (press 'ONE SHOT'), program stops on (1 26-28) with 2554 in the OS.

255 fourth

3. Press 'CLEAR OPS'.
4. Single Shot, program stops on (1 15-28) with 2553 in the OS

255 cubed

5. Press 'CLEAR OPS'.
6. Single Shot, program stops on (1 20-28) with 2552 in the OS

255 squared

7. Press 'CLEAR OPS'.
8. Single Shot, program stops on (1 28-20) with 255 in the OS

255

9. To repeat the program, 'CLEAR OPS' and return to step 2.

7.2.3 Smallest factor using double speed division.

Donald Davies' program 9, available as PROG09DD.CRD. Similar comments apply as for PROG07DD ('Smallest Factor' Version 1).

7.2.4 All Factors saved in DL 10.

Donald Davies' program 12. He says "An interesting further development [of the smallest factor program] takes any number less than 232 and finds all its factors, which it places in the words of DL10 [the smallest factor furthest down the list]. It also treats even numbers. Where there are small factors it may give 1 as the smallest factor." [DD2]

This program is implemented in PROG12DD.CRD. To run the program:

1. Load PROG12DD.CRD. Program stops on {1 0-21 1}
2. Enter a number in backwards binary in the ID
3. Single shot.

"Using 231 = 21474 83648 will fill the delay line with 31 twos and a one."[DD2] "A quirk in the program gives the last factor at the top of the list as 1 if the largest factor occurs more than once. Since the program has only one spare word in the delay line this cannot be corrected in a one DL program." [DD1]

"A good example is 2230 92870 = 23 x 19 x 17 x 13 x 11 x 7 x 5 x 3 x 2. " [DD1] for which the backwards binary is {01100 00100 00010 00011 00101 01100 00}.

factors in dl10

factors in dl10

7.2.5 Cubes in DL10.

Donald Davies' program 13: List cubes of numbers to 1625 in DL10. This is a variant of his program 2. It calculates squares and cubes of the numbers from 1 to 1625 and places the cubes in DL 10, using the rotation so that the last result, 16253 is in word 0 while (1625-31)3 is in word 31.

cubes in dl10

To run the program:
1. Load PROG14DD.CRD. The program stops on {1 0-21 1}
2. Align the scope to DL 10.
3. Single shot (press One Shot). The scope fills with the calculated 6th powers.
4. Single shot clears DL 10 and repeats step 3.

7.2.6 Table of sin(x) in DL9.

Donald Davies' program 15: "Table of sin(x) to pi/2 in steps of pi/60. Using the power series up to x15, this program calculates 31 values of sin(x) and stores them as the integers 231sin(x) in drum track 125 (ie, 7,13), with sin(0) in word 31 at the bottom and sin(pi/2) in word 1 near the top. The results can be seen also in DL9. These are calculated as binary fractions with the binary point [between P31 and P32]." [DD1].

To run the program:
1. Load PROG15DD.CRD. The program stops on {2 28-9}
2. Align the scope to DL 9.
3. Single shot (press 'One Shot'). The scope fills with the calculated values of sin(x).
4. Single shot clears DL 10 and repeats step 3.

Davies' code would not have worked on the Pilot ACE as it stands, because insufficient cycles are allowed for multiplication to finish before the multiplier stores are altered. Also one of the {0-19} instructions starts in an even mc instead of an odd mc. I have inserted dummy instructions to ensure that 65 mc always elapses before the multiplier is disturbed, for example:

replacing  {116 1  0-19   0 0}   by  {116 2  0-19    3  2}
           {118 1 14-15   1 1}       {220 1 15-15 1 29 28}
                                     {118 1 14-15    1  1}

The extra instruction here wastes about 90 mc. I haven't attempted to optimise the extra code.

values of sin(x)

7.2.7 Table of cos(x) on Drum.

Donald Davies' program 17 generates a "Table of cos(x) to pi/2 in steps of pi/60. Using the power series up to x14, calculates 31 values of cos(x) and stores these as the integers 231cos(x) in drum track 126 (ie. 7,14), with cos(0) in word 31 and cos(pi/2) in word 1." [DD1].

The program is implemented as PROG17DD.CRD and the comments about the coding in Section 7.2.6 apply here also.

values of cos(x)

7.2.8 Three Programs Not Implemented.

Donald Davies' Program 18 - "Table of sin2(x) + cos2(x) as a check". "Using the values of sin(x) and cos(x) stored in tracks 125 and 126, this program sums their squares and places the results in track 127. This checks the sin and cos routines." [DD1]

Program 18 will not work on this emulator (or on Pilot ACE) because the two drum tracks are not synchronised by the two programs after their Initial Input.

Donald Davies' Program 10 "It is convenient in this simulation to write and test a program in the delay lines and transfer it to the drum for storage. To load the program by initial input, it has to be split between three cards with the initial input program at its head. I have written a program which will convert one delay line full of program into three card images." [DD1] and Donald Davies' Program 11 "Copying a set of cards " are relevant only to his emulator and not meaningfull Pilot ACE programs.

8. Subroutines

8.1 Use of Subroutines

Noting that 'tables' or 'tables of instructions' are what we now call 'programs' ...

"The coding of a large problem is considerably simplified by the use of standard tables of instructions which have been coded previously. Such tables of instructions are known as subroutines and it is important that they should be organised in such a manner that their incorporation is as simple as possible.

"When a subroutine is used at several different points in the main table, one copy only is employed and arrangements are made by means of which the main table enters and obeys the subroutine instructions when required, but before doing so, it takes steps to ensure that when the subroutine is completed the machine returns to the appropriate place in the main table. The main table does this by planting an instruction called the LINK into a fixed position for each subroutine. The LINK instruction is obeyed on completion of the subroutine, and ensures returning to the correct place in the main table.

"A subroutine may itself make use of further subroutines. A subroutine which makes use of no subroutines is called a subroutine of first order. A subroutine which makes use of subroutines of the first order only is called a subroutine of the second order. In this way subroutines of any order may be defined. The link instructions of all first order subroutines are planted in 130 and in general the link instructions of all subroutines of order n are placed in 129+n.

"The main table plants a link in a TS and the subroutine itself plants that link in 129+n." [WJ51B #18]

8.2 Subroutine Library

Initially, subroutines were numbered in an ad hoc way. By the time 19 had been written, it became clear that a rational numbering system was needed, and the following directive was issued. The directive was not dated.

"The classification of the subroutines in the Library has been revised. The subroutines in each class will be numbered from 1 to 50. The library will also contain main routines numbered 51 upwards.

"The classes will be denoted by initial letters as follows:

   A  Floating arithmetic
   B  Complex numbers
   C  Checking
   D  Division
   E  Exponential
   F  General routines relating to functions (e.g. Interpolation)
   G  Differential equations
   H  High accuracy (e.g. Double length arithmetic)
   J  Special functions
   K  Power series
   L  Logarithms
   M  Multiplication
   P  Print or Punch, Output
   Q  Quadrature
   R  Read, Input
   S  nth root
   T  Trigonometrical functions
   V  Vectors, Matrices, Linear equations
   X  Demonstration programmes (Exposition)
   Z  Miscellaneous

"Existing subroutines D1, E1, M1, M2, M3, M4, M5, T1, V1 will retain their present numbers. The others will be renumbered:

   Old     New  
   D.D.1    H1
   D.M.1    H2
   D.S.1    H3
   D.Sq.1   H4
   F        A1
   P.D.1    P1
   R.D.1    R1
   R.D.2    R2
   S.1      K1
   Sq.R.1   S1 "

The original code for subroutines M1, M2, M3, M4, M5 and M9; F (i.e. A1); K1 (the old S1); H1 (was D.D.1); R1 (was R.D.1) and R2 (was R.D.2); P1 (was D.P.1) and V1 is preserved in the NPL archive at Wroughton and is reproduced below.

8.3 Multiplication

Multiplication in the Pilot ACE is initiated by the special destination D19. To multiply two numbers 'a' and 'b' together, 'a' must be in TS20, 'b' must be in DS141, DS140 must be zero and the transfer {x-19} must occur in an odd minor cycle. 'x' can have any value.

The multiplier is only partly automatic: it produces the product of two numbers that it regards as positive 32 bit integers. Corrections must be made to the product if 'a' and 'b' are signed numbers. This is the purpose of subroutines M1-M4 below.

8.3.1 Fast Signed Multiplication (Original subroutines M1, M2, M3, M4).

The four subroutines are for signed multiplication without shift or round off (M1), with shift but without round off (M2), with round off but without shift (M3) and with both shift and round off (M4). The flow chart for M4 is effectively that shown in [WJ51B #22].

As the code is quite short - at most 14 instructions (M4) - versions of the subroutines were provided for both the lower end and higher end of each delay line. They are provided here for just DL2.

The versions are very early as the documention mentions TS11. The specifications are as follows:

Data a, b, n (1 ≤ n ≤ 16).

Result c = 2n.a.b (double length or rounded off single length. If single length, c = 2n-32.a.b to the nearest integer is in the odd m.c. of DS14).

Temporary stores used

         entry  exit
 T.S.11
 T.S.15
 T.S.16   Link   X
 T.S.20     a    a
 T.S.26     b    b
 T.S.27
 D.S.12
 D.S.14          c
 T.C.A     off  off
 T.C.B     off  off

M.1. No round off, no shift (i.e. n=0)
  available in m.c.s 0-11 (low) or 20-31 (high)
  entry in m.c.3 (low) or m.c.20 (high)

M.2. Round off, no shift (i.e. n=0)
  available in m.c.s 0-12 (low) or 18-30 (high)
  entry in m.c.2 (low) or m.c.18 (high)

M.3. No round off, with shift
  available in m.c.s 0-13 (low) or 18-31 (high)
  entry in m.c.2 (low) or m.c.18 (high)
  shift parameter, wait number in m.c.12 (low) or m.c.28 (high) must be
   32-n (1 ≤ n ≤ 16) (low) or
   30-n (1 ≤ n ≤ 15) or 30 (n=16) (high)

M.4. Round off, with shift
  available in m.c.s 0-13 (low) or 18-31 (high)
  entry in m.c.2 (low) or m.c.18 (high)
  shift parameter, wait number in m.c.12 (low) or m.c.28 (high) must be
   32-n (1 ≤ n ≤ 16) (low) or
   30-n (1 ≤ n ≤ 15) or 30 (n=16) (high)

8.3.2 Double Length Multiplication (Original subroutine M09)

A second order subroutine, using subroutine M5 (described below). It seems to have started life as subroutine H2, then become this subroutine M9 (after TS11 had become DL11), then later still to have been recoded as subroutine M11. The specification is as follows:

Data a1, a2; b1, b2; q (0 ≤ q ≤ 32).

Result 232c1 + c2 = 2q-64(232a1 + a2)(232b1 + b2).

Temporary stores used

         entry  exit
 T.S.15          X
 T.S.16   Link   X
 T.S.20          b1
 T.S.26          X
 T.S.27          X
 D.S.120   a2    a2
 D.S.121   a1    a1
 D.S.140   b2    c2
 D.S.141   b1    c1

Entry 229

Time 21 m.s.

Parameters                 q=0   0≤q≤16   17≤q≤32

Dest. no. in m.c. 316,18     14     13       13
Dest. no. in m.c. 317,19     14     14       13
Wait  no. in m.c. 316,18      0    32-2q      0
Wait  no. in m.c. 317         0      0      41-2q (mod 32)
Wait  no. in m.c. 319         0      0      45-2q (mod 32)

Subroutine M5 is a first order subroutine performing unsigned multiplication and used in M9. Given a and b, the result is c = a*b. Entry is in m.c. 225. It uses the temporary stores
           entry       exit
 T.S.20       a          a
 T.S.27       b          b
 D.S.14  Link (even)     c

and the flow chart is

  225 27-14 (o)
  228 14-130
  230 28-14 (e)
  2 0  0-19 (o)
  130 (mult. is not yet completed)

8.4 Division

8.4.1 Non-restoring division (version 1).

In [WJ51B #9] Wilkinson presents code for performing division on the Pilot ACE, "Given two [single length] binary numbers, a and b, both less than unity, and such that |a|<|b|, to calculate a/b with the same round-off rule as before" [i.e. "that the least significant digit is to be 1 in all cases"]. "All numbers are to have the binary point between P31 and P32." A typo in the report suggests 'b' should be in TS27 but it should be in TS26.

PROGJW04.CRD contains the subroutine in DL2, called from a trivial main program in DL1. The subroutine expects to find 'a' in TS16, 'b' in TS26 and a link address in TS27. Entry is in m.c.14. It leaves the result in DS141.

To run the program:
1. Load PROGJW04.CRD. The program stops on {1 0-16}
2. Enter number 'a' in backwards binary in the ID
3. Single shot. The program stops on {1 0-26}
4. Enter number 'b' in backwards binary in the ID
5. Single shot. The quotient a/b is displayed on the OS lights and the program stops on {1 0-16}
6. To make another calculation, press 'CLEAR OPS' and return to step 2.

If you set the monitor keys to 16 you can see the quotient building.

The routine contains no error tests - if |a|<|b| is not true, the routine will simply compute a garbage number.

8.4.2 Non-restoring division (version 2).

In [WJ55 275] Wilkinson presented revised code for performing division "specified as follows. Given a double length number 'a' in DS14 and a single length number 'b' in TS26 it produces the quotient c=a/b in TS16, the round-off rule being that the least significant digit in 'c' is to be 1."

In particular, the code contains tests to ensure the numbers are in range. Although it is not stated, one might assume the conditions for Version 1 apply, viz. all numbers are to have the binary point between P31 and P32, and |a|<|b|.

I have had some difficulty implementing this routine (see Note 10.2). A slightly modified version is included in the small program PROGJW01G.CRD. The subroutine, extended to plant a return link supplied in TS16, is in DL2 and a trivial main program is in DL1.

The subroutine expects to find 'a' in DS14, 'b' in TS26 and a link address in TS16. It leaves the result in TS16. The conditions for the program to run correctly are that

To run the program:

1. Load PROGJW01G.CRD. The program stops on {1 0-14 1}
2. Set 'a' (in backwards binary) in the ID and press 'One Shot'.
3. The program stops on {1 0-26} (with the 'a' in DS141)
4. Set 'b' (in backwards binary) in the ID and press 'One Shot'.
5. The computer will stop on {1 0-14 1} again, with the number 'c' in the OS
6. or it will stop on {1 29-29} indicating an input error.
7. If step 6, to try another division, clear OS and return to step 2.
8. If step 7, it is necessary to return to step 1.

For example, P30/P31 will give an error indication 29-29, while P30/(P1+P31) will give the result 1/3 (one third) on the OS lights.

8.4.3 Non-restoring division (extracting two digits per cycle).

"Wilkinson also gives a version with two steps per major cycle and this takes 18.4 milliseconds, even more remarkable." [DD2]

The code is in PROGJW02G.CRD. The comments in Section 8.4.2 apply here also.

8.4.4 Integer division.

This is the code from Donald Davies' Program 6, modified to make it a proper subroutine in DL 2. It is available as SUBINTDIV.CRD.

"I wanted an integer division program giving a quotient and remainder." [DD2] It "Divides the single length number in TS15 by the number in TS26, with the quotient in DS14 even and the remainder in DS14 odd. Uses ordinary restoring method, taking 32 steps, measured by shifting a bit in TS16. This was written to be used in the ‘smallest factor’ program. It takes 1056 minor cycles (33 major cycles) or 33.792 milliseconds." [DD1].

Data a, b, (a ≥ 0, b > 0).

Result c = a/b, c the integer quotient in 140 and r the integer remainder in 141.

Temporary stores used

         entry  exit
 T.S.15     a    a
 T.S.16          X
 T.S.20   Link   X
 T.S.26     b    b
 T.S.27
 D.S.12
 D.S.14          c (even), r (odd)

Entry in m.c.28

8.5 High accuracy (e.g. Double length arithmetic)

8.5.1 Double length signed division (H1).

This is the very early routine originally called D.D.1. and later renamed H1. The documention mentions TS11. The code (using DL 2, and with p=36) is provided as subH1-DL2.crd. The specification is as follows:

Data a, b, p (31 ≤ p ≤ 61).

a and b are double length. |a| ≤ 2 |b|

Result c = 2p.a/b to nearest odd integer. c is double length.

Temporary stores used

         entry  exit
 T.S.11
 T.S.15
 T.S.16   Link   X
 T.S.20
 T.S.26          X
 T.S.27          X
 D.S.12     b    c
 D.S.14     a    X
 T.C.A
 T.C.B     off  off

Available in m.c.s 0-30

Entry in m.c.27

Time p+6 m.s.

Parameters   P62-p in m.c. 0;   Pp-30 in m.c. 17

8.5.2 Double length multiplication (H2).

H2 was originally called D.M.1. Subroutine M9 implemented above "replaces H2 which is obsolete". We don't have the earlier D.D.2/H2 code.

8.6 Floating arithmetic

The option to use floating point numbers was provided on Pilot ACE by 'subroutine F', later renamed 'subroutine A1'. It contained entry points to allow addition, subtraction, multiplication and division of floating point numbers.

This is early code utilising TS11, before it became DL11. A later document shows that 1130 was used as a temporary replacement when the instruction code was changed. I have done this here, without re-optimising the code. The routine (using DL2, DL3 and DL4) is in subA1.crd.

I have made the following changes to the archived code, to correct typos and to replace TS11 with 1130:

    from                 to
20  {2 13-14   32 31 }   {3 13-14   32 31 }
229  P21                  P22
33  {3 11-17 s  0  1 }   {3 11-17 s 25  1 }
311  P21                  P22
318 {2 28-14    0  1 }   {2 28-14 s  0  1 }
323 {3 16-17    1 16 }   {3 16-17    0 16 }
325 {2 16-13 s  0  3 }   {2 26-13 s  0  3 }
46  {2 11-18 s  0 20 }   {2 11-18 s 22 20 }

What follows is basically a transcript of the archived document.

8.6.1 Floating Binary Point.

Each number 'a' in the standard form is represented by a pair a and b, the number corresponding to such a pair being x = a.2b

The number 'a' has its binary point between P30 and P31 and 'b' is an integer. 'a' and 'b' are each allocated one store position and satisfy the inequalities:

       1 > a ≥ 1/2

       -1 ≤ a < -1/2

       -232 ≤ b < 232 [a pencil correction says 31]

When a floating number in standard form is stored in a D.S. or a D.L., the number 'a' occupies an odd position and 'b' an even position.

The ranges are chosen so that the intermediate values produced when two numbers are added, subtracted, multiplied or divided (i.e. before the result is restored to standard form) can have their sign correctly identified. Note that the number which is {-2b.a} will not necessarily correspond to the pair (-a,b) because this pair will not necessarily be in standard form (e.g. when a is -1 or ?). The number zero is treated as a special case and is represented by the pair 0 and b for any value of b.

All the basic operations and a table called 'Prepare in Floating Form' (F.P.) are given. This last table is used at the end of all the floating arithmetic operations to restore the intermediate results to standard form. The five tables which comprise 'floating arithmetic' are taken in one block, available in m.c.s DL20-31, 30-31, 41-9 and 419-31.

8.6.2 Prepare in Floating Form.

First order subroutine. Available as part of the floating routine.

Data a, b. a is double length, with binary point between odd P30 and odd P31. b is an integer.

Result Corresponding 'floating number' in standard form, i.e. a1, b1.

Temporary stores used

         entry   exit
 T.S.11
 T.S.15   Link   zero
 T.S.16     b     b1
 T.S.20
 T.S.26          2a1 + 0 or 2-30
 T.S.27          4a1 + 0, 2-30, 2-29 or 3 x 2-30
 D.S.12
 D.S.14     a     a1 in odd
 T.C.A
 T.C.B     off   off

Entry
 F.P.1   228
 F.P.2   230

Time (n+3) m.s. where n is the number of positions by which x, the contents of D.S.14, has to be shifted to bring it within the range -2 ≤ x < -1 or 2 > x ≥ 1.

8.6.3 Floating Addition and Subtraction.

First order subroutine. Available as part of the floating routine.

Data a1, b1; a2, b2 corresponding to x and y in standard floating form.

Result a3, b3 corresponding to x+y in standard floating form.

Temporary stores used

          entry     exit
 T.S.11
 T.S.15   Link      zero
 T.S.16             b3
 T.S.20
 T.S.26     a1      2a3 + etc
 T.S.27     b1      4a3 + etc
 D.S.12  b2 even    b2
         a2 odd     a2
 D.S.14             a3 odd X even
 T.C.A
 T.C.B     off      off

Entry
 addition      222
 subtraction   214

Time less than (n+8) m.s. where n is the number of positions by which x, the contents of D.S.14, has to be shifted to bring it within the range -2 ≤ x < -1 or 2 > x ≥ 1.

8.6.4 Floating Multiplication.

First order subroutine. Available as part of the floating routine.

Data a1,b1; a2,b2 corresponding to x and y. The a1 and a2 need not be moved up to the correct positions but are treated as though b.p. were between P30 and P31.

Result a3,b3 corresponding to x.y in standard floating form.

Temporary stores used

          entry     exit
 T.S.11     b2       b2
 T.S.15   Link      zero
 T.S.16              b3
 T.S.20     a2       a2
 T.S.26     a1      2a3 + etc
 T.S.27     b1      4a3 + etc
 D.S.12
 D.S.14              a3 odd X even
 T.C.A     off      off
 T.C.B     off      off

Entry 314

Time (n+6) m.s. where n is the number of positions by which x, the contents of D.S.14, has to be shifted to bring it within the range -2 ≤ x < -1 or 2 > x ≥ 1.

8.6.5 Floating Division.

First order subroutine. Available as part of the floating routine.

Data a1,b1; a2,b2 corresponding to numbers x and y in standard floating form.

Result a3,b3 corresponding to y/x in standard floating form.

Temporary stores used

          entry     exit
 T.S.11     b1       b1
 T.S.15   Link      zero
 T.S.16     a2       b3
 T.S.20     b2       b2
 T.S.26     a1      2a3 + etc
 T.S.27             4a3 + etc
 D.S.12
 D.S.14              a3 odd X even
 T.C.A     off      off
 T.C.B     off      off

Entry 420

Time  34 m.s.

8.7 Read, Card Input

PilotACE data card

Quite a few read routines are mentioned in a Wroughton document dated 1st April 1954 (hopefully not an April Fool's joke). They include subroutines to read one number per card (R1, R2, R3, R6 and R9), two numbers per card (R8), three numbers per card (R4, R5, R11, R12 and R13) and four numbers per card (R7 and R14). R10 read decimal numbers in floating form and stored them in floating binary form.

The code for only R1 and R2 survives. These subroutines are reproduced below.

8.7.1 Subroutine R1, Read Decimal Number.

First order subroutine. R1 was originally called R.D.1. It is early code written before TS11 became DL11.

Data a = decimal integer on card, m (1 ≤ m ≤ 9)

Card 1st col: sign (Y positive, X negative)
Card 2nd - (m+1)th cols: m decimal digits.

Result Card read and 'a' converted to binary form. Failure indication if card is not decimally punched.

Temporary stores used

          entry     exit
 T.S.11
 T.S.15
 T.S.16    Link      a
 T.S.20              X
 T.S.26              X
 T.S.27              X
 D.S.12
 D.S.14              X
 T.C.A     off      off
 T.C.B     off      off

Available in m.c.s 0-25.

Entry in m.c. 25.

Parameters,
    P2 - Pm+2 in m.c. 13
    23+m wait no. in m.c. 24 (0 if m=9)

Notes Subroutine R1 is available as subR1-DL3-m9.CRD. It has P2...P11 in m.c. 13; wait number 0 in m.c. 26 and will need amending for other values of m.

This code works fine when the data cards are punched correctly. The code provides for a 'failure indication': if it detects that one of the m digits is double punched or left blank, it jumps to instruction m.c.20, in which the user can insert his own warning instruction. (I have used 7-7 X as the warning.)

If any other columns are punched, the results are indeterminate. A pencil note mentions: "But goes into closed loop if for any row of a card the column m+2 is punched and no later column is punched." For example, with m=9, if column 11 is also punched as zero, the routine enters an infinite loop. If columns 11 and 12 are also punched zero, the routine gives an erroneous answer without warning.

8.7.2 Subroutine R2, Read Decimal Number.

First order subroutine. R2 was originally called R.D.2. It is early code written before TS11 became DL11.

Data a = decimal integer on card, m, n. (1 ≤ m ≤ 9), (n ≥ 2), (m + n) ≤ 33.

Card (n-1)th col: sign (Y positive, X negative)
Card (n)th - (m+n-1)th cols: m decimal digits.

Result Card read and 'a' converted to binary form. Failure indication if card is not decimally punched.

Temporary stores used

          entry     exit
 T.S.11
 T.S.15
 T.S.16    Link      a
 T.S.20              X
 T.S.26              X
 T.S.27              X
 D.S.12
 D.S.14              X
 T.C.A     off      off
 T.C.B     off      off

Available in m.c.s 0-26.

Entry in m.c. 19.

Parameters,
    P1 ... Pm+1 in m.c. 13
    34-n wait no. in m.c. 16
    22+m wait no. in m.c. 26

Notes Subroutine R2 is available as subR2-DL3-m9n12.CRD. It has P1...P10 in m.c. 13; wait number 22 in m.c. 16; wait number 31 in m.c. 26. The comments for subroutine R1 regarding mis-punching apply to this subroutine also.

8.8 Output, punched cards

A document dated 19th May 1954, in the archive at Wroughton, mentions several 'Punch Programs'. They include routines to punch one number per card (P1, P6, P7 and P8), two per card (P2), three per card (P3), four per card (P4 and P5) and eight per card (unsigned) (P11).

Only the code for P1 is preserved in the archive.

8.8.1 Subroutine P01, Punch Decimal Number

First order subroutine. P1 was originally called D.P.1. It is early code written before TS11 became DL11.

Data a (to n binary places), m. |a|<10, 16 ≤ n ≤ 31

Result 'a' converted to decimal form and punched on a card.

Card 1st col: sign (Y positive, X negative)
Card 2nd - (m+1)th col: m decimal digits.

The decimal point lies between the 2nd and 3rd columns.

Temporary stores used

          entry     exit
 T.S.11
 T.S.15
 T.S.16    Link      X
 T.S.20              X
 T.S.26     a        X
 T.S.27              X
 D.S.12              X
 D.S.14              X
 T.C.A     off      off
 T.C.B     off      off

Available in m.c.s 0-29.

Entry in m.c. 25.

Parameters,
    2n-32 wait no. in m.c. 20
    Pm+2 in m.c. 23
    ½.10-(m-1) (32 b.p.) in m.c. 26

For the record, the values to use in m.c. 26 are,
m= 2; 0.100000000, {10110 01100 11001 10011 00110 01100 00}
m= 3; 0.010000000, {10101 00001 11010 11110 00101 00000 00}
m= 4; 0.001000000, {11011 00100 10001 10000 01000 00000 00}
m= 5; 0.000100000, {10111 01101 10001 01100 00000 00000 00}
m= 6; 0.000010000, {11000 11111 00101 00000 00000 00000 00}
m= 7; 0.000001000, {11000 11000 01000 00000 00000 00000 00}
m= 8; 0.000000100, {11101 01100 00000 00000 00000 00000 00}
m= 9; 0.000000010, {10101 00000 00000 00000 00000 00000 00}
m=10; 0.000000001, {11000 00000 00000 00000 00000 00000 00}

8.9 Power series

It is often necessary to calculate the value of a function. A good way to do this can be by using a power series of the form

 a0 + a1x + a2x2 + ... + anxn + ...

that represents the function, for example:

 ex = 1 + x + x2/2! + ... (all x)

 log(1+x) = x - x2/2 + x3/3 - ... (-1 < x ≤ 1)

 sin(x) = x - x3/3! + x5/5! - ... (all x)

 cos(x) = 1 - x2/2! + x4/4! - ... (all x)

These series converge too slowly to be useful and a good deal of effort was made in the 1950's to determine more efficient approximations, requiring as little storage and as few arithmetic operations as possible for a given accuracy. Hastings [HAS55] provides a selection.

8.9.1 Subroutine K1, Summation of Series.

Subroutine K1 facilitated the calculation of a function value using a power series approximation. The code is provided in 'subK1-DL2.crd'. Its specification was as follows: 2nd order subroutine, using subroutine M4 in m.c.s 0-13.

Data a0, a1, a2 ... an-1, x, A, m, n, r.

  1 ≤ n ≤ 32
  |x| ≤ 1, x has r binary places, 16 ≤ r ≤ 31

Result c = a0 + a1x + a2x2 + ... + an-1xn-1.

Temporary stores used

          entry     exit
 T.S.11
 T.S.15
 T.S.16   Link      c
 T.S.20     x       x
 T.S.26             X
 T.S.27             X
 D.S.12
 D.S.14             X
 T.C.A     off      off
 T.C.B     off      off

 D.L.Am     a0       a0
 D.L.Am+1   a1       a1
 etc ...

Entry in m.c. 29

Time 7n - 3 m.s.

Parameters

  2r-32   wait number in m.c. 12 (in M4)
  A       source number in m.c. 23
  m       wait number in m.c. 23
  n.P17   in m.c. 22

8.9.2 Using K1 to calculate ln(1+x), (0 ≤ X ≤ 1).

Hastings [HAS55 p.180] gives an approximation for ln(1+x) using the following values of ai and having a maximum error of about 0.0000 0003.

 a0 = 0
 a1 = 0.9999 9642 39
 a2 =-0.4998 7412 38
 a3 = 0.3317 9902 58
 a4 =-0.2407 3380 84
 a5 = 0.1676 5407 11
 a6 =-0.0953 2938 97
 a7 = 0.0360 8849 37
 a8 =-0.0064 5354 42

Program 'progK1-LN' uses K1 to calculate ln(1+x) with these coefficients. Note that this is not an original NPL program or choice of ai. To run the program:

1. Load the program cards progK1-LN.crd.
2. The program stops with (1 0-20) on the IS lights
3. Enter a value of x on the ID lights.
4. Press 'ONE SHOT'. The computer calculates ln(1+x) and puts it on the OS lights.
5. To make another calculation, press 'CLEAR OPS', press 'CLEAR ID' and go to step 3.

Example: the calculation of ln(1.39) (on the OS lights, with 0.39 to 31 binary places on the ID lights). The value of 0.3293 03779 compares with the 'correct' value (calculated with a modern CASIO FX-702P calculator) of 0.3293 03747, an error of about 0.0000 0003.

calculation of ln(1.39))

8.10 Square Root.

In [WJ51B #9] Wilkinson explains a procedure to determine the square root of a number. "Given a binary number less than unity, with its binary point between P31 and P32, to extract its square root as a number in the same form, using the round off rule that the least significant digit is to be 1 in all cases."

Wilkinson gives just the flow chart so I have coded it to fit into half a delay line, rows 0-15. To make it a complete subroutine, I have added an instruction to plant a return link provided in TS27.

PROGJW03.CRD contains the subroutine in DL2, called from a trivial main program in DL1. The subroutine expects to find 'a' in TS16 and a link address in TS27. It leaves the result in TS27.

To run the program:

1. Load PROGJW03.CRD. The program stops on {1 0-16 1}.
2. Enter a number (in backwards binary) in the ID.
3. Single shot (press One Shot). The square root is displayed on the OS.
4. To find another square root, clear the OS and ID and repeat step 2.

Example, square root of one third (in ID) is 0.577350268 (in OS):

sqroot of third)

9. References.

9.1 Pilot ACE.

Information about Pilot ACE is limited to the following few documents, and even these tend to repeat the same basic information.

[DD1] Davies, D. W., ACE Pilot Model Simulation Program, August 1999.

[DD2] Davies, D. W., How to Demonstrate the ACE Pilot Model Simulation, November 1999.

[CJ05] Copeland (ed.), B. Jack (2005). "Alan Turing's Automatic Computing Engine". Oxford: Oxford University Press. ISBN 0-19-856593-3. OCLC 56539230 224640979 56539230.

[WJ51A] "Logical Design of the Pilot Model", J Wilkinson, September 1951. Available from http://www.alanturing.net/turing_archive/archive/l/l22/L22-001.html

[WJ51B] "Programming and Coding the Pilot Model", J Wilkinson, November 1951. (Report Ma. 22/1024)? Available from http://www.alanturing.net/turing_archive/archive/l/l13/L13-001.html

[WJ53] "The Pilot ACE", J. H. Wilkinson, Chapter 11 (page 193ff) of "Computer Structures: Readings and Examples", C. Gordon Bell, McGraw-Hill Book Company

[WJ54] "Appendix to 22/1024", J Wilkinson, 1 March 1954. Available from http://www.alanturing.net/turing_archive/archive/l/l11/L11-001.html

[WJ55] Wilkinson, J. H., "An assessment of the system of optimum coding used on the pilot automatic computing engine at the National Physical Laboratory." Proc.Roy.Soc. Volume A 248, pp.253-281, 1955.

[WJ05] Wilkinson, J. H., "The Pilot ACE at the National Physical Laboratory", Chapter 4 in [CJ05]

[MC81] Campbell-Kelly, Martin. "Programming the Pilot ACE: Early programming activity at the National Physical Laboratory.", Annals of the History of Computing Volume 3, No.2, pp.133-162, 1981.

[NPL82a] The Pilot Ace (Part One) http://www.youtube.com/watch?v=nup6S7BQMPc (Recollections of the early development work carried out by the team at N.P.L. on the construction of the Pilot ACE computer. This N.P.L. film is told by Dr J Wilkinson and Mr M Woodger, in 1982 by two members of the team. NPLdigital Sep 3, 2008)

[NPL82b] The Pilot Ace (Part Two) http://www.youtube.com/watch?v=1qKWuvcTdLg

9.2 DEUCE.

The following documents explaining how to use DEUCE are available on the Internet:

[BA57A] "Standard Operating Instructions for DEUCE", Report NS y 78, Birchmore Miss A., 21 November 1957.
at http://www.deucecomputer.com/mud19.pdf
or http://members.iinet.net.au/~dgreen/deuce/extract.html#mud19.

[BA57B] "DEUCE Control Panel Manual", Report NS y 79, Birchmore Miss A., 21 November 1957.
at http://members.iinet.net.au/~dgreen/deuce/mud21.html.

[EE56A] "English Electric DEUCE Programming Manual", Report NS-y-16, May 1956.
at http://users.tpg.com.au/eedeuce/navigation.html.

"English Electric DEUCE Logical Design Manual Part 1 - General Description",
at http://users.tpg.com.au/eedeuce/navigation.html.

"English Electric DEUCE Logical Design Manual Part 2 - Drawings",
at http://users.tpg.com.au/eedeuce/navigation.html.

[EE59] "A Programming Handbook for the Computer Deuce", Burnett-Hall D.G. and P.A.Samet, Tech.Note MS.38, April 1959, RAE Farnborough,
at http://www.deucecomputer.com/RAE-PMan.pdf.

9.3 General.

[HAS55] Cecil Hastings, Jr. "Approximations for Digital Computers", Princeton University Press, Princeton, N.J., 1955.

9.4 Sources.

9.4.1 The NPL Archive in the Science Museum Library.

The Science Museum Library & Archives, at Wroughton in Wiltshire (http://www.sciencemuseum.org.uk/wroughton/), contains the "NPL archive". This is a collection of documents "left [by Mike Woodger] in Room 113, Bldg 93, NPL, Teddington on his retirement on 31 March 1983". The very extensive collection includes a small group of documents relating to Pilot ACE, especially the source code and flow charts for several early subroutines (see Section 8.2).

9.4.2 AlanTuring.net.

The Turing Archive for the History of Computing (http://www.alanturing.net/) is the "Largest web collection of digital facsimiles of original documents by Turing and other pioneers of computing. Plus articles about Turing and his work, including Artificial Intelligence."

It contains many documents relating to the Automatic Computing Engine (ACE) and in particular, several descriptions of the Pilot ACE.

9.4.3 Donald Davies simulator.

Donald Davies wrote a "Pilot ACE Simulaton Program" in about mid-1999 (the documentation is dated August-November 1999). Importantly, he included the source code of 18 test programs in the documentation. I have implemented 15 of these programs.

For more about Donald Davies simulator, see Note 10.3.

Return to Contents

10. Notes.

10.1 The Initial Card.

"The machine is started by operating a switch which clears all the registers and artificially operates the read feed." [WJ51B 33]

On DEUCE, "When the Initial Input key is pressed the memory store is cleared, i.e. every word is zero. For some reason connected with the circuitry TSCOUNT is not completely cleared; instead the word {0, 0-0, 0, W, T, X} is left in it." [**EE59 87]

There is no record of whether the English Electric engineers introduced this 'error' with their circuit changes or if it was already present in the Pilot ACE. Quite possibly it was in the Pilot ACE, because it would not have caused a problem.

An Initial Card is needed because there is no reason to call any particular minor cycle m.c.0. When the Initial Input key is pressed the computer is able to align with the start of a word, but that word may be an even or an odd m.c. The machine can always distinguish between even and odd because of the structure of DS14. The delay lines need to be in sync with DS14.

The initial card has this content:

rowY    {0  0-23    0  0 X}
rowX    {0  0- 0    0  0 X}
row0    {0 29-14    0  1 X}
row1    {0  0- 0    0  0 X}
row2    {0 25-13    0  0 X}
row3    {0  0- 0    0  0 X}
row4    {0 14-25    0  1 X}
row5    {0  0- 0    0  0 X}
row6    {0  0-21    0  1 X}
row7    {0  0- 0    0  0 X}
row8    {0 28-14    0  2 X}
row9    {0  0- 0    0  0 X}

Assume the worst case: after initial input, TSCOUNT contains {0 0-0 W T X}

  • When rowY is ready, it sends a single shot that allows the instruction to proceed. Suppose this occurs at minor cycle m. The computer waits until m.c. m+W+2, then sends rowY to TSCOUNT for each m.c. until m.c. m+T+2, then stops with TSCOUNT containing {0 0-23 0 0 X}

  • When rowX is ready, it sends a single shot and in m.c. m+T+4 TCB is turned OFF (0-23), and the next instruction is taken from DL0 (which is DL11), that is, DL11(m+T+4) is selected as the next instruction. TSCOUNT becomes {0 0-0 0 0 X} because DL11 was set to zero by the initial input key.

  • When row0 is ready, {0 29-14 0 1 X} is read into TSCOUNT in m.c. m+T+6

  • When row1 is ready, all ones are sent to DS14(0) and DS14(1) by (29-14) and the next instruction is DL11(m+T+9), i.e. {0 0-0 0 0 X} is sent to TSCOUNT in m.c. m+T+9

  • When row2 is ready, {0 25-13 0 0 X} is read into TSCOUNT in m.c. m+T+11

  • When row3 is ready, P1 is added to DS14 during the one m.c. m+T+13 and the next instruction is DL11(m+T+13), i.e. {0 0-0 0 0 X} is sent to TSCOUNT

      If P1 is added to DS14(1), DS14(1) will become zero and there will be a carry of 1, which will be lost. So DS14(0) will remain equal to -1. Thus DS14 is non-zero if m+T+13 is odd.

      If P1 is added to DS14(0), DS14(0) will become zero and there will be a carry of 1. The nature of double length arithmetic using DS14 is that a single length transfer to DS13(0) will automatically extend the carry to DS14(1). Thus the carried 1 will be added to DS14(1), setting DS14(1) equal to zero also. Thus DS14 is zero if m+T+13 is even.

  • When row4 is ready, {0 14-25 0 1 X} is read into TSCOUNT in m.c. m+T+15

  • When row5 is ready, DS14 is tested to see if both DS14(0) and DS14(1) are zero. If so, the next instruction is DL11(m+T+18), which is odd, and {0 0-0 0 0 X} is sent to TSCOUNT in m.c. m+T+18. Set n=m+T+18. n is odd.

      If DS14 is non-zero, the next instruction is DL11(m+T+19), which is odd, and {0 0-0 0 0 X} is sent to TSCOUNT in m.c. m+T+19. Set n=m+T+19. n is odd.

  • When row6 is ready, {0 0-21 0 1 X} is read into TSCOUNT in m.c. n+2

  • When row7 is ready, TCB is turned OFF and the next instruction is DL11(n+5), i.e. {0 0-0 0 0 X} is sent to TSCOUNT in m.c. n+5.

  • When row8 is ready, {0 28-14 0 2 X} is read into TSCOUNT in m.c.n+7

  • When row9 is ready, DS14 is cleared by (28-14) and the next instruction is DL11(n+11), i.e. {0 0-0 0 0 X} is sent to TSCOUNT in m.c. n+11. As n was odd, this instruction is even. It is convenient to regard it as m.c.0.

    The machine is now in a standard condition to read the remaining cards - TCA and TCB are OFF, {0 0-0 0 0 X} is in TSCOUNT and m.c.0 is even.

    However, m.c.0 may not be aligned with the top of the scope. This can be fixed by means of the M.C.SLIP key.

    P35 is also present on row9, and this stimulates the reader to read another card.

    Return to Contents

    10.2 Wilkinson's 1955 non-recurring Division Code.

    I hesitate to question a central example in a refereed paper by an emminent mathematician like Wilkinson. However, I cannot get his code to work correctly as it stands.

    For example, P30/(P29+P30) = (1/4)/(3/8) = 2/3 causes a 29-29 error, despite having |a|<|b|

    It seems that we should conform to |a|<|b/2|

    But then P30/(P30+P31) = (1/4)/(3/4) = 1/3 is calculated as 2/3.

    Wilkinson says "As is the case with many of the most fundamental subroutines, a very sophisticated use of the code is made." [WJ55 274] So I may well be missing something. Work in progress!

    Wilkinson's original code is included in program PROGJW01.CRD. The subroutine, extended to plant a return link supplied in TS16, is in DL2 and a trivial main program is in DL1. To run it, proceed as in Section 8.2.2

    Return to Contents.

    10.3 Donald Davies' "Pilot ACE Simulaton Program".

    I can no longer find a reference to the simulator on the Web so I have provided a mirror here.

    "The simulation is programmed in Visual Basic, Version 1, which is no longer available as a product, but the program can be copied and distributed together with enough software to run it in a Windows environment. It should be easy to adapt it for a current Visual Basic system."

    Davies simulator screen shot

    He notes several "deficiencies of the simulation":

    "1) The multiplier. Used in the correct way, the multiplier of the simulation gives the correct result but the time it occupies is ignored. A strict simulation would allow the programmer to interfere with its operation by accessing DS14, though this was very rarely used. The ability to run programs in parallel with the multiplier makes it quite difficult to include the multiplier’s effect on total time. It could simply occupy 2 major cycles as a rough estimate, but this would misrepresent the parallelism. In the simulation, a check is made that TCB is off and DS14 even is cleared, though the real machine did not do this, it would simply make errors.

    2) The drum. No attempt is made to account for the delay imposed for head shifting and the 9 ms taken by transfers. This could be done if the time allowed for head shifts was known as well as the precise nature of the interlock (what things the interlock prevents).

    (The simulation gives the elapsed time of the real machine accurately from the entry into a program to its completion if the multiplier, drum or cards are not used within the program.)

    3) Strange instructions. The simulation has been tested with instructions such as are commonly found in programs. The example of TS20 when TCA=1 showed how easy it was to make a mistake which affected only a few kinds of instruction (in that case 20-10). It is possible that some unusual instructions exist which are not properly covered. No attempt was made to deal with ‘pathological’ use of instructions.

    4) Card reading and punching. The operator’s work of selecting and assembling a pack of cards for the reader cannot be simulated. In the simulation, the card images for input must be assembled in the files devoted to cards (numbers 128 to 383 in our scheme) and the number of the first card given in a text box. Punching produces card images with numbers in the range 256 to 383. This may overwrite existing ‘punched’ cards. Manual operations to copy sets of 32 words between delay lines and cards make useful card manipulations possible, but it is very different from the real thing.

    The T.I.L. source will work correctly only if it is tested after the stop instruction which reads or punches a card row. Outside the time of card operations it usually gives ones.

    5) Realism. Because a programmed display of all the store is necessarily very slow, the useful facility of looking at memory during running is lost. Only the output register can be seen during a run. Initial input does give a glimpse of progress, however.

    At present, Visual Basic makes it impossible to have a clean halt from a running program.

    The controls look nothing like the real machine. This could be remedied with extensive use of graphics, but not by me. Some Pilot model facilities such as stopping on partially specified instructions, are missing.

    The simulation has manual features not present in the real machine, such as loading words into delay lines and registers and transfers between delay lines and drum tracks or card images. Words cannot be seen in ‘backwards binary’ form but are available in hexadecimal, decimal and instruction format. In practice, program preparation, loading and testing and changes during testing are very easy with this simulation."

    10.4 A Java version of Donald Davies simulator.

    In 2001, two graduates - Shih-Yun (Athena) Huang and Nick Rugai - at the Department of Computer Science, University of San Francisco, CA. completed a Master's Project, PACES (Pilot Model Automatic Computing Engine Simulation).

    They updated Davies' simulator from Visual Basic to a Java application (and also a Java applet). While doing so, they "improved two functions from [the] VB simulator: (1) Run simulator in real pACE time. (2) Display all the delay lines". It seems there is no longer any reference to this project on the Web.

    Java simulator screen shot

    11. Some Fine Print - Permissions:

    Individuals are welcome to use this package without charge for their own private enjoyment. The only proviso is that if they give it to others they are asked to pass on the complete package.

    Organisations or individuals who wish to use the emulator for business purposes or in a fee paying environment should contact the Author to negotiate a royalty to share the benefits of the many hours invested in this project.

    12. More Fine Print - Disclaimer:

    The emulator is used entirely at the risk of the user. The Author has tried hard to eliminate faults from the programs but does not claim that the emulator is free of faults. No claims are made regarding its correctness, reliability or fitness for any particular purpose. The Author shall not be liable for errors contained herein or for incidental or consequential damages or loss of data resulting from the use of this program.

    ©2010-2011 David Richard Green. All rights reserved.
    dgreen@iinet.net.au