# Proposed Electronic Calculator/Chapter 13

​13. Examples of Instruction Tables.
In this chapter a short account of the paper technique of using the machine will be given. I shall try to give some idea of what the instruction tables for a job will be like and how they are related to the job and to the machine. This account must necessarily be very incomplete and crude because the whole project as yet exists only in imagination.
​Each instruction will appear in a number of different forms, probably three or four.
Machine form.- When the instruction is expressed in full so as to be understood by the machine it will occupy one minor cycle. This we call machine form.
Permanent form.- The same instruction will appear in different machine forms in different jobs, on account of the renumbering technique as described in pp. 13,14. Each of these machine form instructions arises from the permanent form of the instruction. These permanent forms are on Hollerith cards and are kept in a sort of library.
Popular form.- Besides the cards we need some form of the table which can be easily read, i.e. is in the form of print on paper rather than punching. This will be the popular form of the table. It will be much more abbreviated than the machine form or the permanent form, at any rate as regards the descriptions of the CAO. The names of the instructions used will probably be the same as those in the permanent form.
In addition to these we must recognise the ‘general description’ of a table. This will contain a full description of the process carried out by the machine acting under orders from this table. It will tell us where the quantities or expressions to be operated on are to be stored before the operation begins, where the results are to be found when it is over and what is the relation between them. It will also tell us other important information of a rather dryer kind, such as the storages that must be left vacant before the operation begins, those that will get cleared or otherwise altered in the process, what checks will be made, and how various possible different outcomes of the process are to be distinguished. It is intended that when we are trying to understand a table all the information that is needed about the subsidiaries to it should be obtainable from their general descriptions.
The majority of actual instruction tables will consist almost entirely of the initiation of subsidiary operations and transfers of material. It should be recognised however that the time spent will be in quite different proportions. The three most time consuming operations are multiplication, waiting for material in long delay lines, and transfers of material. In some jobs the input and output of material may also be very time-consuming.
In order to give a fairly complete picture of what the tables are like I am giving examples of two tables, of which one is elementary and does not involve subsidiaries; the other is a more advanced table and consists largely of such orders. Besides these I have added a number of general descriptions of tables.
The fundamental table chosen is INDEXIN, used for finding a minor cycle whose position has been written down in a particular place.
In these tables DL m,n will denote the nth minor cycle of DL m.
INDEXIN (General Description). The minor cycle whose position is described in digits 17-32 of TS 27 is transferred to TS 28. The contents of TS 2,3,4,5,6,8,9,10 get altered in the process.
Now follows the popular form of the table.
INDEXIN
The first column gives the popular form of the name of the instruction, and the last column that of the next instruction to be followed. In most cases this could in theory be omitted because of the instructions being of type A. When the instructions are of type A the middle column describes them in abbreviated form. For instance TS 6 - TS 3 describes the operation of transferring the content of TS 6 into TS 3. Expressions of form Q, . . . mean an instruction of type Q, and the expression after the comma describes what is in columns 17-32. ADD ‘A’ is to mean ‘Add TS 2 into TS 4 cancelling the partial sums’, ROTATE 16 means ‘Rotate the content of TS 4, TS 5 forwards 16 places’, OR is a logical operation.
The expression B, 1, INDEXIN 11 is intended to stand for B in column 3, 1 in column 17 and INDEXIN 11 in columns 17-32.
Outline of operation (INDEXIN). From 1 to 10 we are constructing the instruction which tells us to make the appropriate transfer and putting that instruction into TS 6. The instruction B, 1, INDEXIN 11 requires us to carry out the instruction in TS 6. The new IN formed will be 0, INDEXIN 12 so that we then continue with instruction INDEXIN 12.
The table for INDEXIN is shown in full in Fig. 38.
We use the convention that no digit is shown if the value of the digit is not significant. Both 0 and 1 are shown if either value is possible, and significant.
DISCRIM (General Description). If TS 8 contains any digit 1 then TS 15 is passed into TS 24, otherwise TS 16 is passed into TS 24. The contents of TS 2, TS 3, TS 4, TS 5, TS 8 are altered.
​Outline of operation. TS 8 is transferred to TS 2 and then subtracted from zero, passing into the partial sums register TS 4, TS 5. By taking out TS 5 we obtain a minor cycle full of digits 1 or of digits 0 according as there was or was not a digit 1 in TS 8 originally. We then form (TS 5 & TS 15) v (~TS 5 & TS 16) by logical operations and pass it on to TS 24.
This table provides the main means of deciding between two alternative procedures, by setting up one or the other of two instructions, contained in TS 15 or TS 16.
PLUSIND (General Description). 1 is added to the position reference in TS 27, e.g. DL 7, 9 becomes DL 7, 10, but DL 7, 32 becomes DL 8, 1.
TRANS 45 (General Description). The following set of transfers is made
TS 22 - TS 20, TS 23 - TS 21.
BURY (General Description). The content of TS 1 with 1 added is transferred to the position indicated in TS 31, and 1 is added to the reference in TS 31. We then proceed to carry out the instruction in TS 1.
UNBURY (General Description). The minor cycle whose position is given in TS 31 is taken to be position of the next instruction.
MULTIP (General Description). The number in TS 18, 19 is multiplied by the number in TS 20, 21: the result is brought to standard form by shift of decimal point. An error is obtained for the product by using the errors in the given numbers and allowing for rounding off. The result is stored in TS 22, 23.
ADD is analogous to MULTIP.
As an example of a more complicated process, I have chosen the calculation of the value of a polynomial.
CALPOL (General Description). The minor cycles of DL 3 taken in pairs contain the coefficients of a polynomial in descending order. Evidently we are restricted to degrees not exceeding 15, and we assume the degree always to be 15, filling up with appropriate zero coefficients. The value of this polynomial will be calculated for the argument in TS 13, TS 14 and the result will be transferred to TS 25, 26. Before starting we require special contents in DL 1, 14 and DL 1, 15. There are
DL 1, 14 0000,0101,0000,0000,0100,0110,0000,0000
DL 1, 15 0000,0000,0000,0000,0000,0100,0000,0000
the expression in DL 1, 14 representing the order to transfer DL 3,1 to TS 6.
CALPOL.
CALPOL 1. Clear TS 22, 23; DL 1, 14 - TS 27;
DL 1,15 - TS 29. CALPOL 8
CALPOL 8. B, BURY; B, INDEXIN; TS 28 - TS 18; B, BURY; B, PLUSIND;
B, BURY; B, INDEXIN; TS 28 - TS 19; B, BURY; B, ADD; B, BURY;
B, PLUSIND; TS 27 - TS 2; TS 29 - TS 3; AND; Q, CALPOL 40;
TS 6 - TS 15; Q, CALPOL 37; TS 6 - TS 16; B, BURY; B, DISCRIM; B, 1
CALPOL 37. TS 13 - TS 18; TS 14 - TS 19; B, BURY; B, TRANS 45;
B, BURY; B, MULTIP; B, BURY; B, TRANS 45. CALPOL 49.
CALPOL 49. B, CALPOL 8.
CALPOL 50. TS 22 - TS 25; TS 23 - TS 26; B, UNBURY.
The above table for CALPOL has been expressed in a more abbreviated form than the one we gave for INDEXIN, several operations being listed at a time. AND is of course the logical operation and B,1 indicates B with a 1 in column 17.
Outline of operation (CALPOL). If we denote the polynomial by a$_1$ x$^{15}$ + a$_2$ x$^{14}$ + . . . the calculation proceeds by the equations b$_1$ = a$_1$, c$_1$ = b$_1$ x, b$_2$ = c$_1$ + a$_2$, c$_2$ = b$_2$ x, . . . After the calculation of each b$_r$ we have to determine whether this is the one required, viz. b$_{16}$ or not. This is done by examining the content of TS 27 which includes the number r and is also, one might say principally, used to describe the position of the next coefficient a$_{r+1}$. If it is the one required we find ourselves at CALPOL 40 and have to pass b$_r$ out to TS 25,26. Otherwise we go to CALPOL 31, and after multiplying b$_r$ by x to give c$_r$ we find ourselves back at CALPOL 8 and repeating processes we have done before.
It will be evident that the table CALPOL is somewhat wasteful of space. Each time a subsidiary operation is required we have to repeat B, BURY, and each time we make a transfer we have to do it in two stages, each of which uses a whole minor cycle of which most is wasted. It is possible to avoid this waste of space by keeping the instruction tables in some abbreviated form, and expanding each table whenever we want it. This will require a table EXPAND, and will require each table to include appropriate references to the table EXPAND. These references will however be put in by EXPAND itself (when working under contract to a higher authority), just as EXPAND will put in the references to BURY and UNBURY.
BINDEC (General Description). The number in TS 13, 14 is translated into decimal form of the type α x 10$^m$ where 1 ≤ α < 10, and is transferred into DL 10. The notation of the decimal form is such that the content of DL 10 can be passed out onto a card in the usual way and if the card is then listed the digits of the numbers α,m will then appear on the listing paper in the usual way. Or in other words only the first 10 minor cycles of DL 10 are used, and a decimal digit is represented by the minor cycle in which a pulse occurs, and its significance by the position of it within the minor cycle.
(This account is incomplete as regards signs and some other details).