# Proposed Electronic Calculator/Chapter 6

​6. Outline of Logical Control.
A simple form of logical control would be a list of operations to be carried out in the order in which they are given. Such a scheme can be made to cover quite a number of jobs, e.g. calculations from explicit formulae, and has been used in more than one machine. However it lacks flexibility. We wish to be able to arrange that the sequence of orders can divide at various points, continuing in different ways according to the outcome of the calculations to date. We also wish to be able to arrange for the splitting up of operations into subsidiary operations. This should be done in such a way that once we have written down how an operation is to be done we can use it as a subsidiary to any other operation.
These requirements can largely be met by having the instructions on a form of erasible memory, such as the delay lines. This gives the machine the possibility of constructing its own orders; i.e. there is always the possibility of taking a particular minor cycle out of storage and treating it as an order to be carried out. This can be very powerful. Besides this we need to be able to take the instructions in an order different from their natural order if we are to have the flexibility we desire. This is sufficient.
It is convenient to divide the instructions into two types A and B. An instruction of type A requires the central arithmetic part CA to carry out certain operations. Such an instruction, translated from its symbolic form into English might run:-
Instruction 491. A. Multiply the content of TS 23 by the content of TS 24 and store the result in TS 25. Then proceed to carry out the next instruction (i.e. No.492).
Instructions of type merely specify the number of the next instruction.
Instruction 492. B. Proceed with instruction 301.
We must now explain in more detail how it comes about that we can branch the sequence of instructions and arrange for subsidiary operations. Let us take branching first. Suppose we wish to arrange that at a certain point instruction 33 will be applied if a certain digit is 0 but instruction 50 if it is 1. Then we may copy down these two instructions and then do a little calculation involving these two instructions and the digit D in question. One form the calculation can take is to pretend that the instructions were really numbers and calculate
D x Instruction 50 + (1-D) x Instruction 33.
The result may then be stored away, let us say in a box which is permanently labelled ‘Instruction 1’. We are then given an order of type B saying that instruction 1 is to be followed, and the result is that we carry out instruction 33 or 50 according to the value of D.
When we wish to start on a subsidiary operation we need only make a note of where we left off the major operation and then apply the first instruction of the subsidiary. When the subsidiary is over we look up the note and continue with the major operation. Each subsidiary operation can end with instructions for this recovery of the ​note. How is the burying and disinterring of the note to be done? There are of course many ways. One is to keep a list of these notes in one or more standard size delay lines (1024), with the most recent last. The position of the most recent of these will be kept in a fixed TS, and this reference will be modified every time a subsidiary is started or finished. The burying and disinterring processes are fairly elaborate, but there is fortunately no need to repeat the instructions involved each time, the burying being done through a standard instruction table BURY, and the disinterring by the table UNBURY.