fnstltute for Advanced Study

Math. - Nat. Sci. Library ^ Princeton, N. J, Q8540

EC?

i^e;^c»vT o%^ iU«. \->^r^ tlie \._. ^i- . cd ...

-T< y

PLANNINQ AND CODING OF PROBLEMS

FOR AN ELECTRONIC COMPUTING INSTRUMENT

BY Herma/1 H> Goldstlne John von Neumann

Report on the Kbthematical and Logical aspects of an Electronic Cornputing Instrument

Part II, Volume I- 3

IAS ECP list of reports, 19^6-57. nos. k, 8, 11.

Institute for Advanced Study Princeton, New Jersey

IM7

TABLE OF CONTENTS

PREFACE

7.0 GENERAL PRINCIPLES OF CODING AND FLOW-DIAGRAMMING

Page

7.1 The nature of ccxJing: Dynamic and static constituents. I

7.2 Table of orders. Changes in the orders. 3

7.3 The flow diagram. Loops. Alternative boxes. 4

7.4 Operation boxes. Remote connections. 8

7.5 Storage. Free and bound variables. ID

7.6 Transition points, constancy intervals. Substitution boxes, assertion boxes. II

7.7 The contents of an operation box. Tabulated and distributed storage. 13

7.8 The effects of the various boxes. The precise rules governing their use. 16

7.9 Details and siccessive stages of coding. 19

8.0 CODING OF TYPICAL ELEMENTARY PROBLEMS

8.1 General remarks. 2^

8.2 Treatment of position marks. 2t

8.3 Problem I: ^ = au£+butc ^ ^jth g, v at given places. 25

du+e 84' Problem 2: Same as Problem I, but only the numbers of the

places of u, V given. 27

8.5 Prel imi nary method to estimate durations. Appl ication to Problems I, 2 30

8.6 Questions of size. Methods of adjusting sizes. Simplest application to Problems 1,2. 31

8.7 Problem 3: Same as Problem 2, but with "j, ^j, i* I,..., I. 33

8.8 Problem 4: Automatic sensing of the size of a ratio - . 36

8.9 Method to correct errors or to effect changes in coding. HI'

8.10 Problem 5: Formingfuby iterating z— * i (z + ii ). 13

9.0 COOING OF PROBLEMS DEALING WITH THE DIGITAL CHARACTER OF THE NUMBERS PROCESSED BY THE MACHINE

9. 1 General remarks . H7

9.2 The conversions. The higher than. normal precision routines. 47

5.3 The need for the conversions. Timing considerations. 48

9.4 Analysis of the binary and the decimal notations and of the requirements of the conversions. H9

9.5 Precision problems of the conversions. 51

9.6 Problem 6: Binary to decimal conversion. SiZ

9.7 Problem 7: Decimal to binary conversion. 56

9.8 Double precision arithmetics. Problems: Double precision addition and subtraction. 61

9.9 Problem 9: Double precision mult ipl ication. ©+

9.10 Sunmary concerning double precision arithmetics. 69

/>/

PREFACE

This report was prepared in accordance with the terms of Contract No. W-36-054-0RD-748 I between the Research and Development Service, U. S. Artry Ordnance Deparbment and the Institute for Advanced Study. It is essentially the second paper referred to in the Preface of the earlier report entitled, "Preliminary Discussion of the Logical Design of an Electronic Computing Instrument", by A. W. Burks, H. H. Goldstine and John von Neunann, dated 28 June 1946.

During the time which has intervened it has become clear that the issuance of a greater number of reports wi I I be desirable. In this sense the report, "Prel iminary Discussion of the Logical Design of an Electronic Computing Instrunent" should be viewed as Part I of the sequence of our reports on the Electronic Computer. The present report is Volume I of Part II. A Volume II of Part II wi I I fol tow within a few months.

Part II is intended to giv« an account of our methods of coding and of the pnilosophy which governs it. It contains what we believe to be an adequate number of typical examples, going from the simplest case up to several of high complexity, and in reasonable didactic completeness. On the other hand. Part II in its present form is preliminary In certain srgnili 'cant ways. On this account the fol loving ought to be said.

oil We do not discuss the orders control I ing the inputs and outputs

and the stopping of the machine. (The inputs and outputs are, hovjever, discussed oi to the extent which is required for the treatment of the binary-decimal and ^ decimal-binary conversions in Chapter VIII.) The reason for this is that in this direction some engineering alternatives seem worth keeping open, and it does not affect the major problems of coding relevantly.

The use of the input -output medium as a subsidiary memory is not disQussed. This will probably be taken up in Part III.

The code is not final in Q'^&r'j respect. Several minor changes are clearly called for, and even some major qnes are conceivable, depending upon various ^ engineering possibilities that are still open. In all cases where changes are indi- ^ Gated or possible, there are several alternative ones, between which it is not yet

easy to choose with much assurance. We bel ieve that our present code is correct in ^ its basic idea, and at any rate a reasonable basis for the discussion of other '^ proposiils. That is, the examples which we have coded, may serve as standards in o comparing this code with variants or with more basically different systems.

^ It should be noted that in comparing codes, four viewpoints must be

kept in mind, all of them of comparable importance: (I J SimpI icity and reliability ^ of the engineering solutions required by the code; (2) Simplicity, compactness and '^' completeness of the code; (3) Ease and speed of the human procedure of translating

23503

]V

mathematically conceived methods into the code, and also of finding and correcting errors in coding or of applying to it changes that have been decided upon at a late stage; (4) Efficiency of the code in operating the machine near its full intrinsic speed.

We propose to carry our comparisons of various variants and codes under these aspects.

The authors wish to express their thanks to Professor Arthur W. Burks, of the University of Michigan, for many valuable discussions, as wel I as for his help in coding certain of the problems in the text.

H. H. Goldstine J . von Neumann

Institute for Advanced Study 1 Apri I 1947

/

PLANNING AND COOING OF PROBLEMS FOR AN ELECTRONIC COMPUTING INSTRUMENT

7.0 GENERAL PRINCIPLES CF CODING AND FLOWKDIAGRANt^l NG.

7.1 In the first part of th'S report we discussed in broad outline our basic point of view in regard to the electronic computing machine we new envision. There is included in that discussion a tabulation of the orders the machine will be able to obey. In this, the second part of the report, we intend to show hew the orders may be used in the actual progrannning of numerical problenB.

Before proceeding to the actual progranming of such problems, v»e consider it aesirable to discuss the nature of coding per se and in doing this to lay down a modus operandi for handling specific problems. We attempt therefore in this chapter to analyze the coding of a problem in a detailed fashion, to show where the difficulties I ie, and hew they are best resolved.

The actual code for a problem is that sequence of coded symbols (express- ing a sequence of words, or rather of half-words and words) thart has to be placed 'into the selectron memory in order to cause the machine to perform the desired and planned sequence of operations, which amount to solving the problem in question. Or to be^ more precise: This sequence of codes will impose the desired sequence of acti-ons on C by the following mechanism: C s'cans the sequence of codes, and effects the instructions, which they contain, one by one. If this were just a linear scanning of the coded sequence, the latter remaining throughout the procedure unchanged in form, then matters would be quite simple. Coding a problem for the machine would merely be what its name indicates: Translating a meaningful text (the instructions that govern solving the problem under consideration) from one language (the language of mattiematics, in which the planner will have conceived the problem, or rather the numerical procedure by which he has decided to solve the problem) into another language (that one cf our code).

This, however, is not the case. We are convinced, both on general grounds and from our actual experience with the coding of specific numerical problems, that the main difficulty lies just at this point. Let us therefore describe the process that takes place more fully.

The control scans the coded instructions in the selectron memory as a rule linearly, i.e. beginning, say, with word No. 0, and proceeding from word No. y to word No. y + I (and within each word from its first half to its second half), but there are exceptions: The transfer orders xC, xC, xCC, xCC (Cf. Table I at the end of the first part of the report, or Table I I below) cause C to jump from word y to the arbitrarily prescribed word x (unconditionally or subject to the fulfillment of certain conditions). Atso, these transfer orders are among the most critical constituents of a coded sequence. Furthermore, the substitution orders xSp, xSp' (and also xS, cf. as above) permit C to modify any part of the coded sequence as it goes along. Again, these substitution orders are usually of great importarce.

To sum up: C will, in general, not scan the coded sequence of instruc- tions linearly. It may jump occasionally forward or backwartj, omitting (for the time being, but probably not permanently) some parts of the sequence, and going repeatedly through others. It may modify some parts of the sequence while obeying the instructions in another part of the sequence. Thus when it scans a part of the sequence several

times, it may actually find a different set of instructions there at each passage. Ail these displacements and modifications may be conditional upon the nature of intermediate results obtained by the machine itself in the course of this procedure. Hence it wi I I not be possible in general to foresee in advance and completely the actual course of C, its character and the sequence of its omissions on one hand and of its multiple passages over the same place on the other, as well as the actual instructions it finds along this course, and their changes through various successive occasions at the same place, if that place is multiply traversed by the course of C. These circumstances develop in their actually assumed forrns only during the process (the calculation) itself, i.e. while C actually runs through its gradually unfolding course.

Thus the relation of the coded instruction sequence to the mathematically conceived procedure of (numerical) solution is not a statical one, that of a trans- lation, but highly dynamical: A coded order stands not simply for its present contents at its present location, but more fully for any succession of passages of C through it, in connection with any succession of modified contents to be found by C there, all of this being determined by all other orders of the sequence (in conjunction with the one now under consideration) This entire, potentially \/ery involved, interp^ayof inter- actions evolves successively while C runs through the operations controlled and directed by these cont inucnjsly changing instructions.

These comp I icat ions are, furthermore, not hypothetical or except ional . It does not require a deep analysis of any inductive or iterertive mathematical process to see that they are indeed the norm. Also, the flexibility and efficiency of our code is essentially due to them, i.e. to the extensive combinatorial possibilities which they indicate. Finally, those mathematical problems, which by the i r complex it y justify the use of the machine that we envision, require an application of these control procedures at a rather high level of comp I icat ion and of multiplicity of the course of C and of the successive changes in the orders.

All these assertions will be amply justified and elaborated in detail by the specific coded examples which constitute the bulk of this report, and by the methods that we are going to evolve to code the-i.

Our problem is then to find simple, step-by-step methods, by which these difficulties can be overcome. Since coding is not a static process of trans- lation, but rather the technique of providing a dynamic background to control the automatic evolution of a meaning, it has to be viewed as a logical problem and one that represents a new branch of formal logics. We propose to show in the course of this report how this task is mastered.

The balance of this chapter gives a rigorous and complete description of our method of coding, and of the auxiliary concepts which we found convenient to introduce in order to expound this method. (The subsequent chapters of the report deal with specific examples, and with the methods of combining already existing coded sequences.) Since this is the first report on this subject, we felt justified to stress rigor a/xJ completeness rather than didactic simplicity. A later presenta- tion will be written from the didactic point of view, which, we believe, will show that our methods are fairly easy to learn.

7.2 Table II on page 5 is essentially a repetition of Table I at the end of Part I of this report, i.e. it is a table of orders with their abbreviations and explanations. We found it convenient to make certain minor changes. They are as fol lews:

First : I I has been changed, so as to express the round off rule dis- cussed in 5.11 in Part I of this report. In accord with the discussion carried out loc. cit., we use the first round off rule described there. As far as the left-hand 39 digits are concerned, this consists of adding one to digit 40, and effecting the resulting carries, thereby possibly modifying the left-hand 39 digits. Since we keep track of the right-hand 39 digits, too. It Is desirable to compensate for this within the extreme left (non sign) digit of the right-hand 39 digits. This amounts to adding i in the register. The number there Is ^ 0 (slan digit 0), hence a carry results If and only if that number is S J, I.e. If Its extreme left (non sign) digit Is I. In this case the carry adds 2~°^ in the accumulator and subtracts I In the register. Hence Instead of adding 5 In the register we actually subtract i there. However, the aggregate result (on the 78 digit number) is in anyevent the addition of i in the register (i.e. of one to digit 40), hence It must be compensated by subtracting i in the register. Consequently we do nothing or subtract I in the register, accord- ing to whether Its extreme left (non sign) digit Is 0 or I. And, as we saw above, we correspondingly do nothing or add 2~ in the accumulator Note, that the operation +2"*'^, which may cause carries, takes place in the accumulator, which can Indeed effect carries; while the operation -I, which can cause no carries, takes place In the register, which cannot effect carries. Indeed: Subtracting I Injthe register, where the sign digit Is 0 (cf. above) merely amounts to reiHacing the sign digit by 1. The new formulation of II expresses exactly these rules.

Sfcond: |8, 19 have been changed somev<hat for reasons set forth In 8.2 belcw'. We note that 18, 19 assume, both In .their old form (Table I) and their new form (Table II ), that in each order the memory position number x occupies the 12 left digits (cf. 6.6.5 in Part 1 of this report).

••

Thtrd: 20, 21 have also been changed. The new form of 20 is a right shift, which is so arranged that it halves the number in the accumulator, including an arithmetically correct treatment of the sign digit. The new form of 21 is a left shift, whith is so arranged that It doutjies the number In the accumulator (provided that that number lies between -i and i). Including an arithmetically correct treat- ment of the sign digit. At the same time, however, 21 (in its new form) is so arranged that the extreme left digit (after the sign digit) in the accumulator is not lost, but transferred into the register. It is inserted there at the extreme right, and the original contents of the register are shifted left correspondingly. The imnediate uses of 20, 21 are arithmetical, but the last mentioned features of 21 are required for other, rather combinatorial uses of 20, 21. For these uses there will be soine typical examples in 9.5 and 9.6.

It should be added, that various elaborations and refinements of a), 21 might be considered. Shifts by a given number of places, shifts until certim sizes have been reached, etc. We do not consider the time mature as yet as to make any definite choices in this respect, although some variants would have certain advantages in various situations. We wil 1 ,. for the time being, use the simplest forms of 20, 21 as given in Table II.

7.3 We now proceed to analyze. the procedungs by which one can build up the appropriate coded sequence for a given problem or rather for a given numerical method to solve that problem. As was pointed out in 7- I, this is not a mere question of translation (of a mathematical text into a code), but rather a question of providing a control schems for a highly dynamical process, all parts of which may undergo repeated and relevant changes in the course of this process.

Let us therefore approach the problem in this sense.

It should be clear from the preliminary analysis of 7.1, that in planning a coded sequence the thing that one should keep primarily in mind is not the original (initial) appearance of that sequence, but rather its functioning and continued changing while the process that it controls goes through its course. It is therefore advisable to begin the planning at this end, i.e. to plan first the course of the process and the relationship of its successive stages to their changing codes, and to extract from this the original coded sequence as a secondary operation. Furthermore, it seems equally clear, that the basic feature of the functioning of the code in conjunction with the evolution of the process that it controfs, is to be seen in the course which the control C takes through the ceded sequence, parallelling the evolution of that process. We therefore' propose to begin the planning of a coded sequence by laying out a schematic of the course of C through that sequence, i.e. through the required reqion of thef selectron memory. This schematic is the flow diagram of C Apart from the above a priori reasons, the decision to make the flew diagram of C the first step in code- planning appears to be extensively justified by our ovn experience with the coding of actual problems. The exempi if ication of this kind of experience on a number of selected typical examples fonrB the bulk of this report.

In drawing the flew diagram of C the following points are relevant:

First : The reason why C may have to move several times through the same region in the selectron memory is that the operations that have to be performed may be repetitive. Definitions by induction (over art integer variable ); iterative processes (tike successive approximations); calculations of sums or of products of many addends or factors all formed according to the same law (but depending on a variable sumnation or multiplication index); stepwise integrations in a simple quadrature or a more involved differential equation or system of differential equations, which approximate the- result and which are iterative in the above sense; etc. these are typical examples of the situation that we have in mind. To simplify the nomenclature, we wi 1 1 call any simple iterative process of this type an induction or a simple induction. A multiplicity of such iterative processes, superposed upon each other or crossing each other will be called a multiple induction.

When a simple induction takes place, C travels during each step of the induction over a certain path, at the end of which it returns to its beginning. Hence this path may be visualized as a loop. We wi 1 1 cal I it an induction loop or a simple induction loop. A multiple induction gives .rise to a mult ipjicity' of such loops; they form together a pattern which will be called a multiple induction loop.

Ws propose to indicate these portions of the flow diagram of C by a symbolism of lines oriented by arrows. Thus a linear sequence of operations, with no inductive elements in it, will be denoted by syntiols like these in Figures 7.1 a-c, while a simple induction loop is shown in d, eod., and multiple induction loops are shown in e-f, eod.

il

XI (0 XI

< >

<D

C_)

C-J O O O

XXXXXXXXX X

11

T

<t«5<<:<i:<:<:^cr<tx

•>-tcNirf\'a-intDr--oocr>0'^

•I-

X

t

CO

C\J

O o to C/O 00

X X X X X X

ex Q.

CE

—•00 —■'^ ^ '^

TttTtT

2<.

CO

T

a3<3as<

O-

<

Ct —1

cA •^ uo CD r~^ 00

■'-\ T-* r-\ r-l »-(^-l

en

^?^

0)

CO

0) ■(-' 10

«

FIGURE 7. I

b.

C.

f.

Second: It te clear that this notation is incomplete and unsatisfactory. Figures 7.1 d-f fail to irxJiicate hew C gets into these loops, how many times it circles each loop, and hew it leaves it. e-f, eod. also leave it open what the hierarchy of the loops is, in what order they are taken up by C, etc.

Actually the description of an induction is only complete if a criterium is specified which indicates whether the iterative step should be t-epeated, i.e. the loop circled once more, or whether the iterations are completed and a new path is to be entered. Accordingly a simple induction loop, like the one shown in Figure 7.1 d, needs an indication of the path on which C enters it at the beginning of the induction, the path on which C leaves it at the end of the induction, and the area in which the criterium referred to above is applied, i.e. where it is determined whether C is to circle the loop again, or whether it is to proceed on the exit path. We wi II denote this area by a box with one input arrow and two output arrows, and we call this an altemattve box. Thus Figure 7. | d, becomes the more coctiplete Figure 7.2 b. The alternative box may also be used to bifurcate a linear, non-looped piece of C's course. Indeed, alternative pro- cedures may be required in non-inductive pr<jcedunes, too. This is shewn in Figure 7.2 a. Finally multiple induction loops, completed in this sense, are shwwi on c-d, eod. It will be noted that in these inductions in c the small loop represents an induction that is subondinate to that one on the big loop, i.e. part of its inductive step. Similarly in d the two small loops that are attached to the big loop are in the same subondinate relation to it, while the loop at the extretne right is again subordinate to the loop to which it is attached.

FIGURE 7.2

OUT

OUT

Piird : The alternative boxes which we introduced correspond to the conditional transfer orders xCc, xCC. I.e., the intention that they express will be effected in the actual code by such an order. Of the two output branches (cf. e.g. Figure 7-2 a) one leads to the order following imtediately in the selectron memory upon the last order on the input branch, while the other leads to the left or the right hand order in S(x). If at the moment at whifch this decision is made the number u is in A, then u < o causes the first branch to be taken. We wi I I place the u which is thus valid into the alternative box, and mark the two branches repre- senting the two alternatives u ^ o and u < o by + and by -, respectively. In this way Figures 7.2 a-b become Figures 7.3 a-b. Figure 7.3 b may be made still more specific: If the induction variable is i, and if the induction is to end when i reaches the value 1 i if i 's successive values are 0, I, 2 ..., then this means that I iterations are wanted), and if, as shown in Figure 7.3 b, the - branch is in the induction loop while the + branch leaves it, then the u of this Figure may 'be chosen as i - I, and the complete scheme is that shown in Figure 7.3 c. (In many inductions the natural ending is defined by i + 1, having reached a certain value I. Then the above i - I is to be replaced by i - I + 1. )

8.

FIGURE 7.3

U ^ OUT IN

OUT

Peuttk: Two or more paths of the flow diagram may rnerge at certain points. This takes place of necessity at the input of the alternative box of an induction loop (cf. Figures 7.2 b-d and 7.3 b-c), but it can also happen iri a linear, non-looped piece of C's course, as shown in Figure 7.4. This corresponds to two alternative procedures leading up to a conron continuation.

7 4 The flow diagram of C, as described F^UBE 7»4

in 7.3 is only a skeleton of the process that is to be represented. Ws pass therefore to examining xhe addi- tions which have to be made in order to complete the schenre.

First: Our flow diagram in its present form does not indicate what arithmetical operations and transfers of numbers actaal ly take place along the various parts of its course. These, however', represent the properly nBthematical (as distinguished from the logical ) activities of the machine, and they should be shown as such. For this reason we wi I I denote each

area in which a coherent group of such operations takes place by a special box which we cal I an operation box. Since a box of this category is an insertion into the f lav diagram at a point where no branching or merger takes place, it must have one input arrow and one output arrow. This distitinguishes it clearly from the alternati^9 boxes of Fi.gure 7 3- Figures 7-5 a-c show the positions of operation boxes in various looped and un looped flow diagrams.

->-

FIGLPE 7.5

->-

a.

b.

a

r

->-

c.

Second: ^ileC moves along the flav diagram, the contents of the alter- native boxes (wfiich we have Indicated) and of the operation boxes (which we have not indicated yet) will, in general, keep changing and so wi II various other things that have to be associated with these in order to complete the picture (and which we have not yet indicated either). This whole modus procedendi assumes, however, that the flew diagram itself (i.e. the skeleton of Figure 7.3) remains unchanged. This, however, is not unqualifiedly true. To be specific: The transfer orders xC, xC (unconditional), and also xCc, xCc ' (conditional ), can be charged in the. course of the process by substi- tution orders xSp, xSp'. This changes the connections between various parts of the flow diagram. When this happens, we wi I I terminate the corresponding part of the flov diagram with a circle marked with a Greek letter, and originate the alternative con- tinuations from circles marked with properly indexed specimens of the same Greek letter, as shown in Figure 7.6 b. Wfe call this arrangement a variable remote connection.

FIGURE 7.6

a.

■^ ( OC^

a,H^

a,)-^

aah-^

The circle * Q is the entrance to this remote connection, the circles

(~) > are the exits from it.

NOTE I: The lettering with Greek letters a, P, ■•• "^^^ neither be monotone nor uninterrupted, and decimal fractions following the Greek letters may be used for further subdivisions or in order to interpolate omissions, etc. All of this serves, of course, to facilitate modifications and corrections on a diagram which is in the process of being drawn up. The same principles will be applied subsequently to the enumerations of other entities: Constancy intervals (cf. the last part of 7.6, the basic Greek letters being replaced by Arabic numerals ), storage positions (cf. the begi-ining of 7.7, the basic Greek letters being replaced by English capitals), operation boxes and alternative boxes (cf. the last part of 7.8, the basic Greek letters being replaced by Roman numerals).

NOTE 2: In the case of an unconditional transfer order which is never substituted, the flov diagram can be kept rigid, and no remote connection need be used. It is nevertheless sometimes convenient to use one even in suCh a case as shown in Figure 7.6 a. Indeed, this device may be used at any point of the flow diagram, even at a point where no transfer order is located and C scans I inearly ( i-.e. from one half-word to the next one). This is so when the flow diagram threatens to assiire an unwieldy form (e.g. grov off the paper) and it is desired to dissect it or .to rearrange it. An arrangement of this type will be cal led a fixed remote connection.

10.

rhe circles ^ O ^"^ O ^ ^ire again the entrance and the

exit of this connection. The Greek letter at the exit need, of course, not be indexed now. It is sometimes convenient to give a remote connection of either type more than one entrance. These are then equivalent to a pre-entrance confluence. They may be used when the geometry of the flow diagram makes the explicit drawing of the confluence inconvenient.

7.5 Wte pointed out at the beginning of the second remark in 7.4, that our present form of the flow diagram is still incomplete in two major respects: First, the contents of the operation boxes have not yet been indicated. Second, certain further features of the process that accompanies the course of C have not yet been brought out. Let us begin by analyzing the latter point.

No complicated calculation can be carried out without storing considerable numerical rraterial while the calculation is in progress. This storage problem has been considered in considerable detail in Part 1 of this report (cf. in particular 1.3, 2, 4 there). The storage may involve data which are needed for the entire duration of the procedure, and are therefore never changed by that procedure, as well as data which play a role only during part of the procedure (i.e. during one circling of an induction loop, or during a part of the course over a linear piece or an induction loop) and may therefore be changed (i.e. replaced by other data) at the end of their usefulness. These changes serve, of course, the very important purpose of making it possible to use the same storage (selectron memory) space successively for changing and different ends We will talk accordingly of fixed and of variable storage. These concepts are to be 'inderstood as being meaningful only relatively to the procedure which we are coding. Occasionally it will also be found useful to use them relatively to certain parts of that procedure.

Before we develop the means to indicate the form and contents of the (fixed and variable) storage that is required, it is necessary to go into another matter.

A mathermtical-Iogical procedure of any but the lowest degree of complexity cannot fail to require variables for its description. It is important to visualize that these variables are of two kinds, namely: First, a kind of variable for which the variable that occurs in an induction (or more precisely: with respect to which the induction takes place) is typical. Such a variable exists only within the problem. It assumes a sequence of different values in the course of the procedure that solves this problem, and these values are successively detenrined by that procedure as 4t devetops. It is impossible to substitute a value for it and senseless to attribute a value to it "from the outside". Such a variable is called (with a term borrowed from formal logics) a bound variable. Second, there is another kind of variable for which the parameters of the problem are typical indeed it is essentially the same thing as a parameter. Such a variable has a fixed value thi'oOgtv- out the procedure that solves the problem, i.e. a fixed value for the entire problem. If it is treated as a variable in the process of planning the coded sequence, then a value has to be substituted for it and attributed to it ("from the outside"), in order to produce a coded sequence that can be actual ly fed into the machine. Such a variable is cal led (again, borrowing a term from formal logics) a free variable.

In discussing the ways to indicate the form and contents of the storage that is required, there is no trouble in dealing with free variables: They are as good as constants, and the fact that they will acquire specific values only after the ceding process is completed does not influence or complicate that process. Also,fixed storage offers no problems. The real crux of the matter

II.

is the variable storage and its changes. An item in the variable storage changes when it is expl ic it ly replaced by a different one. (This is effected by the operation boxes, cf. 7.4 and the detailed discussion in 7.7, 7-8.1 When the value of a bound variable changes (this is effected by the substitution boxes, cf. the last part of 7.6), this should also cause indirectly a change of those variable storage items in whose expression this variable occurs. However, we prefer to treat these variable value changes merely a? changes in notation which do not entail any actual change in the relevant variable storage items. On the contrary, their function is to establish agreement between pre- ceding and fol lowing expressions (occupying identical storage positions), which differ as expressions, but whose difference Is removed by the substitution in question. (For details cf. the third rule relative to storage in 7.8.)

7.6 After these preparations we can proceed to an explicit discussion of storage and of bound variables.

In order to be able to give complete indications of the state of these entities, it is necessary to keep track of their changes. We wi I I therefore mark along the flew diagram the points where changes of the content of any variable storage or of the value or domain of variability of any. bound variable takes place. These points will be called the transition points. The transition points subdivide the flew diagram into connected pieces, along each of which all changing storages have constant contents and all bound variables have constant values. (The remote connections of the second remark in 7.4 rate in this respect as if they were unbroken paths. For a variable remote connection all possible' branches are regarded In this way.) We call these constancy intervals. Clearly a constancy interval is bounded by the transition points on its end i ngs .

NOTE: The constant contents and values attached to a constancy interval may, of course, vary from one passage of C over that interval to another.

Let us new consider the transition points somewhat more closely. We introduced so far three kinds of interruptions of the flow diagram: Alternative boxes, operation boxes, remote connections. 0"f these the first and the third effect no changes of the type under consideration, they influence only the course of C. The second, how- ever performs arithmetical operations, therefore it rray require storage, and hence effect changes in the variable storage. In fact, all variable storage originates in such operations, and all operations of this type terminate in*consigning their results to storage, which storage, just by virtue of this origin, must be variable. Accordingly the operation boxes are the transition points inasmuch as the changing of variable storage is concerned. Thus we are left to take care of those transition points which change the values or delimit the domains of variability of bound variables. Changing the value of a bound variable involves arithmetical operations which must be indicated. An inductive variable i, which serves to enumerate the successive stages of an iteration, undergoes at each change an increase by one. we denote this substitution by i + 1^ i. It is, however, neither necessary nor advisable to penr.it no other substitutions. Indeed, even an induction or iteration begins with a different substitution, namely that one assigning to i the value 0 [or 1] i.e. 0 -? i [or 1 -^ i] , In many cases, of which we wi II prestent examples, it is necessary to substitute with still more freedom, e.g. f ( i, j, k, ... ) > i, where f is a function of i itself as we I 1 as of other variables j, k, .... (For details cf. the first part of 7.7.) For this reason we wi I 1 denote each area in which a toherent Change or group of such changes takes place, by a special box, which we cal 1 a substitution box. Next we consider

12.

the changes, actually limitations, of the domains of variability of one or more bound variables, individually or in their interrelationships. It may be true, that whenever C actually reaches a certain point in the flew diagram, one or more bound variables will necessarily possess certain specified vaiues, or possess certain properties , or satisfy certain relations with each other. Furthermore, we may, at such a point, indi- cate the val idity of these I imitations. For this reason we wi I I denote each area in which the «al idity of such limitations is being asserted, by a special box, which we call an assertion box.

The boxes of these two categories (substitutions and assertions) are, like the operation boxes, insertions into pieces of the flew/ diagram where no branchings or mergers take place. They have therefore one input arrow and one output arrow. This necessitates some special marks to distinguish them from operation boxes. In drawing these boxes in detail, certain distinguishing marks of this type will arTse automatically (cf. as above), but in order to clarify matters we will also mark every substitution and assertion by a cross #. In addition, we will, for the time being, also mark substitution boxes with an s, fol lowed by the bound variable that is being changed and assertion boxes with an a.

Thus the operation boxes, the substitution boxes and the assertion boxes produce together the dissection of the flow diagram into its constancy intervals.. We will number the constancy intervals with Arabic numerals, with the rules for sequencing, subdividing, modifying and correcting as given in Note I in 7.4.

To conclude, we observe that in the course of circling an induction loop, at least one variable (the induction variable) must change, and that this variable must be given its initial value upon entering the loop. Hence the junction before the alter- native box of an induction loop must be preceded by substitution boxes along bothppaths that lead to it: Along the loop and along the path that leads to the loop. At the exit from an induction loop the induction variable usually has a (final) value which is kno*n in advance, or for which at any rate a mathematical symbol has been introduced. This amounts to a restriction of the domain of variability of the induction variable, once the exiit has been crossed indeed, it is restricted from then on to its final value, i.e. to only one value, hence this is usually the place for an assertion box.

A scheme exhibiting all the features discussed in this section is shewn

in Figure 7.7. FIGURE 7.7

13.

7.7 We new complete the description of our rrethod to indicate the successive stages and the functioning of storage.

The areas in the selectron memory that are useri in the course of the procedure under cons Ida rat ion will be designated by capital betters, with the rules for sequencing, subdividing, modifying and correcting as given in Note I in 7.4.

The changes in the contents of this storage are effected by the operation boxes, as described in 7.6. An operation box should therefore contain the following indications! First, the expressions which have to be calculated. Second, the storage positions to which these expressions have to be sent subsequently. The latter are stated by an affix "to ....". E.g. if the expression Vxy+z (x, y, z are variables or other expressions) is to be formed and then stored at C.2, then the indication will be "Vxy+z to, c.2". It may also be desired to introduce a new symbol for this expression,' i .8. to def tne one, e^g. w = Vxy+z Then the indication will be "w = VXy+Z to C.2".

It. should be added that an expression that has been calculated in an operation box may also be sent to a variable remote connection (i.e. to its entrance, cf. the last part of 7.4). The expression must, of course, be the designation of one .of the exits of that connection, and the operation consists of equating the designation of the entrance to it. The latter is the Greek letter (possibly with decimals, cf. Note I in 7.4), the former is this Greek letter with a definite index. No affix "to ...." is needed in this case, since the designation of the entrance determines the connection that is meant. Hence such an operation looks like this: "a = a," . One or more indications of this kind mafee up the contents of every operation box.

NOTE I: An affix "to ...." may also refer to several positions. E.g. : "to A, C. I, 2" .

NOTE 2: The optional procedure of defining a new symbol by an expression formed in an operation box becomes mandatory when that box is followed by a point cf confluence of several paths. Indeed, consider the two operation boxes from which the constancy interval 7 issues in Figure 7.7. Assume that their contents are intended to be "X + y to C.I" and "x - y to C.I", respectively. In order that C.I have a fixed content throughout the constancy interval 7, as required by our definitions, it is necessary to give the alternative expressions x + y and x - y a common name, say z. Then the contents of the two operation boxes in question wi I I be "z = x + y to C I" and "7 = X - y to C. I".

NOTE 5: A variant of the procedure of defining a new symbol is to

define an expression involving a new symbol, which will afterwards only occur as a

whole, or to define the value of a function for a new value of its variable (usually

in an induction). E.g. "f ( i + I ) = i f ( i ) ( i - f ( i ) ) to A. 2".

The contents of a substitution box are one or more substitutions of the type described in 7.6, in connection with the definition of the concept of a substi- tution box. Such a substitution is written I ike this: "f (i, j, k, ...) >• i". Here i is a bound variable, the one whose value is being changed (substituted), while ^ - 'f i'*, j, k, ... ) is an expression which may or may not contain i itself as well as any other bound variables j, k, ... (and any free variables or constants).

14.

The contents of an assertion txDx are one or more relations, equalitfes, or inequalities, or any other logical expressions.

These may be

The successive contents of the storage positions referred to above (A, B, C, ... with decimal fractions) must be shewn in a separate table, the storage table. In conjunction with this table a list of the free variables should be given (in one line) and a I ist of the bound variables (in the next line).

The storage table is a double entry table with its I ines corresponding to the storage positions, and its columns to the constancy intervals. Columns and lines are to be marked with the symbols and numbers of the entities to which they correspond. Each field of this table should show the contents of the position that corresponds to its line throughout the constancy interval corresponding to its column. These contents are expressions which may contain bound variabfes as well as free variables and constants. It should be noted that the bound variables must appear as such, without any attempt to substitute for them their actual values, since only the former are attached to a given constancy interval as such, while the latter depend, also on the specific stage in the course of C, in which C passes at a particular occasion through that constancy interval.

It is obviously convenient to f i I I in a field in the storage table only if it represents a change from the preceding constancy interval. Therefore we reserve the right (without making it an obligation) to leave a field empty if it represents no such change. In this case the field must be thought of as having the same content as its line had in the colurm (or columns) of the constancy interval (or intervals) immediately preceding it along the f lav diagram. (In the plural case, which occors at a junction of the flew diagram, these columns [constancy intervals] must all have the same content as the line in question. Indeed, without observing this rule, it would not be possible to treat a I 1 incoming branches of a junction as one constancy interval. Cf., e.g. the constancy intervals 2 and 7 in Figure 7.7.) If this ante- cedent column is not the one immediately to the left of the column in question, it may be advisable to indicate its number in brackets in the field in question.

Certain storage positions (lines) possess no relevance during certain constancy intervals (columns) i.e. their contents are changed or produced and become significant at other stages of the procedure (in other columns). The corresponding field may then be marked Aith a dash. The repetition rules given above apply to these fields with dashes too.

A scheme exhibiting all these features Is shown in Figure 7.8.

FIGURE 7.8

1

1.5

2

2.5

2.6

3

4

4.5

5

6

A.I

-

1

i

I

-

[2]

i + 1

2

-

1

g( i )

g(I)

P

[2]

g( i+i)

B. 1

-

1

-

J

J

J + 1

-

2

-

i

-

f(j,i)

f(J,i )

f(j + l,i)

-

15.

)n certain problems it is advantageous to represent several storage- positions, i.e. several lines, by one line which must then be marked by a generic variable, or by an expression containing one or more such variables, and not by a definite number. This variable wi I I replace one or more (or al I ) of the decimal digits icr rather numbers) following after the capital letter that denotes the storage area in which this occurs, or these variables may enter into an expression replacing those digits (numbers). In a line which is marked in this way the fields will also be occupied by expressions containing that generic variable or variables. "Expressions" include, of course, also explanations which state what expression should be formed depending on various alternative possibilities.

It may be desinab'le to use such variable-nrerked lines only in a part of the storage table, i.e. only for certain columns (constancy intervals). Or, one may want to use different systems of variable markings in different parts. This necessitates breaking the storage table up accordingly and grouping those columns (constancy intervals) together for which the same system of variable markings is being used

Since the flow diagram is fixed and explicitly drawn, therefore, the columns of the storage table are fixed, too, and there can be no question of variable markings for them.

In actual J) ract ice it may be preferable to distribute al! or part of this table over the flew diagram. This can be done by attaching every field at which a change takes place to that constancy interval to which it (i.e. its column) belongs, with an indication of the storage position that it represents. (This applies to fields whose I ine has fixed markings, as we I I ?s to those whose I ine has variable markings, cf. above.) Since the immediately preceding constancy inten/als are at once seen in this arrangement, there is here no need, to give any of the indications suggested by our repetition rules. For mnemotechnical reasons it may be occasionally worthwhile to indicate at a constancy interval the contents of certain fields at which no changes are taking place at that stage (e.g. because no change took place there over a long run, and the original indication is at a remote point in the flow diagra/n). These two iTiethods, the tabular and the distributed indication of the storage, may also be used together, in mixed forms. Thus, if the distributed method is used in principle, there may be constancy intervals at ♦vhich more fields have to be described than con- venient (e.g. for reasons of space). Such an interval may then be marked by an asterisk, and a partial storage table made, which covers by its columns only the constancy inter- vals with asterisks. Figure 7.8 is the tabular form of the storage table of a flow diagram which is part of that one of Figure 7.7 (without the portion along the constancy intervals 7, 8, and part of 3), and which will be given in full in Figure 7.10. The distributed form is shown in Figure 1.9.

16.

FIGURE 7.0

A.I I

2 gci)

A,£ p

I 3

V--

B. 1 1 2 i

•— >

tn

/

+

A^--

BJ j

2 f(j>0

B.I J + I 2 -fCj +l,'0

7.8 The only constituents- of the flew diagram about which more remains to be said are the operation boxe=;, the substitution boxes and the assertion boxes although even for these short descriptions were given in 7.7. Wfe wi I I now discuss them exhaustively.

An operation box contains one or more expressions, and it indicates that these expressions have to be calculated. Every expression may or may not be preceded by a symbol to wh ich it is equated and which it is defining (cf. also Note 3 in 7.7); and it may or may not be followed by an affix "to ....", the .... '" being occupied by the symbol of a def.inite position, at which the expressions in question is to be stored. If the affix "to ...." is missing, this means that the expression in question may be stored in the accumulator or the arithmetical register or othen\ise, but that at any rate it will ndt be needed at any remoter future stage.

A substitution box contains one or more expressions of the type "f ■—> i", where i is a bound variable, and f is an expression which may or may not contain i and any other bound variables, as well as any free variables and constants. A substitution box is always marked with a cross #.

An assertion box contains one or more relations (cf.the corresponding discussion in 7.7). It is always marked with a cross #.

The three categories of boxes that have just been described, express certain actions which must occur, or situations which must exist, when C passes in its actual course through the regions which they represent. We wi II call these the effects of these boxes, but it must be realized, that these are effects in a symbolic sense only.

17.

The effects in question are as fol Ic3««s:

The bound variables occuring in the expressions of an operation bov must be given the values which they possessed in the constancy interval immediately preceding that box, at the stage in the course of C i nmed i ate I y preceding the one at which that box was accually reached. The calculated expression must then be substituted in a storage position corresponding to the immediately fol Icwing constancy interval, as indicated.

A substitution box never requires that any specific calculation be made, it indicates only what the value of certain bound variables will be from then on. Thus if it contains "f > i", then it expresses that the value of the bound variable i wi I I be f in the irmiediately following constancy interval, as well as in all subse- quent constancy intervals, which can be reached f<5om there without crossing another substitution box with a "g * i" in it. The _ex press ion f is to be formed with all bound variables in it having those values which they possessed in the constancy interval inrmed lately preceding the box, at the stage in the course of C immediately preceding the one at which that box was actually reached. . (This is particularly significant for i itself, if it occurs in f. )

An assertion box never requires that any specific calculations be made, it indicates on|y that certain relations are atrtomat i ca I I y fulfilled whenever C gets to the region which it occupies.

The contents of the various fields of the storage table (tabulated' or distributed) i.e. the various storage positions at the various constancy intervals must fulfill certain conditions. It should be noted that these rer.arks apply to the contents of the field in the flav diagrams, and not to the contents of the correspond- ing positions in the actual machine at any actual moriErtt. The latter obtain from the former by substituting in each case for every bound variable its vaue according to the rictual stage in the course of C and of course for every free variable its value corresponding to the actual problem being solved. Now the conditions referred to above are as fol lews:

First: The interval in question is irmiediately preceded by an operation

box with an expression in it that is referred "to " this field: The field contains

the expression in question, unless that expression is preceded by a symbol to which it is equated and which it Ts defining (cf. also Note 3 in 7.7), in which case it contains that symbol .

Second: The interval in question is inmediately preceded by a substi- tution box containing one or more expressions "f *• i", where I represents any bound variable that occu;^ in the expression of the field: Replace in the expression of the field e\/ery occurrence of eyjery such i by its f. This rrust produce the expression which is valid in the field of the same storage position at the constancy interval inmediately preceding this substitution box.

Third: The interval in question is irmediately preceded by an assertion bcw: It must be demonstrable, that the expression of the field is, by virtue of the relations that are validated by this assertion box, equal to the expression whitjh is valid in the field of the sane storage position at the constancy interval irrmediately

18.

preceding this assertion box. If this demonstration is not completely obvious, then it is desirable to give indications as to its nature: The main stages of the proof may be included as assertions in the assertion box, or some reference to the place where the proof can be found may be made either in the assertion box or in the field under consideration.

Fourth: The interval in question is immediately preceded by a box which falls into neither of the three above categories. The field contains a repetition of what the field of the same storage position contained at the constancy interval imme- diately preceding this box.

Fiftn: If the interval in question contains a merger (of several branches of the flow diagram), so that it is immediately preceded by several boxes, belonging to any or al I of the four above categories, then the corresponding conditions (as stated above) must hold with respect to each box.

Finally: The contents of a field need not be shewn, if it 'S felt that the omission (or rather the aggregate of simultaneously effective omissions of this type) will not impose a real strain on the reader, due to the amount of implicitly given material that he must remember. Such omissions will be indicated in many cases where mere repetitions of previous contents are involved. (Cf. the remarks made in this connection in 7.7, in the course of the discussion of the distributed form of Storage. )

The storage LdOle need not sha^N h\\ the storage positions actually used. The calculations that are required by the expressions of an operation box or of an alternative box may necessitate the use of additional storage space. This space is then specifically attached to that box, i.e. its contents are no longer required and its capacity is available for other use as soon as the instructions of that box have been carried out.

ngure 7.10 shc^^s a complete flow diagram. It differs from that one of Figure 7.9 only inasmuch that the operation boxes and the storage boxes were left empty then. It is easily verified that it represents the (doubly inductive) procedure defining the number p, which is described unaer it.

FIGURE 7.10

^-^ I to ,

A.I 1+ I

z gCL+ I)

i,j

L + 1 to '

gCl+ 0=5(f(j/0+ g(L^)tc ' 2

i.i j+i r

a f(j+ 1,0 "~\_

T.

5

^(J+l

,0 =

-^^j'

+0B.1!

p = gil)',

g( I) = 1 , g(i + l) = i (f(J,i ) + g(i )),

f(i,i) = i, f(j+i,i) = if(j,i)^ - fij,i)) g(i

19.

Among the boxes shown on this f lotv diagram the operation boxes and the alternative boxes and the variable remote connections require further, detailed coding. The substitution boxes and'the assertion boxes (i.e. the boxes which are marked by a cross j^) are purely explanatory, and require no coding, as pointed out earlier in 7.8. The storage boxes have to be coded essentially as they stand. (For all this cf. the details given in 7.9.) Thus the remaining problem of coding is attached to the opera- tion boxes, the alternative boxes and the variable remote connections, and it will prove to be in the main only a process of static translation (cf. the end of 7. I as well as 7.9). In order to prepare the ground for this final process of detailed (Stat ic) cod ing, we enumerate the operation boxes and the alternative boxes by Roman numerals, with the rules for sequencing, subdividing, modifying and correcting as given in Note I in 7.4. Figure 7.10 shows such an enumeration. The variable remote connections are already enu;nerated.

Finally, we indicate the beginning and the end of the completed flew diagram by two circles (T) ^— and > (e) , cf. Figure 7.10

7.9 We can now describe the actual process of coding. It is a succession of steps that take place in the following order.

First: Coding is, of course, preceded by a mathematical stage of preparations. The mathematical or mathemat ical-phys ical process of understanding the problem, of deciding with what assumptions and what idealizations it is to be cast into equations and conditions, is the first step in this stage. The equations and conditions thus obtained are rigorous, with respect to the system of assumptions and ideal izat ions that has been selected. Next, these equations and conditions, which are usually of an analytical and possibly of an implicit nature, must be replaced by arithmetical and explicit procedures. (These are usually step-by-step processes or successive approximation processes, or processes with both of these characteristics and they are almost always characterized by multiple inductions.) Thu? a procedure obtains, which is approximate in that sense in which the preceding one was rigorous. This is the second step in this stage.

It should be noted that the first step has nothing -to do with computing or with machines: It is equally necessary in any effort in mathematics or applied mathematics. Furthermore, the second step has, at least, nothing to do with mechanization: It would be equally necessary if the problems were to be computed "by hand".

Finally, the preeFsion of the approximation process, introduced by the seco»Jd step, must be estimated. This includes the. errors due to the approximations introduced by the second stfip, as wel I as the errors due to the machine's necessarily rounding off to a fixed number of digits ( in our projected machine to a sign plus 39 binary digits, cf. Part !■ of this report) after every intermediate operation (sp«cif ical ly: after e\iery multiplication and division). These are, of course, the welt-kncv/n categories of truncation errors and of round-off errors, respectively. In close connection with these it is also necessary to estimate the sizes to which the numbers that occur in any part and at any stage of the calculation, may grow. After these limits have been established, it is necessary to arrange the calculation so that e\/ery number is represented by a multiple (by a fixed power of 2) which lies in the range in. which the machine vworks (in our projected fiBchine between -I and I, cf. Part I of this report). This is the third and last step of this stage. Like the second step, it is necessary because of the computational character of the problem, rather than because of the use of a machine.

20.

In our case there exists an alternative with respect to this third step: It may be carried- out by the planner, "mathematically", or it may be set up for compu- tation, in which case it may be advantageous to have it, too, carried out by the machine.

After these preliminaries are completed, the coding proper can begin.

Second: Coding begins with the drawing of the floi',' diagrams. This is the dyvamic or macroscopic stage of coding. The flew diagram must be drawn on the basis ffif the rules and principles developed in 7-3 - 7.8. It has been our invariable experience, that once the problem has been understood and prepared in the sense of the preceding first remark, the drawing of the flow diagram presents littl-e difficulty. Every mathematician, or every moderately mathematically trained person should be able to do this in a routine rranner, if he has familiarized himself with the main examples that fol lew in this report, or if he has had some equivalent training in this method.

It' is advisable to draw a (usually partial) storage table for the main data of the problem, and use from then on either purely distributed, or mixed distri- buted and tabular storage, pari passu with the evolution of the diagram. The fl'cw diagram is, of course, best started with one of the lowest (innermost! inductions, proceeding to the higher inductions which contain it, reverting (after these are "exhaiBted ) to another lowest induction (if any are left), etc., etc. No difficulty will be found in keeping the developing flew diagram complete at every stage, except for certain enumerations which are better delayed to the end (cf. belcw).

It is difficult to avoid errors or omissions in any but the simplest problems. Hcwever, they should not be frequent, and wit! in most cases signalize themselves by some inner maladjustmsnt of the diagram, which becomes obvious before the diagram is conf)leted. The flexibil ity of the system of 7.3 - 7.8 is such that corrections and mod if icat ions of this type can almost always be applied at any stage of the process without thrcwing out of gfear the procedure of drawing the diagram, and in part icular without creating a necessity of "starting all over again".

The enumeration of the distribtted storage and of the remote connections and of the constancy intervals should be done pari passu with the drawing of the diagram. The enumeration of the operation boxes and of the alternat\i've boxes, on the other hand, is best done at the end after the flew diagram has been completed.

After a moderate experience has been acquired, many simplifications and abbreviations will suggest themselves to almost any coder. These are best viewed as rdividual variants. We wish to mention only one here^ If distributed storage is extensively used, only a few (if any) among the conistancy intervals will have to be enumerated.

Third: The next stage consists of the individual coding of every operation box, alternative box and variable remote connection. This is the static or microscopic stage of coding. Its main virtue is, that the boxes in question can now be taken up one by one, and that the work on each one of them is essentially un- affected by the work oifi the others. (With one exception, cf. below. )

\Ate feel certain that a moderate amount of experience with this stage of coding suffices to remove from it al I difficulties, and to make it a perfectly routine operation. The actual procedure wi II become amply clear by reading the examples that follow in this report. We state here only general principles which govern the procedure.

21.

The codinq of a variable remote connection is best attached to the

ifimediatelv preceding box. If it is preceded by several such boxes, either of these

may be used; if no suitable box is available, it may be given a Roman numeral and treated as a separate box.

The codinq of the (operation or alternative) boxes remains. The codinq of each box is a separate operation, and we called it, as such, static. This is justi- fied in this sense: The course of C during such a period of codinq is strictly linear, i.e. there are no jumps forward or backwand (by the Cu or Cc type transfer orders the orders 13-16 in Table U) except possibly at the end of the period C moves without omitting anvthinq and without ever going twice over the same ground (within one period of this type). It is in this sense only that the process is static: Substitutions, i.e. changes in the memory (hence either in the storage or in the orders), occur at every step. In addition, partial substitutions (by the Sp type substitution orders the orders I8rl9 in Table II) cause a slight deviation from strict linearity: They affect orders (the ones which are to be modified by substitu- tion) which may not have been coded yet. In this situation it is best to leave in the substitution order the space reserved for the position mark of the order to be substi- tuted (in the preliminary enumeration, cf. below) empty, and mark the substitution order as incomplete. After all orders have been coded, all these vacancies can be filled in. These fillinq-in operations can be effected within a single linear passage over the entire coded sequence.

The coding of such a box occurs accordingly as a simple linear sequence, and it is therefore necessary to define a system for the enuineration of the ccJde orders within the sequence (oif this box). We call It the preLiminary entmeration, because the numbers which we assign at this stage are not those that will be the x's of the actual position in the selectrdn memory. The latter form tt^e final enumeration to be discussed further below. The preliminary enumeration Is def'ned as follows: The symbol of the box under consideration is to be shown, then a conni&, and then an Arabic numeral the latter being ssed to enumerate the code orders of this sequence. (We might again allow the rules for sequencing, subdividiog, modifying and correcting as given in Note I in 7.4, for this enumera- tion, too. It will, hc*wver, hardly ever be necessary to have recourse to these there will almost never be any difficulty in carrying out a sltnple linear nuwtoering of the entire sequence pari passu with its coding.}

Thus the enumeration for a box II. 1 might be II. I, I; 1 1. I, 2; ... Actually these symbols wi 1 1 be written under each other, and the box symbol' (N.I in the above case) need be shown only the first time. In every order the expression S(x) wi 1 1 have to be written with the ful I prel iminary symbol of x, e.g.; $t||. | 3). (This exanple must, of course, be thought of as referring to a selectron position x containing an onjer. If x contained a number, an expression like S(A. 1,2) would be typical. )

References to a variable remote connection are best made by its Greek letter (possibly with decimals, cf. Note I in 7.4, and with or without indexing acconding to whether the entrance or the exit istneant), since it ray not be feasible or convenient to determine at this stage the Identifications of its parts With the app opriate (Ftoman numeral ) boxes.

Any storage that becomes necessary in the course of this codinq (In excess of the tabulated or distributed storage of the flow diatjram, I.e. the storage attached to the box, cf. the last part of 7.8), has to be shown separa^y, as

22.

local storaee. The local storage should be enumerated in the same wav as indicated above, but with a symbol s after the cotrma, e.q. : 11. I, s.l; II. I, s.2- ... (For an S(x) which refers to such a position one miaht wi-ite, e.q. Sill. I, s.2), in the sense of the suggestion in the precedinc paragraph. However, since the referance is by its nature to the box under consideration at the time, it is legitimate to abbre- viate bv omitting the box symbol, writing e.g. S(s.2).)

The codina itself should be done in a column of its own, enumerated as indicated above. It is advisable to parallel it with another, explanatory, column,, which shows for each order the effect of th e substitution that it causes. This effect appears, of course, in one of the following places: The accumulator (syrrtol: Ac), or the arithmetical register (symbol: R), or some storage position or coded order (symbols as described up to now). The explanatory column then shows each time the symbol of the place where the substitution takes place, and its contents after the substitution. The Cu or Cc type transfer orders (the orders 13-16 in Table I ) cause no substitution, thev transfer C instead (and they occur only at the end of the sequence) hence thev require no explanation.

An order in the sequence, which becomes effective in a substituted form (substituted bv an earl ier order in the sequence), should be shown in its ori- ginal form and then, in brackets, in its substituted form. The oi'iginaf form may have a -, the sign of irrelevance, or any other symbol (e.g. the number 0, of course, as a 12 digit binarv), in place of its x (in its S(x) ). It is this form which matters in the actual coding. (In writing out a code, it is best to use the sign of rrrelevance in such a case. When it comes to real coding, however, an actual number niust be used, e.q. 0.) The substituted form, on the other hand, is clearly the one which will actually control the functioning of the machine, and it is the one to which the explanation should be attached.

We repeat: We feel certain that direct, linear coding according to this principle presents no difficulties after a moderate amount of experience has been acqui red.

Fourth: The last stage of coding consists of assigning;al I storage positions and all onders their final numbers. The former may be enumerated in any order, say linearly. The latter may then foitow, also in a linear order, but with the following restriction: The flow diagram indicates that a certain box must follow immediately after another operation box, or inrmediatel y after the - branch of an alternative box. (- is the case where the transfer of C by a conditional transfer order type Cc does not become effective). In this case the sequence of the former box must begin inTr\ediatel y following the end of the sequence of the latter box.- It can happen, that this principle requires that a box be the imme- diate successor of several boxes. In this caie all of the latter boxes (except one) must be terminated by (unconditional ) transfer orders to the former box. Such a transfer onjer is also necessary if a box requires as its immediate successor a non-initial order of another box.

At this stage the identification of every part (entrance and exits) of every variable remote connection with appropriate (Roman numeral) boxes (i.e. orders in them) must be established. The Greek letter references to. these connections will then be rewritten accordingly.

These principles express all the restrictions that need be obsen/ed in the final, linear ordering of the boxes. To conclude, we note that it nust be remembered, that two orders constitute together a word, i.e. that they have together one final number, and are distinguished from each other as its "left" or "right" order.

23.

After this final enumeration has been completed, one more task remains: In every order, in the expression S(x) the preliminary number x must be replaced by the final number x, and for those orders which substitute positions that are occupied by orders (orders without or with primes these are the onders 13-16 and I8, 19 in Table ill the distinction between "left" and "right" must be imde (i,e. the order must not be primed or it must be primed, respectively). In the case of positions which correspond to the exits of one variable remote connection it is clearly necessary that they be all "left" or ail "right". This must be secured; the ways to achieve this are obvious.

When the coding is thus completed, the positions where the sequence of orders begins and ends (corresponding to i and e, cf. the end of 7.fi), should be noted. There wil I be more to say about these when we get to the questions of subroutines and of combining routines, tc which reference will be made further below, but we wi 1 1 not go into this matter now.

All these things being understood, it is indicated to state this in addition: There are still some things which have to be discussed in connection with the coding of problems, and which we have neglected to consider in this chapter, and will afso disregard in the chapters which follcw in this Part II of the report. We refer to the onders which stop the machine, to the orders which control 1he magnetic wire or tape and the osci I loscopic output of the machine, and to the logical principles and practical methods applying to the use of the magnetic wire or tape inpi/ts and outputs as a subsidiary memory of the machine.

We made brief references to these matters in the paragraphs 4-5, 4.8, 6.8 (and the sub-paragraphs of the latter) in Part I of this report. They require, of course, a much more detailed consideration. That we neglect to take them up here, in Part II of our report is neve rt hie I ess deliberate. The main reason for this neglect is, that they depend on parts of the machine where a number of decisions are still open. These are decisions which lead only to minor engineering problenB either vsay, but they do affect the treatment of the three subjects mentioned above (stop orders, output orders, use of the input -output as a subsidiary memory) essentially. So the corresponding discussion is better withheld for a later report.

Furthermore, the two first items are so simple, that tney do not seriously impair the picture that we are going to present in what fcl lows. The potentialities of the third item are much more serious, but we do not knew as yet, to what an extent such a feature wi I I be part of the first model of our machine.

There are further important general principles affecting the efficient use of coding and of routines. These are primarily dealing with general routines and sub-routines and with their use in coinbining routines to iiew routines. These matters will be taken up, as far as the underlying principles are concerned in Chapter 12, and put to practical use in various examples, with further discussion in the sub- sequent Chapters 13 and | 4. In the immediately following Chapters 8 - II, we wi 1 1 give examples of coding individual routines, on the basis of the general principles of this Chapter 7.

2^.

8JQ CODING OF TYPICAL ELEMENTARY PROBLEMS.

8.1 In this chapter, as well as In the followinq ones, we will apply the^general principles of coding, as outlined in Chapter 7, to a sequence of problere of gradually increasing complexity. The selection of these problems was made primarily with the view of presenting a typical selection of examples, on which the nain problems, difficulties, procedures and simplifying and labor saving methods or tricks of the actual coding process can be exhibited and studied. They will be chosen from various parts of inathematics, and some of them will be of a more logical than mathematical character. After having progressed from simple problems to complicated ones withia

the category of those problems which have to be coded as units, i.e. without breaking up into smaller problems, we will proceed to problems which can be broken up into parts, that can be coded separately and then fitted together to code the wholer problem.

8.2 Before we start on this program of coding specific problems, however, there remains one technical point that has to be settled first.

In all the coding that we are going to do, referenfces to specific memory locations will occur. These locations are 2"=i4,096 in number, and we always eninerated them with the help of a 12 binary digit number or aggregate, which we usi^lly denoted by x. (Cf., e.g. through the Table 11 of orders.) We will use for this 12 binary digit nirter or aggregate, in all situations where it may occur, the generic designation of a nenoryi position mark, or briefly position mrk. By call ing

it ambiguously number, aggregate or mark, we have purposely avoided the cftiestion whether and how we wish to attribute a binary point position to this digital aggregate. Vfe now rake the choice in the rost convenient way: Let the binary point be at the extreme right, i.e. let the position niarks be integers. Thus the position marks

correspond to all 12 binary digit integers, i.e. to all (decimal) integers from

0 to 2'"-! = 4,095.

This choice, however, is not entirely without, consequences for the way in which the position marks themselves must be placed into the nemory, and manipulated arithmetically by the machine, whenever such operations are called for. The point is that the machine will not handle integers as sufch, but only numbers between -I and I. Furthermore, in order that a position mark x that is stored in the memory should become effective, it is necessary to substitute it into some order. This involves bringing it from its storage position into the accumulator (by an order S(y)—> Ac + [abbreviated: y] , assuming that the storage position in question has the mark y), and then make a partial substitution from the accumulator into the desired order (by an order Ap— > S(z) or Ap' -^ S(z) [abbreviated: zSp or zSp'] , assuming that the order to be substituted has the position mark z).

If we followed the explanation of these orders (Nos. 18, 19) given in Table I or in 6.6.5 in Fart I of this'report, then both orders would move the left-hand 12 digits of the accumulator into the proper places at z (into the left- hand 12 digits of the left-hand or right-hand order there, i.e. into digits I to 12 or 21 to 32 [from the left] in that word). Now the position mark to be moved, x, is according to the convention that we have chosen, an integer. Digit I in the accumulator is the sign digit, while digit I (= 2, ..., W) there has the positional value 2"('"').

25.

Therefore the acrijrHilator should actually contain not x itself, but 2"*^ x (modulo 2). Hence x should be stored in the memory (at y, cf . abwe) as 2" x (modulo 2).

From an engineering point of view It is preferable not to involve the siqn digit of the accunulator into these transfers, and not to effect both transfers (into the left-hand orders and into the right-hand orders) from the same 12 accumu- lator digits. This motivates the change which we nade in Table il» as against Table I, for these orders 18, 19: We effect these two transfers fron the digits 9-20 and 29-40 (fron the left) of the accumulator, respectively.

In view of these changes it is desirable to have in th*> accumulator the 12 digits of x both at thp digits 9 to 20, and at the dirjits 29 to HO, when the substitutions of the type under discussion are being effected. I.e. the accumulator should contain 2"^* y + 2"*° x.

We define accordingly:

A(memory) position mark x is always a 12 binary digit integer, i.e. a (decimaH integer from 0 to 2^^ - I = 4,095. Form

xo ^ r" X . 2-="' X.

Then whenever x has to be stored in the memory, or in any manner ooerated on by the machine, it has to be replaced by the number Xq given above.

The symbols introduced in Chapter 7 to denote storage positiorTs for the tabular or distributed storage (English capitals with decimals, cf. the beginning of 7.7) or the local storage (Roman numeral with decimals [denoting operation or alter- native boxes] followed by an s and a decimal, cf. the latter part of 7.9) or for remote connections (Greek letters with decimals, cf. Note I in j.n) will be considered to be position marks, i.e. inteaers x, and treated accord innly, in the sense of the abcA/e rule.

8.3 We now take up oir first actual coding problem. This is a very elementary problem, of a purely algebraical character and presenting no logical complications whatever.

Problem 1.

The constants a, b, c, d, e and the variable u are stored in certain, given, memory locations. It is desired to form the expression

a U9 + b u + c V =

d u + e

and to store it at another, given, memory location.

The problem is so simple that it can be coded directly, without a flo( diagram. Wte may, therefore, attribute all storage to a single storage area A, and all operational orders to a single operation box i . (Both of these are, in a way, "fictitious", since we do not draw a flow diagram.)

26.

Accordingly, let the constants a, b, c, d, e be stored at A.) to 5, the variable u at A. 6, the (desired) quantity v at A. 7. fote that u is a free variable, a to e are constants whi<!li may be viewed as free variables, while v is produced by the machine itself and the content of A. 7 at the start is therefore irrelevant.

Obviously the expressions that will have to be forired successively are:

1) au, au + b, au* + bu = (au + b) u, aifi + bu + c.

2) du, du + e.

3)

V =

ahr-+ bu + c d u + e

intermediate, i.e. local, storage is needed for whichever of the two quantities a'i^ + bu + c and du + e is computed first, while the second one is obtained. However, at this stage A. 7 i? still available (v is not formed) arid may be utilized for that storage. It is convenient when the division of 3) begins to have its dividend au2 + bu + c in the accumulator. Hence I) should immediately precede 3). Therefore I) to 3) should be taken up in the order 2), I), 3).

Some additional local storage is required for a certain quantity in transit, at a moment when A.? is no longer availzble. (This quantity is au + b, which has to mfve from Ac to R, while A. 7 is occupied by du + c. Cf. the orders 1,8,9 below.) This requires an additional storage position A.S-

The entire coding is static, and may be arranged as follows:

Storage at the beginning;

A.I

a

A. 4

d

A. 7

2

b

5

e

8

3

c

6

u

Coded sequence (preliminary enumeration), detailed form: (Coding Column.) (Explanatory Column. )

J

S(A.4) -^ R

2

S(A.6) xR-*A

3

S(A.5)-^ *h +

4

At-^ S(A.7)

5

S(A.I)-* R

6

S(A.5) xR-> A

7

S(A.2)-* Ah+

8

At-^ S(A.8)

9

S(A.8) -* R

10

S(A.6) xR--y A

II

S(A.3) -> Ah +

12

A - S(A.7)-^R

13

R— >• A

14

At— yS(A.7)

R

d

Ac

du

Ac

du + e

A.7

du + e

R

a

Ac

au

Ac

au + b

A.S

au + b

R

au + b

Ac

au2 + bu

Ac

au* + bu + c

au2 + bu + c

R

V = du +. e

Ac

V

A.7

V

27.

Note, that 1,1-4 corresponds to 2) aba/e, 1,5-11 to I), and 1,12- m to 3). In al] the codings which follow we will use the abbreviated notation of the Table II of orders. Then the above coded sequence (preliminary enunerat ion) assines the following appearance:

M

A. It

R

2

A. 6

X

3

A. 5

h

U

A.7

S

B

A.l

R

6

A. 6

X

7

A. 2

h

8

A. 8

S

9

A. 8

R

10

A.6

X

il

A, 3

h

12

is

A.7

A.7

A S

R

d

ic

du

Ac

du + e

t.7

du + e

R

a

Ac

ail

Ac

an + b

A. a

ai) + b

R

ail + b

Ac

an' + bu

Ac

aii» + bu + c

R

y . ai!2 + bu + c du + e

Ac

V

A.7

V

The passage to the final ennmer at ion consists of assigning A. 1-8 their actual values, and of pairing the 14 orders 1,1-14 to 7 words. Let the latter be 0 to 6, and let A.l-b be 7 to m. 'I'hen the coded sequence becomps (the explanatory column is no lonoer needed):

Q

10 R ,

12 X-

5

9 h ,

13

1

1 1 h ,

13 S

6

A ,

IS

2

7 R ,

12 X

7

a

3

8 h ,

14 S

8

b

4

14 R ,

12 X

9

c

10

d

II

e

12

u

13

-

14

-

In an actual application or this coded sequence the constants (or parameters, or free variables) a toe and u, occupying the locations 1, .., 12, would, of course, have to be replaced by their actual, nu^rical values. The other locations, I, ..., 6, on the other hand, will have to be coded exactly as they stand.

These remarks (concerning constants, or parameters, or free variables) apply, of course, equally to all coded sequences that we will set up in the remainder of this report. (Cf., however, the remarks on subroutines and on cortining routines in ClHPter 12. which have a certain significance in this respect.)

8.4 We introduce next a slight logical twist into Problem 1. Prrtie^ 2.

Same as fVoble-^ I, with this change: li and v are stored or to be stored at certain locations m and n, which are not given in advance, but stored at certain, given, memory locations.

28.

This affects the use of storage, but we must reconsider the use of A. 1-8.

A flow diagram is still not necessary,

A. 6, 7 are no longer needed for u, v, however, we still need A. 7 for local storage (cf. 8.3). L^t m, n be stored at A. 9, 10, of course, in the form irio, no (cf. 8.2).

When we will pass from the prelininary enumeration to the final one, the following observat i ons w i 1 1 apply: First, A. 6 is missing, but this is irrelevant. Second, the positions m, n are suppoeed to be part of some other routine, already in the machine, therefore they need not concern us at this stage. Third, let us assume that the coded sequence is supposed to begin at some position other than 0, say 100, and that it is supposed to end at a prescribed position, say 50.

The abbreviated, preliminary coded sequence I ,1-14 will therefore have to be modified in two ways: First, the references to A.6 (which transfer u) and to A. 7 (inasmuch as they transfer v, and are not due to the use of A. 7 for local storage) have to be changed. .Since u is needed repeatedly, it is advisable to assign to it a fixed position A.ll . Hence I ,2, 6, 10 will have to refer to A.I I fnstead of A.6, and new orders will be needed to get u from m to A.ll, and (replacing I;, 14) to get V from Ac to n. Second, a new order is needed at the end of the coded sequence to qet the control to the desired endpoint 50.

The ctenges in 1,2, 6, 10 are trivial.

The transfer of u may take place at any tire before 1,2. 1,2 assumes that d is in R, so this transfer must either precede I ,1, too (since this moves d to R), or leave R undisturbed. R is indeed not disturbed but we place the transfer routine nevertheless before I J. It can be coded as follows:

1 ,0.1

A. 9

.2

1,0.3

.3

-

[

m

.4

A.I 1

Sp

Ac 1,0.3

Ac A.ll

1^ m

u u

Note that the sign of irrelevance in an order, like I ,0.3 above, does not trean that the entire order, i.e. the entire half-word is irrelevant (and still less, that the entire word is irrelevant). It means that an order S(x)— > Ac , abbreviated x, is needed, but that x is irrelevant.

The transfer of v replaces the order I ,14. 1,14 assumes that v is in Ac, so the operations required by this transfer must either precede J, I-I4 (since all of these are needed to produce v in Ac), or leave Ac undisturbed. Ac is distirbed, so it is necessary to place the tra^isfer routine before 1,1. It is simplest to let it follow inmediately after oir first transfer routine, ie. immediately after 1,0.4 abo/e. It can be coded as follows:

,0.5 .6

A. 10

Sp

Ac 1,1'+

n

29.

[

l,m, in turn, met be rewritten as follows:

S

S]

Final Iv, we need an order after 1,14, to mo/e the control to the desired endpoint 50. ^his is, of coirse:

1,15

50 C

We can now rewrite the abbreviated, prel it^inarv coded seqience!

m

u

n

V

A.J

a

2

b

Storage at the beginning:

A. 3 4 5 7

c d e

A. 8

9

10

Coded seqtence (preliminary eniineration):

,0.1

A. 9

'2

1,0.3

Sp

.3

m

]

.1^

A. II

S

.S

A. 10

.€

1,14

SP

1

A. 4

R

2

A. II

X

3-

A. 5

h

1

A. 7

S

5

A.I

R

6

A. II

X

7

A. 2

h

8

A. 8

S

9

A. 8

R

10

A. II

X

II

A. 3

h

12

A. 7

^

13

A

m

-

S

n

s ]

15

50

c

n„

Ac

nV)

1,0.3

m

Ac

u

A. II

u

Ac

"o

1,11*

n

S

R

d

Ac

du

Ac

du +

e

A. 7

du +

e

R

a

Ac

au

Ac

ail +

b

A. 8

au +

b

R

ail +

b

Ac

aii^

+ bii

Ac

aii^

+ bu + c

R

V =

au' + bu + c du + e

Ac

V

The passage to the final enumeration consists of assigning A. 1-5, 7-11 their actual valies, pairing the 21 orders 1,0.1-15 to II words, and then assigning 1,0.1-15 their actual valies. Vte treat m, n 1 ike a to e or n: As free variables or constants. The II words in qiestion -nust begin with 100, so they will be 100 to 110. Then A. 1-5 may be III to 115, and A. 7-1 1 may be 116-120. So we obtain this coded sequence:

30.

100 iOI 102 103

105 i06

18 ,

IOI Sp

~ »

^2o s

19 ,

109 Sp'

(1+ R,

120 x

15 h,

116 S

II R,

120 X

12 h,

117 S

107

108

109

110

III

112

IJ3

117 113

50 a b c

120 X 116 -

- S

l|ti 115 116 117 118 119 120

d e

^

Note, that the sign of irrelevance in an order, like lOI-left, means that it is an order x (i.e. S(x)-^ Ac) with x arbitrary. This is exactly the same situation as in 109-right, which is -S, i.e. x S (I.e. At ^ S(x) ) with x irrelevant. On the other hand, llO-right, marked - -, is actually entirely irrelevant, since this half-word was not needed for any of our orders. Finally the sign of irrelevarve in a full word, like 116 or 1 17 or 120, neans, of coirse, that the entire content is irrelevant. The simplest treatment of all these irrelevancies is to replace anything that is irrelevant by 0

8.5 The coding of any problem should be followed by an estimate of the time that the machine will consume in solving the problem, i.e. in carrying out the instrictions of the coded seqience.

In order to make such an estimate it is recessary to have some information about the duration of each step that is involved, i.e. the time required by the machine to carry out each one of the orders oi Table II. At the present stage of our engineering development the order-time estimates are necessarily guesses. The estimates which follow are made in a guardedly optimistic spirit. Unless there are some major sirprises in our engineering de'elopnents, they should be correct within a moderate error-factor ~ say, within a factor 2.

In this sense our ordrr-time estimates are as follows:

TABLf III

1

2 3 4 5 6 7

X 25 n X- 25 xM 30 x-M 30 xh 30 xh- 30 XhM 35

8 xh-ri

9 xR

10 A

11 xX

12 x^

13 xC m xC

35 n

25

5

100

150

25

25

15 16 17 18 19 20 21

xCc

xCC

xS

xSp

xSp'

L

R

30 ti

30

25

25

25

5

5

plas

20 li for every word

1 ti =

1 microsecond, 1 m =

= I mill isecond.

Considering the considerable uncertainties with which these estimates are affected, we might as well use the following approximate rule:

31.

Count 75 u for every word which contains two orders, subtract 25 \i if only one order is iised, subtract 20 ^ for every order which refers to no neniory position X (i.e. A, R, L), add 70 u for every mult ipl icat ion and 120 u for every division.

require

and

respectively.

On this basis the coded sequences obtained in 8.3 and 8.4 should (7 X 75 - 20 + 3 X 70 + 120) n = 835 n ci -8 m, (II X 7b - 25 - 20 + 3 X 70 + 120) u = 1 , 1 10 ^i c^ I.I m,

8.6 The next point to consider in connection with our coding of the Problems I and 2 is this:

Wr observed repeatedly that our machine will only deal with numbers lying between -I and I. Ordinarilv we will interpret this to exclude both endpoint?. , i.e. we will keep all absolute values < I. it should be noted, however, that the precise definition of the numbers that oir machine can handle as digital aggregates (cf. 5.7 in Part 1 of this report) irrludes -I and excludes I.

This fact, that we have a -I but not a 1, is occasionally of i-portance. Actually this is not often the c^se, indeed extremely less frequently than one might think. There is hardly ever a need to store a I: Its effect in mi'ltiplying or dividing is nil, and the sizes which we wisli to observe make it uswl'v inconvenient to manipulate. Regarding position marks, where I night play a role, cf. 8.2. Regarding induction indices, cf. Problem 3 in 8.7 as v/ell as various subsequent Problems.) In t^ose excep- tional cases where I is actually arithmetically needed, it is always possible to adjust the operations so that -I can be used instead. (For an example of this cf. Problem 9 in 9.9, in particular the treatment of the box III C.2 and III, I as well as sif^ilar situations in the boxes VI, IX, XII, XV.) The complications which arise in this manner are very rare, and when they occur, negligible, as the experience of our Problems amply illustrates.

In the present case, we will keep all absolute values < I. It is in this sense, tlierefore, that we observe that the above problems can only be handled if their u and v lie between -| and I. Firthernore, our procedure of 8.3 (and 8.1) also requires that all data of the problem, i.e. the constants a to e should lie between -I and I , as wel 1 as ill intermediate results of the calculation, i.e. the expressions

1) au, au + b, au5 + bu, aus + bu + c,

2) du, du + e.

Now assume that u is only known to lie between -2^ and 2**, v between -2'' and 2^^, and a to e between -2^ and 2'' (p, q, r = 0, 1 , 2, ... ). Then the quan - tities a to e and u, v simply cannot be stored by tie machine, end it is necessary to store others instead, e.g.

a' = 2'''a e' = 2'^e, u' = 2"^"-, V = 2"''v.

32.

This, however, is not-, an answer to our problem since the relationship

between ii' and v' is not expressed with the help of a' toe' in the same manner as the

relationship between r and v with the telp of a to e. Hence we have to proceed some- what more circumspectly.

This is not difficult. Our original relation aiig + bu + e

V =

impl ies

where if

du + e

a* u'g + b* ii' + c* d* II' + e*

ii' = 2"P|i, v' = 2'''v,

a* = 2'-9-9-Sa, b* = 2P-''-Sb, C* = l-^'^c, d* = l^'^d, e* = 2-^e,

where s= 0, + I, + 2, ... can be freely chosen. We can row use oir freedom in choosing s to force a* to e* as well as the expressions

I*) a* n', a* ii' + b*, a* u'^ + b* ii', a* u'2 + b* ii' + c*,

2*) d* II', d* u' + e* into the interval -I, I. Since

a* u'g + b* u' -t- c* d* u' + e*

< i,

we may disregard the last expression ir I*), i'f all others are taken care of. Since I u' I < I, it suffices to secure

|a*| , |b*| ,|d*| , |e*| < i ,| c*|< I .

This means that

s I 2p-q + r+ i,p-q + r+ l,-q + r,p + r+ l,r+ i.

Hence we may choose

s=htex (ip-q+r+ l,p+r+ l)=p+Max(p-q, 0)+r+ I.

This procedure is typical of what has to be done in more complicated situations. It calls for some remarks, which we proceed to formulate.

Fit^t; a to e and u are data, and it is therefore natural that we have to assume that some information, which is separate from this calculation, exists regarding their sizes. (I.e. that they lie between -2^ and 2"", and between -2^ and 2^, respectively.) v, however, is determined by a to e and u, so its limits (-2'' and 2'') should be derivable from the information that exists concerning a to e and u.

33.

In some cases this information need not be more than what was stated above concerninq their ranges (-2'' to f for a to e, -2^ to 2^ for u), in others it may require addi- tional information. But in any case the problem of foreseeing the sizes rf the quantities which the calculation w 1 11 produce (as intermediate or as final results), should be viewed as a mathematical problem In its own right. (Cf. the discussion of the "first stage" or preparing a problem, in 7.9.) This problem of evaluating sizes may be trivially simple, as in the present case; or moderately complex,, as in most problems that require extensive calculations; or really difficult, as e.g. in various partial differential equation problems. It r^y even be, from the riathemat ical point of view, the crux of the whole problem, i.e. the actual problem may require more effective calculating than this subsidiary, evaluational problem, but the latter may require more matheratical insight than the former. This can happen for very important and practical problems, e.g. it is so for n simultaneous linear or non-linear equations in n variables for large values of n. (We will discuss this particular subject elsewhere,) To conclude, we note that the estimation of errors, and of the precision or significance that is obtainable in the result, is quite closely connected with the estimation of sizes, and that our above remarks apply to these, too. (All of these are covered by the "first stage" discussed in 7 3, as referred to abcve.)

Second: Under suitable conditions it may be possible to avoid the mathematical analysis that Is required to control the eizes (as described above), by instructing the machine to rearrange the calculation, either continuously (I.e. for every number that is produced) or at suitable selected critical moments, so that all scales are appropriately readjusted and all numbers kept to the permissible size (i.e. between -I and 1). The continuous readjusting is, of course, wasteful in time and memory capacity, while the critical (occasional) readjusting reqoires more or less mathematical Insight. The latter is preferable, since it Is almost always Inadvisable to neglect a mathematical analysis of the problem under consideration.

Examples of how to code the instructions to secure critical size readjustments in various problems will be niven subseqiently .

I'hirtl: The process of ocntinuous readjustment can be automatized and built into a machine, as a floating binary point. We referred to it already in 6.6.7 In the first part of this report. We formulated there various cr it Icisre which caused us to exclude this facility, at any rate, from the first model of our machine. The above discussion reemphasizes this point: The floating binary point provides continuous size readjusting, while we prefer critical readjusting, and that only to the extent to which it is really needed, i.e. inasmuch as the sizes are not foreseeable without undue effort. Besides the floating binary point represents an effort to render a thorough mathematical onderstanding of at least a part of the problem unnecessary, and we feel that this is a step in a doubtful direction.

8.7 Let us now extend the Problems I and 2 In a different respect. This extension wil 1 bring in a simple induction, and thus the first complication of a logical nature.

Problem 3.

Same as Problem I with this change: The calculation is desired for I values of u: Ui, ..., u^, giving these v's: Vj , ..., v-^ , respectively. Each pair Uj, Vj (I = I, ..., I) is stored or to be stored at two neighboring locations

34.

m + 2i-2, m + 2i-l, the whole covering the interval of locations from m to m + 21- I. n and I are not given in advance, but stored at certain, given, nenory locations.

This is the first one of our Problems to require a flow diagram. We will therefore apply the principles of Chapter 7, and more particularly of paragraph 7.9, to their full extent, and avoid any shortcuts that were possible in connection with our two previous problems.

Let A be the storage area corresponding to tlie interval of locations from m to m + 21- 1 . In this way its positions will be A. I, ... 21, where A. j cor res ponds to m + j-l (j = I, ..., 21). These positions, however, are supposed to be part of some other routine, already in the machine, and therefore they need not appear when we pass (at the end of the whole procedure) to the final enumeration of the coded sequence.

Let B be the storage area which holds the given data (the constants) of the problem: a to e and m, I. m is a position mark, we will tberefofe store rio instead. I is really relevant in the comfcination m + 21, which is a position mark (the storage area A is an interval that begins at m and ends just before m + 21), we will tlierefore store (m + 21 )o instead of I. We store a to e at B.I, .., 5 and iHo, (m + 21 )o at B.6, 7. Finally, storage is required for the induction variable i. i is really relevant in the combinations m + 2i-2, m + 2i-l, which are position narks (for A.2i-I containing U; and for A.2i designated for Vj), vie select m + 2i-2, and we will store (m + 2i-2)o instead. This will be stored at C.

These things being understood, we can proceed to drawing the flow diagram. We will use tabulated storage. A.2i-I (i = I, ..., I) and '^.l, ...,7 are the fixed storage (the Uj and tlie a, ... , e, m, I, respectively), while A.2i (i = I, .., I) and C are tlie variable storage (the Vj and i, respectively). The complete flow diagram is shown in Figure 8.1.

FinURE 8.1

©-

HI

3

>- d.u;.+e (•m + 2L)o +o C

a,b, c,cL,e

1

U5

2

3

A. 21'

V^ifoH u'<L

-foR L' > L

V-j^l f O R L' ^ "t.

C

rr\o

(Tn+2l-2)o

frn+2l)o

A,2l'-I

U;.

B.I

a

2

b

3

c

M-

d

5

e

6

^o

T

(l^+2IJt,

35.

We are left with the task of rloing the static coding. T^^is deals with the boxes I to III. We begin with the preliminary enirierations.

1,1 2

The coding of I is obvious:

B.6 C

Ac C

1^

The coding of 1 1 is also quite simple, we must only observe that (m + 2i-2)o - (1^ + 21)0 has the same sign as i-I-1. The code follows:

11,1 2

C B.7

h- Cr

Ac

(n+ 2i-2)o

Ac

(n + 2i-2)o (n>+2I)o

problem.

Here e is the position at which want the control to finish the

The coding of III is effected mainly after the pattern of Problem 2- This applies to it inasmuch as it produces v- the additional task of producing (m + 2i)o is trivial. There is, hoever, this to be noted: In these operations (m + 2i-2)o '^"st be I'sed to produce (m + 2i-l)o, and (m * 2i)o Hence the number Iq is needed. This number mist be stored somewhere. This is not exa(^tlv local storage, becawse we are not dealing with a transient soace reqt.'iremsnt of III. It is fixed storage, and we assign to it the position B.8. Hok-' the coding ran be done as fol lows:

111,1

4 5 6

7 8 9

10 11 12 13

n

15

16 17 18

19

20

21

c

111,3

Sp

m + 2i-2

S.I

s

C

?.8

h

IM,22

Sp

B.8

h

C

s

^.^

R

S.I

X

P.5

h

s.a

S

8.1

R

S.I

X

P.2

h

S.3

S

S.3

R

S.I

X

P.3 S.2

Ac

(n+ 2i-2)<5

III,

3

(m + 2i-2)o

Ac

Wj

s.l Ac

"1

(ni + 2i-2)o

Ac

(m+ 2i-l)o

Ml,

22

m + 2i-l S

Ac

(m+ 2i)o (n)+ 2i)o

C

R

d

Ac

duj

Ac

duj ■* e

s.2

diij + e

R

a

Ac

auj

Ac

auj + b

s.3

auj + b

R

au: + b

Ac Ac

^'1

+ bu

aiR + bu: + c

aiR +

I

bU: + C

dU:

36.

[

1,22

m + 2i-l 11,1

S

S ]

c

1 1 1 ,23

We had to use some local storage: s.l-3.

A.2i

We now pass to tfie final enumeration, assigning B.I-8, C ar<j s.l-3 their actual values, oairing the 27 orders 1 1,1 , 2, 11. 1-3, 111 1,1-22 to 14 words, and then assigning ,1,1 ,..., |l 11,22 their arti'al values. Let these 1 4 words be 0 to 13, then 8.1-8 may be 14 to 21, C rrey be 22, III., s.l-3 may be 23-25, and we can put e equal to, sav 26. So we obtain this coded sequence:

0

19 ,

22 S

1

22 ,

20 h-

2

26 Cc,

22

3

3 Sp',

-

4

23 S ,

22

b

2! h ,

13 Sp

6

21 h ,

22 S

7

17 R ,

23 X

8

18 h ,

24 S

9

m R ,

23 X

10

15 h ,

25 S

II

25 R ,

23 X

12

16 h ,

24 -

13

- s ,

i C

14

a

15

b

IB

c

17

d

18

e

19

"b

20

("'+21)0

21

io

22

-

23

-

24

-

25

-

The durations mav bp estina+ed as follows:

I : . 75 u, 1 1 : (2 X 75 - 25) ^i = 125 u- Ml : ( 12 X 75 - 25 + 3 X 70 + 120) n = 1 ,205 u. Total: I + II + (II +111) X I = (75+ 125 + (125+ 1,205) I) n = = (1330 I + 200) ^i•al.3 I m.

d-6 We give now an example of how to code instructions for a critical readjustment, as mentioned in the second remark in 8.6.

Prrtlerf 4^

TNe variables u, v are stored in certain, given locations. It is desired to form )^ and to determine its size, in thp following sense: Find the integer n ( = 0, ± I , + 2, ...) for which 2"'^ g 1^1 < 2", and t!ien form w = 2"^^ If . This scheme will fail if either u or v is zero, sense w:etlier this is the case .

We coijld also require that other things, e.g. tlie number of significant digits in 'u and v, be determined. But we will not introduce these additional compli- cations here, they can be handled along the same 1 ines as the main problem.

In our machine u, v =|= 0 imply 2~** ^ | u| ,| v| < I , hence 2-3S < I JL| < 2"^°", hence -38 ^ n g 33 . V,^ will therefore signalize v = Q with n = 50, and u = 0 (and v^: 0) with n = -50. We will begin the calculation by sensing whether v = 0 and whether u = 0. This is derided by testing - | v| ^0 and - I u| ^ 0 . If neither is the case, we <lecide whether n is going to be 1 0 or >0 . "This is done bv testing v/hether |u| - |y| < 0, or not. After this we determine n by two obvious, alternative inductions.

37.

Let u, V be stored at A. 1,2. Since n has t!ie values -38, -37, ..., 39 and -50, 50, we store 2"^*n instead. We store n and 2"" ^ , when thev are formed, at 8.1,2. For II = 0 or V = 0, i.e. when n = -50 or 50, wi.ll not form ^, or rather 2"" If. in th-is case, then, tlie content of 8.2 is irrelevant. In anv case, we denote the content of P. 2 by t.

in searching for n we will need an induction variable i, which will mcve wer 0, -I, -2, ... to n if we have n ^ 0, and OK/er I, 2, ... to n if we have n > 0. It is convenient to treat i the satne way as n: Store 2~^^i instead of i. Since we propose to use distributed storage, we need not enumerate further storage locations, we are free to introduce tiiem as the need for tliem arises, while we are drawing the flow diagram.

These indications should suffice to clarify the evolution and the significance of all parts of the flow diagram shown in Figure 8.2.

The boxes I-XIV require static coding. ?efore we do that, we -nake three remarks, which embody principles that will apply correspondingly to our future static coding operations as well. They are the follcwinq:

First: Some additional fixed storage will be required. These are certain numbers tow^ich specific reference will have to be made, specifically 2"^**50, f",0. We will store them at the positions D.\, 2, 3, respectively. We will state these expl ictly at the points where they become necessarv, by inter- rupting the coding colimn there and stating the storage.

Secxyid: Every box coding eitj-ier ends with an unconditional transfer order (type xC, xC ) or else it involves the assif^ptior that the control goes on frnm there to a definite position. (Ending with a conditional transfer order ~ type xCc, xCc' ~ presents an intermediate case: We have the first one or the second one of the two above alternatives according to whether the transfer condition is or is not fulfilled.) If this latter alternarive is present, tlien this position (i.e. its Roman box numeral and its number within its box) has to be named at the end of the box coding , with a reference "to ...".

Third: W will be found convenient to introdrce an extra operation box, in addition to those mentioned in the flow diagram. The reason is, that two operations which shoOld be carried out in two operation boxes inmediately preceding a confhience, can be merged and carried out after the confluence. (The two boxes in question are XIII, XIV, the new box is XV.)

V*» now proceed to carry oi-t thie static coding of all boxes in one, continuous operation:

Ac -|v|

Ac 2"^ "-50

B.I 2'^''-50

I.I

A.2

-M

2

11,1

Cc

(to MM)

D.I

2-3«.

50

11,1

0.1

2

BJ

S

3

e

C

111,1

A.I

-M

2

IV, 1

Cc

(ioV.I)

Ac - I u|

38.

FIGURE 8.2

:zi

B.I

2-3=

Cl

2-'u.

2

V

I

E

.1

z'

39.

c

1

£'

■^u.

a

V

3nii

ri^4-

a-'utcC^i

l-»l

■>-<^

e u - V

/\

#

JX

t-i- \-^\.

N''

B.I

%-^^-r^

C.I

E"'^ LL

Z

V

1

* I

L = n

^KD

1

6

1

2

-39

(: +

i)

C-

t

a

2"

-u-

V

B

1

0

C.

1

u

2

2"

'v

1

B,

1

2"

39.

c.

1

u

2

2^

-'V

1

XT

B

1

2"

39

TV

C

1

a

2

2^^

-t

V

1

6

8>^

O to B.I

2''vi-oC.2

II <

•o-» L

IS

# 4^

U -

2" V

4-

12

3ir

la

i,-i->i.

2. ^^rt-otoB-i

z'"-"^ V T»C.2

0 =-n

I '4. ^

\/

*

XIII

t=^""^ toB.2

5

312:

&^

t'^^^.S.Z

®

B

1

2

-39

(l-i)

C

.1

u.

z

2

1,-a

V

5

O

/\

1

B. 1

2

2-59^ t

A.I

UL

39.

IV, 1

D.I

2

B.I

3

e

V,l

A.I

2

C.I

3

A.2

«i

C.2

(toVI.I)

VI, 1

A.I

2

A.2

3

VIM

(toX.I)

D.2

2-39

VII, 1

D.2

2

S.I

3

C.i

4

5

C.I

(to VII 1,1)

yiii,i

C.I

2

c.2

3

IX, 1

(to Xlll.l)

IX, 1

B.I

2

D.2

3

P.I

4

C.I

5

6

C.I

7

VIM,

D.3

0

X,l

0.3

2

B.I

3

C.2

If

5

C.2

(toXI,l)

XI, 1

C.I

2

C.2

3

XIV, 1

(to XII, 1)

XII, 1

&.I

2

D.2

3

B.I

^

C.2

5

6

C.2

7

XI, 1

XIII, 1

C.I

2

C.2

s

c

s

s

M

h-M

Cc

R S

M

h-M

Cc

h S

R S

C

R S

M h-M

R S C

Ac 3.1

Ac C.I Ac C.2

Ac Ac

-2-"' -50

,-3 9.

50

u u

V V

|u| -lv|

Ac

B.i

2-3 9

Ac

U

Ac

2-^

C.I

2-^u

Ac

l2-!ul

Ac

|2-'nl -

Ac Ac B.I

2-39 j

2-^^(1 ^

2-=!^(i *

Ac

2-!u

Ac

2-'-^

C.I

2-'-%i

Ac

0

B.i

0

Ac

V

Ac

2-\

C.2

2-\

Ac

l"l

Ac

|U|- 2'

Ac Ac P.I

2-"i 2-^^(i-l) 2:^« i-l)

Ac Ac

2'-\

C.2

2*-\

Ac

2""u

R

t = 2-"u

Ivl

I) I)

I-!,

(to XV, I)

>M).

XIV, 1 2

3

C.I

C.2

R

4-

(toXV,l) XV, 1

2

3

B.2 e

A S

c

Ac

Ac R

Ac

B.2

2-^

t = -XjL

jn-i.

t t

We nc3w proceed to the final enureration. Vfe must l-XV for this purpose in such a manner, that the indications "to Any sequence which is made necessary by an indication "to ... " w a conra, and every sequence which is based on an arbitrary choice semicolon. In this manner we ray set the following ordering: |, XI, XII; II; IV; VII, VIII, Xlll; IX; XIV, XV. The ordering is much as XV should have been the immediate successor of Xlll as we since only one was possible, we chose XIV. Hence it is necessary end of Xlll an unconditional transfer order to XV:

order the boxes

. .." are obeyed.

ill be marked by

is marked by a

III, V, VI, X,

imperfect, inas-

11 as of XIV,

to add at the

Xlll, 8

XV, I

It remains for us to assign A. I ,2, B.1,2, C.1,2, D.I-3 their actual values, to pair the 56 orders 1,1,2, IUI-3, Ml, 1, 2, IV, I -3, V,l-4, Vl,L-3, VI 1, 1-5, Vt1i,l-3, IX, 1-7, X,l-5, XI, 1-3, XII, 1-7, Xlll, 1-3, XIV, 1-3, XV, 1-3, to 28 words, and then to assign |,| ,..., XV, 3 their actual values. Tliese assignments afe sufficiently numercKis to justify making a small table:

1,1-2

0, 0'

XI 1,1-7

9'- !2'

iX.I-7

21 '-2^'

111,1-2

1, 1'

ll>l-3

13- It

HV,l-8

25 -26

V,M

2-3'

IV, 1-3

H*-I5'

XV, 1-3

26'-27'

VI. 1-3

H -5

VII, 1-5

16-18

A. 1-2

28, 29

X,l-5

5'-7'

vm,i-3

I8'-I9'

B.I-2

30, 3)

XI, 1-3

8 -9

Xlll, 1-3

20-21

C.I-2 0.1-3

32, 33 3^-36

Now we obtain this coded sequence:

0

29 -M,

13 Cc

12

33 S,

8 C

24

32

S, ISC'

i

28 -M,

14 Cc'

13

34 ,

30 S

25

32

R

2

28 ,

32 S

It

« C,

34 -

26

33

^, A

3

29 ,

33 S

15

30 S,

e C

27

31

S, e C

H

28 M,

29 h-M

16

35 ,

30 S

28

u

5

16 Co,

36

17

32 ,

R

29

v

6

30 S,

33

18

32 S,

32 H

30

-

7

R,

33 S

19

33 h-M,

21 Cc'

31

-

8

32 M,

33 h-M

20

32 ,

33 ^

32

-

9

25 Cc,

30

21

26 C,

30

33

-

10

35 -h.

305

22

35 h,

30 S

34

2-"' -50

II

33 ,

R

23

32 ,

R

35

2-3<»

36

0

m.

In estimating dtrations, we have to pay attention to some points which did not come up in Problems 1-3, namely: The flow diagram of Figure 8.2 is never traversed by the control C in its entirety. The course of C is, instead, dependent on the behavior of ii, v and n. Specifically, its coirse is as follows:

I, then

for v = 0:

II (end),

for V 4^ 0:

III, then

for 11= 0:

IV (end),

for 11 + O:

V, VI, then

for n > 0:

VII, VIII X n, IX X (n-l), XIII

for n g 0:

X, XI X (-r + 1), XII X (-n), XIV

XV.

The durations of the individual boxes are:

, then

1 :

75 ti

II :

125 \x

III

: 75 M

IV:

125 n

V :

150 u

VI:

125 ^

VII :

180 u

VIII

: 125 u

IX:

255 u

X :

180 n

XI:

125 n

XII :

255 [i

XIII

: 2U5 [i

XIV:

225 u

XV :

105 ti

Hence we have these total dirations;

For V = 0 : 200 Ml = .2 m,

for V 1= 0, u = 0 : 275 ti ss .3 m,

for V + 0, u + 0, n > 0: (380 (n - I ) + 1080 ) u ^ (.4 (n - I )

for vr+ 0, u+ 0, n g O: (380 (-n) + 1060) n ^ (.1 (-n) + I) m.

I)

8.9 It seems appropriate to make at this point a remark on how to correct errors that are discovered at anv stage of coding, incli'ding the possibility that they are discovered after the coding has been completed. Together with correcting actual errors, one should also consider the case where the coding is proceeding, or has been cone 1 Wed, without farlt, when (for any reason whatever) a decision is made to apply certain changes. Charges of both types (i.e. either corrections of actual errors or voluntary transitions from one correct code to another one) fall clearlv into three classes: Omissions of certain parts of the coded sequence; insertions at a certain places into a coded sequence; replacement of a certain part of the coded seqience by another coded sequence (the new having the same le-gth as the old, or a smaller length, or a greater length). The impor- tant thing is, of coirse, that it should be possible to effect such modifications, withoift losing tne result of any of the work done on those parts of the coded sequence which are not to be modified ~ i.e. withoirt anv necessity to "start all o/er again" in whole or in part.

There is, of coirse, no problem if the coding has not yet progressed very far. The dynamic stage, i.e. the flow diagram, is easy to correct: Omissions can be effected by erasing or crossing out the undesirable region, followed by "shorting", i.e. taking the track directly from its inrodiate predecessors to its Imrediate successors. This "shorting" mpy also be achieved by introducing (fixed) remote connections. Insertions can be effected by drawing the new region separately, and then detour ing the track to it and back from it. Again fixed remote connections ray be helpful. Replacerents can be effected by conbininq these two techniques -- provided that simple erasing and redrawing of the affected region is not practical.

42.

Even in the static coding there is no real problem, as long as the stage of the preliminary enumeration has not been passed. Erasing or crossing out, and re- writing at the same place or elsewhere, will take care of everything considering the great flexibility of o(ir methods of (preliminary) enumeration. (Cf. Note I in 7.1^ and the discussion of the preliminary enimeration in 7.9.)

The difficulties arise only when the final emimsration has already been achieved, i.e. when the coded sequence has already been formulated in its final form, or when it has even been put on the magnetic wire or tape. In this case, anv omission, or insertion, or replacement of any piece by one of different length, may force the rewriting of considerable portions of the coded seqience, which may lie in any part of it. Indeed, it will change primarily the physical positions of the words and their (final) numbers, inasmuch as they lie after the region of the changes. If the change in length amounts to an odd number of half words (orders), it will even change the left or right position of all subsequent half words (orders) within their words. Secondarily, it will change the x in all S(x) everywhere in the coded sequence, v/hich refer to words or half words whose position was changed primariW.

Let us discuss how changes are effected on a coded sequence that has been formulated (on paper) in its final enumeration. We will afterwards touch quite briefly upon the treatment of Changes in a coded sequence which has already reached the magnetic wire or tape stage. This latter phase can only receive a prel iminary consideration in this report, since its exact treatment is affected by a number of engineering details which cannot be taken up here. It will become clear, however, that the treatment of this problem is in any event possible along essentially the same lines as the treatment of the first mentioned problem". That one of a coded sequence formulated (on paper) in its final enumeration.

The best way to deal with this problem is by means of a specific example. We will use the final coded sequence solving FVoblem H, as given near the end of 8.8, for this purpose. Our changes Will consist of corrections of actual errors (we will introduce such errors into that sequence), changes which correspond to voluntary transitions from one correct code to another one offer clearly no new problems.

We consider therefore the final coded sequence 0-36 in 8.8. We take up several hypothetical errors and their correctionsi

first: Assume that by some mistake three orders which do not belong in this sequence, had been placed into the three half word positions beginning with the first half of m. They occupy m-15, and our actual orders 14^27' are at l5'-29, and the storage words 28-36 are at 30-38. All references, or the other hand, are correct with respect to this positioning. It is desired to remove the erroneous orders, lU-lb (this is the old notation).

It suffices to replace the order 11 by an unconditional transfer

K 15 C ,

m', 15 may be left standing. After 13' C gets to 14, and does nothing there, but is immediately transferred to 15', vibere it belongs.

Second: Assume that by some mistake the two orders 6', 7 are missing. The actual orders 7'-27' are at F,'-26', and the storage words 28-35 are at 27-35. All references, on the other hand, are correct with respect to this positioning.

H3.

It is desired to insert the missing orders 5', 7 (this is the old notation).

Cnoose a location in the nemorv, where an cniised interval of sirfficient length begins. This may be the first posit io" follok.;ing the coded sequence in question, or any other position. We assime fie former, and choose accordingly 3fi (this is the new notation). We displace the order imediately preceding the missing ones, in the present case 6, and replarp it by an I'ncondit ional transfer

6 36 C ,

Beginning with 36, we add the remoK/ed order 6 as well as the missing orders 6' , 7 , and conclude with an unconditional transfer back to the order itmediately following upon the missing ones. This gives

36 29 S , 32

37 R , 6 C

(The 32 in order 36 is the new notation for the old 33.) If the sequence contained any references to 6 (which does not liappen to be the case iere), they have to be replaced by references to 36.

Third: Assume that certain orders in the c<Jded sequence were erroneotsly replaced by otiier orders. The mmtier of erroneous orders nay or mav not be equal to the nu-Tber of the correct orders which they displace. In the latter case the entire subsequent part of the coded sequence is displaced, birt we assime that at any rate all references are correct with respect to the actial positioning.

If the correct seqience has the same length as the erroneais one, we can simply insert it in the place of the latter. If the correct seqience is shorter, then we insert it, and proceed from there on as in the first case. If the correct sequence is longer, then we insert as much of it as possible, and proceed from there on as in the second case.

It will be clear from the ab(ve, that changing a coded sequence which 13 already on the magnetic wire or tape can be effected according to the same principles. This requires, of coirse, a device which can ihange single words on the magnetic wire or tape. We expect, that the main machine itself, as well as the special typewr iter which produces the magnetic wire or tape under manual control, will be able to do this. This means, that the desired changes can be effected either by the main machine, with appropriate instructions, or by the typewriter, ranuallv. The latter procedure wi 11 probably be preferred in most cases. (Cf. however Chapter 12 , for a somewhat related situation where the first procedire turns out to be preferable.)

8.10 Problems 1-4 were of a somewhat artificial character, designed to illustrate certain salient points of our nethod of coding, but only indirectly and very incompletely typifying actual mathematical problems. From now on we will lay a greater stress on the realism of our examples. We will still select them so that ttey illustrate various important aspects of our coding method, but we will also consider it important that they should represent actiel and relevant mathe- ratical problere. Furthermore, we will proceed from typical parts, whifch occir usually as parts of larger problems, to increasingly completely formulated self- contained problems.

m.

Vfe begin with a code for the operation of square rooting. This is an important problem, because our machine is not expected to contain a square rooting organ, i.e. square rooting is omitted from its list of basic arithmetical operations.

Problem 5.

The variable ti is stored in a given memory location. It is desired to form V = VTT and to store it in another, given, iTEmory location.

V should be obtained by iterating the operation z 5 (z + ^).

This iterative process can be written as follows:

^i+1 = 2 (^i ■" z^ )' ' ' 0, I, 2, ..., lim z- = w = nr .

Two questions remain: First, what should be the value of the initial Zfl"? Second, for what i = \q should the iteration stop, i.e. which Zj may be identified with VIF ? The answers are easy: °

Answer to the first question: Since ws prefer to avoid adjusttients of size, it is desirable that all numbers with which we deal lie between -I and I. u will be between -I and I, and it is necessary to have u ^ 0, hence 0 g u < I. Zj must be between -I and I, and it is desirable to have z■^.i 0, hence 0 ^ Zj < I. Consequently the only numbers, whose sizes must be watched are ^ and Zj + ^ .

The first requires u < z j , i .e. u < z j < I. The second one may be circurvented, by forming the desired i (zj + ^ ) 'n this way: 5 (^i + z^) = 2 ( r" " Zj ) + Zj. Hext clear Iv '

n zj^i - ^ = j_ (zj - ^r .

Hence Zj^^ ^ \/T , i.e. all Zj > \/ir with the possible exception of z^. Choose therefore Zq ^ yTT, i.e. s/TTg Zq g I. Then all Zj i n/u", and so z-, > u (u < I implies u < Vu) as desired. Now Zj g Vu" gives Zj ^ ^ , hence Zj 2 Zj+i, and so

I g Zq ^ Zj ^ ... ^ and converging to \/u ,

In choosing Zq we may choose any number that is reliably s VuT The simplest choice is Zq = I'. This gives z^ = ^ (l+u). Since this expression involves no division, we might as well begin with i = I and z^ = 5 (I + u).

Answer to the second question: 11 is known to within an error

^1 . 2-36 = 2""°, hercesATis l<nown within -i^CL = _1_ titres this error, i.e.

du 2 Vu"

£„ = 2-^' NAT -' .

45.

For u + 0, as u varies from I to 2~^% e^ varies from 2"*' to 2""'^ ^ .7 x 2"". For u = C the aljove formula breaks down, however the error is clearly \/2"'°-V0 = 2"'° We assume u^ 0, since the case u - 0 Is quite harmless. We should Assume that the last step is the one from

i.e.- eo = 2~'°

stop when Zj I ies within e^, of/u".

|zj^ -^r = 2zi Jzi « -^\ 4 2-'° ,1 z, -VF|£2-'° or.sincez, ., - ^/O"

This means

is negligible compared to Zj -\fu ,\zi mal<ing a safe overestimate qfves

(**)

^io-^1^2'

,-2 0

.Using z,^ >z^^,,

and

'io- ^ 2-

Using (*), it is easily seen, that (**), or tte equivalent

(-)

Zi -v^i 2"

■19

obtains

fa-

n= 1

if I-

.2-«

^

if 2-^

^ u <

i-2-%

for

'o =

= n

u < I, for io - 2 if 1-2 ^ u < 1-2

if 5"' ^ u ^ 2"\

L = 19 for u = 2^*° or 0.

for

40

Hence for most values of u, specifically for .2 g u < .875 we need 3-H iterations. Caroer nunfeers \q of iterations are needed when u is small, if u is of the order 2'^^, then Iq lies between j-3 and j-l. It is therefore debatable, whether we should not adjust u first, by bringing it into the "favorable" range u > .2 by iterated multiplications with 2^. In or'der to simplify matters, we will not do this, and operate with u unadjusted, relying on (**) only. The disadvantage thus incurred is certainly not serious.

This arrangement of the iterative process has the effect, that there is no need to store the iteration index i (but we will, of course, have to refer, to i in drawing the flow diagram). Wb store u at A, and v = Vu", when it is formed, at B. We use distributed storage. In the preceding problems we refrained from using the storage location, which is reserved for the final result, for changing storage, too. We will now do this.

in Figure 1.3

The flow diagram should now present no difficulties, it is shewn

FIGURE 8.3

&

2 ,= 2 ( I + U) +o B

n

a A I u.

I

2l*,«^"'f2l+rr)^»B

HI

Z\.*,-ZL + E

%.

Tte

as we did in

coding

M

A

2

C.I

2-'

1,3

C.I

*i

B

(to 11,1)

H.l

A

2

B

3

H

B

5

C.2

6

C.2

7

B

8

B

(to 111,1)

111,1

C.2

C.3

n-lO

111,2

C.3

3

e

(to II. 1)

boxes l-lll require static coding. We proceed in the same sense Problom ^, and we code all boxes in one, continuous operation:

h S

A

h-

R

S

h S

h Cc

Ac

u

Ac

2-^u

Ac

z, = 2" (l+u)

B

Zi

Ac

u

R

h,

Ac

IL

Zi

Ac

^-i

Ac

^i.i-^i = 2-Mz"i

C.2

Zj+i - Zj

Ac

^i+1

B

^i+i

Ac

Zi+i -Zj

Ac

Zi..-Zi.2-"

Zi)

Next, we order the boxes, in the same sense as we did in coding Problem 4. The ordering I, II. Ill results with one irwerfection : II shotild have been the inmediate successor of lll» This necessitates an extra order

11,4

11,1

To conclude, we have to assign A, B, C. 1-3 their actual values, pair the 16 orders 1,1-4, H,l-8» I II, l-H to 8 words, and then assign I, I,..., Ill, H their actual values. These are expressed in this tablef"

11,1-8

0 - r

2-5"

lll,l-H A

6-7' 8

B C.I-3

9 10- 12

Now we obtain this coded sequence:

0

8 ,

R

«

R,

IIS

8

u

1

10 h,

9 S

5

9h,

9S

9

-

2

8 ,

9-

6

II ,

12 h

10

1"

3

A,

9h-

7

e Cc,

.2 C

II 12

h

The durations may be estimated as follows:

I: 130 u , II: 380 n , Ml: 150 u .

Total: I * (II + III) X i^ = (I30+ (380+ 150) io) n = = (530 io + 130) n ^ (.6 io + .1) m.

As we saw abo/e, a reasonable mean value for i is H. This gives a duration of 2.5 m.

^7.

9.0 CODING OF PROBLEMS DEALING WITh THE DIGITAL CHARACTER OF THE NUMBERS PROCESSED BY THE MACHINE.

9.1 We will code in this chapter several problens, which fall into two classes.

first; The conversion of numbers given in the decimal system into their binary form, and conversely.

Second: The instructions which are necessary to make the machine work with numbers of frore thani^O binary digits.

These problems are of considerable interest for a variety of reasons, and it seems worth while to dwell on these somewhat extensively.

We note, to begin with, that both classes of problems furnish examples of problems and procedures that deviate from the normal schemes of algebra, and hence differ very relevantly from the problems that we have handled so far. Indeed, up to new (as well as in all cases that we will consider after this fchapter) the i|0 digit aggreaate, which is the number contained in a word, was the standard unit which we manipulated. We applied to such units the elementary operations of anthmetics (addition, subtraction, multiplication, division), but we never combined them in any way except through these operations, and we never broke any such unit up into smaller parts. In the problems of this chapter we will have to break up numbers into their digits, operate on these diqits (or rather on certain digital aggregates) individually, combine numbers in new ways, etc.; that is, our operations will be in many irriportant phases logical and combinatorial rather than algebraically mathematical .

Next, we have to point out the practical importance of the two classes of problems to which we havfe referred. The second class can be disposed of by a simpler discussion than the first one; therefore we will consider the second class first.

9.2 Our standard nunfcers have i|0 binary digits, or rather a sign and 39 binary digits; hence they represent a relative precision of 2"^*= 1.8 10" ^• Comparing this to the length of the interval which is available for them (from -1 to I; i.e., length 2), the precision becomes 2'*°= .9 lO"*''. At any rate, we have here a precision of about 12 decimals. This is a considerable precision, and adequate or more than adequate for most problems that are of interest at this monerrt. Yet there are even now certain exceptions; e.g., the summation of certain series, the evaluation of certain expressions by recirsion formulae, the integra- tion of some non-linear (total) differential equations, etc. Furthermore, these cases, where 12 decirals (or their equivalents) are inadequate, are likely to become more frequent as "K)re involved computing problems are tackled in the future. It will therefore becore increasintily difficult to choose an "appropriate" number of digits for an all-purpose machine, especially since an unusually high number of of digits (for the standard ninber) would render it very inefficient when it deals with problens that require ordinary precisions (and these will probably continue to constitute tte rajority of all applications). This inefficiency would extend to the use of the available tremory capacity, the amount of equipment tied up in the parallel digital channels of the machine, and the time required to perform multiplications and divisions.

48.

Consequently, it is important that the machine should allow being operated at varying numbers of digits; i.e. at varying levels of digital precision. One might consider building in alternative facilities for alternative precision levels, controlled by manual switches, or partly or wholly autorratically. We prefer, however, to achieve this without any physical changes or extra organs of the TO binary digit machine. This can be done purely logically; that is, it is possible to instruct the machine to treat k words; i.e., k aggregates of a sign and 39 binary digits, as if they were forming a number with a sign of 39 k binary digits, (k-l signs are wasted in this process.) This increases the precision to 2" ', that is, to 10"^^' ; that is, to any desired level. It does require, however, new instructions for the operations of arithmetics (addition, subtraction, multiplication, division), and it cannot fail to reduce the speed and the memory capacity of the machine. Nevertheless, it is perfectly reasonable as an emergency measure, when an exceptional problem requires unusual precision.

These new arithmetical instructions are provided by the problenrB of our second class.

9.3 Our machine will operate in the binary system. This is most satisfactory from the point of view of its arithmetical and its logical structure, but it creates certain problems in connection with its practical use.

!ln post cases the input data are given in the decimal system, and the output figures (the results) are a^so wanted in that system. It is therefore important to be able to effect the decimal -binary and the binary-decimal conversions by fast, automatic devices. On the other hand, the use of these devices should be optional; i.e., the TOchine should be able to receive and to emit data in the binary system, too. The reasons for this requirement deserve being stated explicitly.

The use of the decimal system is only justifiable for inputs (data) which originate (directly) in human operations; i.e., where the magnetic wire or tape that carries them has been produced manually (by typing): and for outputs (results) which are intended for (direct) human sensing; i.e., where the contents of the magnetic wire or tape in question are to be Tade readable in the ordinary sense (by printing). A good deal of the output of the machine is, however, destined solely for use as subsequent input of the machine ~ in the same problem or in some later problem. For this material no conversion is needed, since it need never be moved dit of the binary systetrr. Thus there are, as a matter of principle, two categories within the information stored on the magnetic wires or tapes: First, information tha* must pass through human intellects (at its origin or at its final disposition); second, information that never reaches (directly) a hunan intellect and remains at all times strictly within the machine cycle. Only the first category need be transferable to and from the decimal notation; i.e., only it requires the conversions that we are going to consider. This circumstance is of great importance rn dealing with these conversions, because it sets for them much less exigent standards of speed than would be desirable otherwise.

Indeed, information of the second category may be produced and cons'jred at a rate which is only limited by the speed of writing on or reading from the nagnetic wire or tape. This can probably be done at rates of 5C-ICC thousand digits per second. We may, at least at first, use a more conservative arrangement of about 25 thousand digits per second. Even this means, for a 40

49.

digit number, and with reasonable time allowances for certain checking featires, etc., about 2 tn per nunber. In order that the conversions do not slow down these processes appreciably, they would have to consume definitely less than 1 m each. Information of the first category, on the other hand, should not be produced or consumed faster than the rate corresponding to that of printing, typing, and what is more restrictive, human "understanding". Our i|0 binary digit nurobers correspond to numbers with about 10 decimal digits. It is difficult to assign a definite printing time to this, since one may print many digits in parallel. Thus, the standard IBM printer will print 80 decimal digits in somewhat less than a second. Various unconventional processes may be a good deal faster. On the other hand, typing will hardly ever be faster than 10 decimal digits per second, and any form of human "understanding" (which should be taken to mean at least critical reading) will be still slower. Even the making of tables for publication need not exceed this rate, and besides it is likely that the making of voluminous tables in book fern will becoms less important with the intro- diction of very high speed machine computing. To the extent to which the machine is making "tables" for its own use, they fall into the second category; i.e. they should remain on the wire or tape medium, and never be converted into the decimal system. Hence, information of the first category can be handled satisfactorily with any con- version methods that are considerably shorter than a second. An upper limit of 100 m would seem more than safe.

These considerations show that our subdivision of the input and output information of the machine into the two categories discussed above Is indeed relevant, and that it is also important to realize that the desirability of the conversion applies only to tie first category. These things being under- sto<id, any conversion times up to ICC m turn out to be adequate.

The machine will easily effect the conversions in question at much faster rates than this. With small changes In its controls we could even keep within the 1 m, which would be -desirable if all infori^ation were to be converted, birt we have seen that this is altogether unnecessary. We will therefore make no changes at all. The conversion times arrived at in this manner will be of the order of 5 m.

In order to discuss these, one more preparation is necessary: If the machine is to effect binary-decimal and decimal-binary conversions, then we must agree on sore method by which it can store decimal digits; i.e., express them in a binary notation. This must also be correlated with various characteristics of the wire or tape inedium: How the decimal information is stored on it, how It can be put on it by typing, and extracted from it by printing.

Vffe will how proceed to consider these matters.

S.U In discussing typing and printing, one should keep in nind that, while it is necessary to be able to perform tiiese operations in the decimal system, it is quite desirable to have the alternative possibilitv of doing them In the binary system. Since the inner functioning of the machine is binary, ita extensive use will successively lead to an incre»«inq familiarity with the binary system, at least as far as those are concerned who are directly engaged in operating it; making arithretical and other estimates for it; sensing, diagnosing and correcting its nalfunctions; etc. It is likely that the machine and the practice and theory of its functioning will produce genuinely binary problems. It is therefore probable that it will qradually cause, even in the interests of Its users, a certain amount of a shift from decimal to binary procedures. The problem cf typing, printing and (human) reading should therefore be faced in the binary as well as In the decimal system.

50.

Consider, first, the binary case. The machine, as well as the wire or tape, treats a number as an aggregate of UO binary digits, i.e., digits C or I . To type in this fashion, and even more to print and to have to read in this fashion, would be definitely inefficient, since we are already conditioned to recongize and use about 80 different alphabetic, numerical and punctuation synfcols. A string of i^C digits is definitely harder to remember and to manipulate than a string of IC symbols, even if the former are only O's and I's, while the latter may be chosen freely from IC decimal digits C, ...» 9 or from 26 alphabetic symbols a, ..., 2.

There is, however, an obvious way to circumvent this inconvenience, i It consists of choosing a saitable k = 1,2, 3, ..., and of typing, printing and reading not in terms of individual binary digits, but of groups of l< such digits. This amounts, of course, to using effectively a base 2 system instead of the base 2 (binary) system, but since the conversions between these two are trivial to the point of insignificance, and since the machine is binary, this seems a natural thing to do. Considering our reading habits and conditioning, 2^ should be of the order of ID to 80; since it is to replace the nurrber IC of decimal digits, it is preferable to make it of the order of 10. Hence, k = 3 or k = ^ seem the logical choices.

For k = 3, 2 - 8, we can denote these triads of binary digits by the decimal digits 0, ..., 7. It is best to let every decimal digit 0, ...,7 correspond to its binary expression (as an integer). This is an advantage. On the other hand, a printer that is organized in this fasWon would be unable to print the decimal digits 8, 9, and this is a disadvantage which is unacceptabfe , as will appear below.

For k = 4, 2 = 16, we can denote these tetrads of binary digits by the decimal digits C, ..., 9 and six other syrnbols; e.g., the letters a, ..., f . It is best to let each decimal digit 0, ..,9 correspond to its binary expression (as an integer). Each letter a, ..., f ray be treated as if it were the corres- ponding number in the sequence 10, ..., 15, and then it can be replaced by the binary expression of that number (as an integer). Thus we have to use the decimal digits 0, ..., 9 and the letters a, ..., f together, which may be a disadvantage: This disadvantage, however, is outweighed by the advantage that a printer which is organized In this fashion can print all decimal digits 0, ..., 9. It can also print the letters a, ..., f, which are likely to be useful for other indications.

We choose accordingly k = 4. The syiAols that we assign to the 2 = 16 tetrads of binary digits are shown in Table IV.

TABLE IV

ocoo

0

01 (K)

t

1000

8

1100

c

cool

1

0101

5

1001

9

IIOI

d

0010

2

Olio

6

1010

a

IIIO

e

ecu

3

Olll

7

101 1

b

MM

f

51

In actual engineering terms this decision means the following things:

First: The typewriter which is used to produce Information manually

on the wire or tape has 16 keys, marked 0, ..., 9 and a f. If any one of these

keys is depressed, it produces on the wire or tape the corresponding tetrad of binary digits, as indicated in Table IV.

Second: The printer which is used to convert information on the wire or tape into readable print, can print 16 syntols, the deciral digits 0, .... 9 and the letters a, ..., f. It picks up the information on the wire, which is in the form of binary digits, tetradwise, and upon having sensed any tetrad, it prints the corresponding synfcol, as indicated in Table IV.

Hence, a W binary digit word, e.g. a full size ntinber, corresponds to lOtetrids, i.e. to 10 syirbols 0, ..., f; and a 20 binary digit half-wordj £.g. an order, corresponds to 5 tetrads, i.e. to B-symtwls. Within an order the 12 first binary digits represent the location number x (cf. Table II), and therefore this X is separately represented by the 3 first tetrads, i.e. synijols.

It is best to allot to every decimally expressed nu ber, too,the space of one word. This allows for 10 symbols, i.e. for 10 decimal digits. Since it is desirable, however, to leave space for a sign indication, these are not all available. The sign could be expressed by one binary digit, but it seems preferable not to disrupt the grouping in tetrads, and we propose therefore to devote an entire tetrad to the sign. In addition, it is. desirable to denote the tifio signs + and - by a tetrad which differs in print from the decimal digits, i.e. which is printed in our system as a letter. We assign therefore tentatively the letter a (tetrad ioiC) to + and the letter b (tetrad 101 1) to -. Thus a 4C bir^ry digit word can express a decimal nurber which consists of a sign and cf 9 decimal digits. It is indicated to assume for the decimal nurtbers, as we did for the binary ones, that they lie between -I and I, i.e. that tne decimal point follows inmed lately after the sign.

There is one more thing that need be mentioned in connection with the use of the sign indication in the decimal notation. Our binary notation handled negative numbers essentially by taking them modulo 2, i.e. a negative a " - t a| was written as 2 + a = 2 - | a | = I + (I - |a| ). The first I expressed the - sign, snd so the digits to the right of the binary point were those of I - |a| , i.e. the corr.plements of the digits of |a| (with a correction of I in the extreme right place). (Cf. 5.7 in Part I of this report.) In our decimal notation it will pro/e more convenient to designate any mutter a (whether negative or not) by its sign indication followed (to the right of the decimal point) by the digits of |a| . This is in harmony with the usual notation in print, and it presents certain advantages in the actual process of conversion (cf. 9.6, 9.7).

9.5 The arithnetical consequences of these conventions are now easy to forms late.

The machine should be able to deal in two different ways with nunt»ers that lie between -I and I in terms of 40 binary digit words:

First: In the binary way: Sign digit and 39 binary digits.

52.

Secnnd: In the decimal or rather in the binary-decimal way: Sign tetrad, which is 1010 for + and 10! I for - (both aggregates to be read as binary numbers), and 9 decimal digits, each of which is expressed by a tetrad, that is simply its expression as a binary number.

In order to make this double system of notations effective, we must provide appropriate instructions for the conversions from each one to the other. I.e. our problem of conversion is to provide instructions for the binary to binary- decimal and the binary-decimal to binary conversions. It should be noted that these conversions take place between two W binary digit aggregates, and they are to be performed by our purely binary machine.

At this point a question concerning precision presents itself. We are considering conversions between what is effectively a 9 decimal digit number and between a 39 binary digit number, i.e. between a number given with the precision 10"^ and a number given with the precision 2"^ ^ = 1.8' 10"^^. The latter is 550 times more precise than the former, is this not a sign of unbalance? We wish to observe that this is not the case.

Indeed, the first mentioned, lower precision occurs in the decimal numbers, i.e. in the input (data) and the output (results); while the second mentioned, higher precision occurs in the binary nunters, i.e. in the intervening calculations, rience the observed disparity in precisions means only that we carry in the calculations an excess precision factor of 550, i.e. of slightly less than 3 extra decimals, beyond the precision of the data and the results. Now it is clearly necessary to carry in any compl icated calculation more decimals than the data or the results require, in order to keep the accumulation of the round-off errors down. For a calculation of such a conplexity that justifies the use of a very high speed electronic computing device, 3 extra decimals will probably not be excessive from this point of view. They may eve" be inadequate, i.e. it '^y not.be possible to utilize in the data and the results the full number (9) of available decimals.

These considerations conclude our preliminary discussion. We add only one more remark: With the exception of tiie arrangements relative to the typewriter and the printer (cf. Table IV and the two renarks which follow), we did not discuss physical features of the machine , but only arbitrary conventions, to be rsade effective by giving appropriate instructions to the machine. A variety of other conventions would be equally possible (e.g. different positioning of the decimal point, higher precision by using more than one word for a decimal and for a binary number, conversions into and from other systems than the decimal one, etc.), and could, if desired, be made effective by appropriate instructions. We are only discussing one example in this chapter, as a prototype, although it seems to be the simplest and the most immediately and generally useful one.

9.6 We are now in the position to discuss the actual conversion processes and their coding, Throughout this paragraph and the next one we will have to use alternately binary and decimal notations. We agree therefore that a digital sequence with no special markings is to be read decimally, e.g. 987016 or .75102; while one which is overscored is to be read binarily, e.g. ION or .11001. Thus, e.g. 17* lOOOl, .m= .0010001 1 IIQI ... . In the tetrad notation of Table IV the two latter binary numbers would read II and .23d ... .

53.

We consider first:

Problem 6.

The number a is stored, in its binary form, at a given nemory location. It is desired to produce its binary-decimal form a', and to store it at another, given, memory location.

According to this a is a binary nunfcer, lying between -I and I. As pointed out at the end of 9.^, we must first sense the sign of a, and then convert |a|. |aj lies between 0 and I, and its decimal expansion can be obtained by this inductive method:

(1) ao= |a|,

(2) aj+i + Zj+i = 10 aj, 0^ aj^i < I, Zj^i « 0, I, ..., 9.

If z* is the sign indication of a, then the decimal expansion of a (cf. the remark at the end of 9.4) is z*, Zj, z^, .... If we write Zi, z,, ... as (l digit) binary numbers, then this representation becomes binary-decimal.

= 1010 = 10 for a ^ 0 ,, *

If z* < , then z', Zi, Zj, ..., Zg is a sequence of

1= ion = II for a < 0

to binary digits. Let us view it as a binary number between -I and I, in the sense of the ordinary corventions of our machine. Since z* begins at any rate with I, it will be negative, and z* represents the acttal number z**

{

' 1. 010 (binary, modulo 2 ) = -I + 2"' - -I'^'-S for a ^ 0

- T.'OTT (binary, modulo 2 ) = -I ^ 2'* + 2"" - -T^-S for a < 0

It is convenient to introduce

,3 - 1 = -6 for a § 0

Zq ' 2 z** \ " . Zj represents the actual nunter

5 for a < 0

{::

2"^ ^*^'Zj. Hence the binary number that we want to produce is

a' » 2"" Zq + Z"^ Zi + ... + 2"^* Z9 . This can be defined inductively as follows:

(3) a'o. r'-zo , ^oll-ilZlV, '

/ 1 . -4. I «-38 \.» -b for a < 0

(5) a- = a* .

Thic completes our definitions, except that it is more corvenient to write, from the point of view of our actual arithmetical processes. (2) in this form:

(2') a|+i + Zj+i = 2*(2'^ aj + 2"^ aj), 0 ^ aj^^ < I, Zj+i = 0, 1 9.

54.

This form of (2') means that the addition that is required in (2') is performed entirely within the range between -I and I, indeed between 0 and I, and that the split into a "fractional part" aj^.^ and an "integer part" z

-1+1

i.e. the

operation which necessarily requires exceeding that range, is initiated by a multi- plication by T alone, i.e. by a quadruple left shift. This latter operation, a fourfold application of the L of Table II, automatically separates the fractional partand the integer part, referred to above: The former appears in the accumulator, the latter, multiplied by 2""^^, in the register. At the same time it should be noted, that (4) involves no true addition, but that if a| is in the register, tiie abo/e mentioned fourfold application of L of Table II will replace it by 2*a! and will at the same* time introdice there 2~^®Zj+i , too, thereby forming the desired al = 2''a! + 2~^^Zj+i . These considerations show, by the way, that it is best to

form the successive values of a] (for i = 0, I, . . . , 9) in the register, and those of aj in the accumulator. Since the register will not be required for any other purpose, we will even find it possible to store the successive values of aj in the register, while additional demands that will have to be made on the accumulator will make it impossible to do the same with aj and the acciiuulator.

TVie iteration index i might be stored in the form 2~^^i, but it is somewhat preferable to storp it in the form ^■''^(S-i). (A corresponding trick would have been equally applicable in coding Problem 3.)

We can now draw the flow diagram, as shown in Figure 9. 1. We note that the staaqe space indicated for aj, B.I, is actually the register (cf. above), hence B.I will not appear as such in the coding that follows. As to the final storage of the result, a', various alternatives are possible, including leaving it in the register. We put it instead into a definite memory location, and choose for this B.2.

FIGURE 9.1

K

G^

-t-

a'=-2"*^6 to B.I

IE

B

.1

ao'

Z

3

0.O

^-39

8

nr

->

#

t+i-

3ZII

5 /s /s 6

a' +oB.2

B.i a' = a:

a:=-2' .5 to B.I

8.2 a'

#

L=8

ao=NtoB,2

2-39.8 toS.B

3 V

-x-^

^-®

1+ \l

B.I

a;'

£

o-i

3

2-«(8-

•t)

rr* .. = FRACTIONAL PART OP

-3

(

2^C2-'ac +2.-^0.0

to B.2

*■*' OF 2^(2-'a-, +2-3a0] to B.I

a-=^ (7-1) -to B,3

5

5 '>''

f

B

. 1

CL

1

L+l

Z-

a

Wl

3

2"

39 C7-

L)

+

a

A a

55.

The boxes l-VII require static coding. We carry this out as in the preceding problenis:

Ac a

2

11,1

C<

(to II

J)

C.I

-r'^-e

tIJ

C.I

R

(to IV

I)

C.2

-r^"-5

111,1

c.2

R

(to IV

,\)

IV, 1

A

M

2

B.2

S

C.3

2^39. g

IV, 3

C.3

^

B.3

S

(to V,

1)

v,i

B.2

2

R

3

B.2

S

•*

R

S

R

6

B.2

h

7

L

8

L

9

L

10

L

II

B.2

12

B.3

0.4

2-39

y,i3

CA

14

B.3

(to Vl,l)

VI, 1

B.3

2

VII,

(toV,l)

yjj.i

2

B.2

3

e

Cc

A

S

c

R

a^ = -2-'" -6

R

ai - -2-^^-5

Ac B.2

ao = a ao

Ac

B.3

2^3e.g

2-39. y

Ac Ac

^a,

B.2

r'-,

Ac

r\

Ac

2-'.: * 2-'a

Ac R

B.2

Ac

Ac B.3

Ac

Ac B.2

'1+1

1+1

'i+i

,-38.

*)

(8-i)

2-^«-(7-i) 2-''-(7-i)

2-'''(7-i)

Next, we order the boxes, as in the preceding problems. The ordering 1,111, IV, V, VII; II; results, with two imperfections: IV, V should have been irmediate successors of II, VI, respectively. This necessitates two extra orders

11,2 VI, 3

IV, I V.l

'Cf. the definitions of these quantities in V, Figure 9.1.

56.

We now must assign A, B.2-3, C.I-»* their actual values, pair the 29 orders I . r-2, II. 1-2, ILI ,1, IV, M, V,l-Ht, VI, 1-3, VII, 1-3 to 15 words, and then assign 1,1 - VI 1,3 their actual values. These are expressed in this table:

1,1-2

0-0'

v,i-m

3'-IO

ili,l

1

VI, 1-3

lO'-ir

IV,l-4

1'- 3

VII, 1-3

12 -13

Now we obtain this coded sequence

0

15 , i3Cc'

8

L ,

16 S

15

a

1

19 R , 15 M

9

17 ,

21 h-

16

-

2

16 S , 20

10

17 S ,

17

17

-

3

17 S , 16

II

12 Cc,

3C'

18

-2-^ ^'6

U

R , I6S

12

A ,

16 S

19

.2-».5

5

R , R

13

eC ,

18 R

20

2-^'-8

6

16 h ,, L

m

1 c.

21

2-30

7

L L

11,1-2

I3'-I*

A

15

B.2-3

16 -17

C.I-*'

18-21

The durations mav be estimated as follows:

i: 75n, II: 75y, IH: 50^; IV: 150 ^, V: 285 u, VI: 125 u, VII: 105 n. Total : I + 0 1 or III ) + IV + (V + VI) X 9 + VM -

= (75 + 75 + 150 + (385 + 125) x 9 + 105) ^i = W95 n » 5 m .

9.7 We consider next:

Problem 7.

The nunber a' is stored, in its binary-decimal fcrm, at a given memory location. It is desired to produce its binary form a, and to store it at another, given, nemory location.

According to this a' is a bin^y-decimal nmter, lying between -I and I. At pointed out at the end of 9.^, we ranst first sense the sign of a', which is determined by the digits Ml frora the left, and then convert la' I , which is directly

given by the reminlng digits 540 from the left. | a'| binary expansion can be obtained as follows:

1 ies between 0 and I and its

The digits Hi+I to li+H from the left in| a'| , i.e. in a' (cf. above), are the binary expression of the decimal digit Wj, which is digit i from the left in the decimal expansion of a' (i ° i, ..., 9). Hence we have the equation

I a'l •= s'.t IQT' Wj. which may be interpreted as a relation that is valid in the

binarv system. Hence it is better to write it 1 ike this: | a | = Sj^j lOr' W| .

Considering the precise definition of the operation L, the digits m+l to m+l (fro« the l«ft) of a' can be enate to appear as the digits 37-"lO (from the left) in the register, if a' is placed into the accumulator and subjected ir m+3 opera-^ions L. If we treat a' as if it were a binary nui^r, this arri .its to performing theae operations:

57.

(I) a^ + w* = 2^a', 0< a^ < I, w* = 0, I, ..., 7,

(2) •1+1* ^l+i = 2*aj' Og a! ^ < I, Wj^^ = 0, 1 15.

w* will correspond to the last three digits of the sign tetrad, i.e.,

OTO = 2 or Oil = 3, according to whether the nudser represented by a' (in its binary-decimal interpretation) is g 0 or < 0. It Is, however, simpier to get the sign indication from a' itself: If a' is interpreted as a binary number, then we have

= nolo ... *) < I r?^, M = .1 + 0-2 . 0-3 * _o-».

1. 01 1 *) = -I + 2 + 2" * -2 '5

= I. Oil ... *) ^

according to whether the nunter represented by a' (in its binary-decimal interpretation) is ^ 0 or < 0. That is, this sign is the opposite of the sign of a' + 2" '5 in its binary interpretation.

Wj, ..., Wg appear always as digits 37-40 (from the left) in the register; i.e., actually as the nunfcers 2~^'wi, ..., T^\g. It is therefore

preferable to write the equation |al = 2*=i 10"' Wj in this form:

|a| = 2'=i 10"' 2 ^^•2"^' Wj. In order to concentrate the divisions in one place

we write | a| = (2j=i 10^"' 2"**^ Wj) : 2"^' IQ^ This can be stated inductively as follows:

(3) a, = 2-="'w,

(4) aj^, = 10 aj + 2"^" Wj^,

(5) a = a, : r'" \(f .

In fine a obtains from 1 a| by noting that the sign of a is the opposite of the sign of a' + f^'5 (binary interpretation, cf . above).

Again, 10 aj is best formed as 2*^ aj + 2 aj.

We can now draw the flow diagram, as shown in Figire 9.2. The induction index i can be treated as in the preceding problem.

The special use of the register whi<)h was made in Problem 6 is not possible here: aj has to be in the accumulator, since we wafct to form the fractional and integer parts of 2* a!, and the operation L will only effect such things if we start from the accumulator; aj has to go through the accumulator, since we have to form true •oms (with carries) like 2^ aj + 2 aj; and neither can occupy the accu- mulator continuously, since the accumulator is needed alternately for both as well as for the sensing in connection with conditional transfer orders. There are, however, certain storage functi«r«, which are best handled by the accumulator or register, in a manner not made explicit in the flow diagram. Tnus 2~^''"(7-i) is best stored in the accumulator as well as in B.3 before the use in 111; |a| is best stored in the register after IV, and the nnove of a to B.2 is only made subsequently in VI and in VII.

*) Binary, reduced modulo 2 into the interval -1,1.

58.

FIGURE 9.2

©-^

O-o' =Fff ACTIONAL PART OF S a to B , I

to B.E 8 to B . 3

ao = O

2 ■^

B.i

a

3

Q-o' 2-^^ 8

1

2\/

#

0-»L

L^

B

.1

ai'

a

a-v

3

2-3'(6-

■l)

to B. I = 2'aL + a a; + 2'^®. C INTEGER psp-r

to B.a +o B . 3

2-^^(7-1)

ISE

B.a a.

H \^

1 *

|a| = ag:^''^lo^t»B.^

^ i

1=8

/\

HI

+

a-'^(7-l)

B.I a.^,

3 £-^'(7-1)

a' A

L

59.

The boxes. I-VII require static coding. We carry this out as in the preceding problems:

M

A

2

3

4

5

B.I

C.I

0

J, 6

C.I

7

B.2

C.2

2-3«.8

!.8

C.2

9

8.3

(to 11,1)

II. 1

B.I

2

3

H

5

6

B.t

7

8

s.l

9

B.2

10

l\

12

B.2

13

14

s.l

15

6.2

16

B.3

C-3

2-3«

11,17

C.3

18

B.3

(to m.i)

ill,!

IM

(to IV, 1)

IV, 1

B.2

C.H

2-" l(

1V,2

CA

(toV.I)

V,i

A

C.5

2r'-b

V,2

c.5

3

VII, 1

(toVI.I)

L L L S

L L L L

S A S

L L h

L

h S

h- S

Cc

Ac

Ac

B.I

Ac B.2

0 0

Ac B.3

2^6.8 2-=>«.8

Ac R

a! * 1+1 '

2-^^Wi,,

B.I

a I 1+1

Ac

2-^^w„,

s.l Ac

2"^i+i ^i

Ac Ac

2'«i fa\ + aj

Ac

2^aj + 2ai

Ac 8.2

Ac

ai.i n

a|+i

2-^' -(8-!)

Ac B.3

2-^».(7-i) 2^''-(7-i)

*)

Ac

R

[a| = a«: 2

Ac

a'

Ac

a' + r''5

\(f

h Cc

•) Cf. the definitions of these quantities in I, M, Figirfe 9.2, and in (l) - (5).

60.

VI, I

(to vim)

VIM

A

2

B.2

S

3

B.2

-

H

B.2

S

5

e

c

Ac

a=»

Ac

lal

B.2

|a|

Ac

a =

B.2

a

Next, we order the boxes, as in the preceding prd^ierrs. The ordering I, II, ill, IV, V, VI; VII results, with one imperfection, VI 1 .4 should have been the immediate successor of VI. This, necessitates one extra order

VI, 2

V||,(;

Vfe must now 'assign A, P. 1-3, C.I-5, s.l their actual values, pair the HO orders 1,1-9. Il ,1-18, 111,1, IV, 1,2, V,l-3, VI, 1-2, VII, 1-5 to 20 words, and then assign 1,1 - VII, 5 their actual values. We wish to do this as a continua- tion of the code of 9.6. We will therefore begin with the nunfcer 22. Furthermore the contents of C.2,^ coincide with those of 20, 21 in the code of 9.6, and the contents of B.I-3 and of s.l are irrelevant like those of |6, 17 there. Hence two of these ray be made to coincide with 16, 17. Also a is in 15 and a' is produced in 16 there, while we have now a' in A and produce a in B.2. Hence, we identify our A, B.I ,2 with 16, 17, 15 there. Summing all these things up, we obtain the following table:

1,1-9

22- 26

VI, 1-2

38'- 39

B.3

42

n,i-i8

26'- 3&

VI 1,1-5

39'-m'

C.I

H3

111,1

35'

A

16

C.2-3

20-21

ly, 1-2

36-36'

B.I

17

C.i^-5

>W-45

V,l-3

37-38

B.2

15

s.l

%

Now we obtain this coded sequence:

22

16 , L

23

L, L

24

I7S , H8

2b

15 S , 20

26

«C S , 17

27

L , L

28

L , L

29

17 S , A

30

M6 S

15

31

L

L

32

15 h

L

33

JP6 h

15 S

3H

42

21 h-

35

42 S

36 Cc

36

15

44^

37

16

MS h

38

41 Cc, A

39

m C , A

40

15 S , 15 -

41

15 S , e C

42

_ _

43

0

4H

2-3a ,o»

45

2"^ -5

46

_ _ _ .

The durations may be estimated as follows:

I: 290 [i, II; 515 \i, III*. 50 n, IV: 195 n,_ V: 125 \x, VI: 55 \i, VII: 180 u.

Total: I + (M + IM)x 9 + |V + V + ((VI + VII 4,5) or VII) =

= (290 +(515 + 50) X 9 + 195 + 125 + 180) n = 5,875 [i^b,9 m.

We may summarize the results of 9.6 and 9.7 as follows:

61.

The binary-decimal and the decimal -binary conversions can be provided for by instructions which require 47 words, i.e. I. \% of the total (selectron) memory capacity of 4,0S6 words. These conversions last 5 m and 5.9 m, respectively. This is short compared to the 100 m which, as was slKwn in 9.3, is a reasonable standard for conversion durations.

9.8 We proceed now to the problems of the second class referred to in 9.1 and 9.2: The problems that arise when we undertake to operate the machine in such a manner, that it deals effectively with fiunt>ers of TWre than tO binary digits.

There are various ways to deal with this situation, and it is actually advisable to study every problem which requires more than normal (40 binary digit) precision as an individual case: The most efficient way to keep track of numerical effects beyond the 40 binary digit limit may vary considerably from case to case. On the other hand, our interest is at present more in giving examples of our methods of coding in typical situations, than in devising particularly efficient ways to handle cases that require more than normal precision. We will therefore restrict our discussion to the most straightforward procedure, although more flexibility and speed could probably be secured in many actual instances by different schemes.

The procedure to which we alluded is that described in 9.2: By using k words to express a number, we obtain numbers with (a sign artd) 39 k binary digits. We will actually restrict ourselves to the case of k = 2: Two words oer number of (a sign and) 78 binary digits. In this way the precision becomes 2~'°= 3.3 10"^*, or (considering that the length of the available interval -I, I is 2) 2"^^= 1.6 * 10"^

We will store every number in two successive words: The first word contains the sign of the number in question and its diqits 1-39 (from the left); in the second word we put the sign digit equal to zero, and then let the digits 40-78 (from the left) of the nurfcer follow.

The operations which have to be discussed are the four basic operations of arithmetics: Addition, subtraction, multiplication, div'isior.

Let us consider addition and subtraction first:

Pmbiem 8.

The (double precision) numbers a, b are stored in two given pairs of memory locations. Form a + b (also double precision) and store it at another given, pair of memory locations.

Let a be stored at A. 1,2, b at A. 3, 4, and direct a + b, when formed, back to A. 1,2. Denote the first and the second parts of a,b, a+b by a, B, a + b and f, "b, a + b, respectively.

It is easily seen that

(I) a + b = a ±h + e <

where e is the sign digit of a + b,

0-3 9

(2) a + b = a + b + 2"

e

62.

It should be remembered, of course, that all these relations must be interpreted modulo 2, and that the positional vajue of the sign digit is 2°. Since a, IB have" the sign digit 0, a sign digit I in a + E is equivalent to a carry from digit 40 to digit 39 (from tte left).

We can now draw the flow diagram, as shown in Figure 9.3. It is convenient to carry otrt some storage functions in a manner not made explicit in the flow diagram. Thus a + b is best formed and moved into A. 2 already in the course of II and III, and while a + b is built up in the accimulator in the course of IV, the ground for this can be effectively prepared (in the accumulator) towards the end of II and III. These arrangements have the effect, that neither B.I nor 9.2 is actually required, both represent storage effected at appropriate times in the accumulator.

FIGURE 9.3

isz:

aib=Q± b ±2''e t, A.I

a±E=a±b+e -feA.s

3

<i)

A.I

Cib

a±b

a,a, b, b

A.3

b b

63.

The static coding of the boxes l-IV follows. Those orders which depend on the alternative + , are marked ^ in their + form and ^^ in their - form.

I-I

A.2

2 ^'

A.H

h

2 #

A.H

h-

3

lll-l

Cc

(to 11,1)

C.I

-1

IM

C.I

h-

2

A.2

S

C.2

2-39

11,3 ^

C.2

3 0

C.2

-

(to IV, 1)

111,1

A.2

s

C,3

0

111,2

0,3

(to IV,I )

IV, 1

A.I

h

2 ^ 2 # 3 4

A.3 A. 3 A.I

e

h

h- S C

Ac

a

Ac

i.=B

Ac

l-'b

Ac

ai b *)

A.2

a + b

Ac

2-39^ = r='

Ac

-2-'\ = -2-''

A.2

a±¥ *)

Ac

0

Ac

lt2-'\

Ac

a + b •)

Ac

a - b •)

A.!

a + b

The ordering of the boxes is I, II, IV; III, and IV must also be the immediate successor of 1 1 1 . This necessitates the extra order

111,3

IV.

We must now assign A. 1-1, C. 1-3, their actual values, pair the 13 orders 1,1-3, 11,1-3, 111,1-3, IV, 1-4 to 7 words, and then assign |,| - IV. 4 their actual values. These are expressed in this table:

1,1-3

0 - 1

IV, 1-14 3 -It'

A.

1-4

7 - 10

II, 1-3

l'-2' Now we

ob1

111,1-3 5-6 tain this coded sequence:

C.

1-3

II- 13

0^8

10 h

3 ? 7 h , 9 h

8

a

0 ^> 8

10 h-

3 ^> 7 h , 9 h-

9

I

1 5 Cc

2 >■ 8 S 2 # 8 S

11 h- 12

12 -

^ 7 S , e C

5 8 S , 13

6 3 C , - -

7 S

10 II 12 13

b -1

2-3 6

0

*) Cf. the definitions of these quantities in IV, Figure 9.3

64.

If both variants (+ and -) are to be stored in the memory (which Is likely to be the case, if they are needed at all), their 7-13 can be conmon. Indeed I 1-13 are 1 ikely to occir in other coded sequences, too. So the two variants are likely to require together 18 to 21 words.

The durations may be estimated as follows:

I: 125 n, II: 125 n, III: 125 n, IV: 150 u-

Total : I + (I I or III) + IV = ( 125 + 125 +■ I5C^ n = HOO n = .4 m.

To sum up:

The double precision addition and subtraction can be provided for by instructions which require 18 to 21 words, i.e. about h% of the total (selectron) memory capacity. The operations last 400 |i = .4 m each.

These sequences are comparable to A.I, A. 3 h (or A. 3 h-), A. I S in the case of ordinary precision, which consume 125 |i. Thus the double precision slows addition and subtraction by a factor 3.2. The factor is actually slightly higher, because the double precision system, as described above, is less flexible than the ordinary one. However, as mentioned previously, there are various ad hoc methods to increase its flexibility, but we do not propose to discuss them here.

9.9 Vfe consider now the multiplication:

Problem 9.

The (double precision) numbers a, b are stored in two given pairs of memory locations. Form ab (also double precision) and store it at another, also given, memory location.

As in 9.8, let a be stored at A. 1,2, b at A. 3,4. It is more convenient to direct ab, when formed, tq_A. 3,4. Denote again the first and the second parts of a, b, ab by a,"b, iB and a, "b, aB, respectively.

The multiplication order (II, Table II) njltiplies two 39 digit quantities u, v by forming a 78 digit product uv. The sign and the digits 1-39 are formed in the accumulator, while the digits 40-78 (with_a sign digit 0) are formed in the register. These are, of course, the uv and uv respectively, as we def inen them above. They are, however, subject to a subsequent (round off) modification, as described in, and discussed in connect ion with, the multiplication order referred to abcwe. We denote therefore the actual contents of the accimu- lator and of the register by u^ and by ^. n0 is, of course, the quantity which we denoted by uv in all past discussions (as well as in all future discussions, outside this paragraph), the predict rounded to 39 digits, stored in the accumu- lator. Now, haw|ver, it is necessary to be more precise, and to discriminate between uv, ijv, uv.

It is clear, that ab is essentially ab, and that aH is essentially

a B + a b + ab. The only things that these expressions do not account for, are the carries in ab from digit 40 to digit 39. It is easily seen, that these, too, are completely accounted for by the following formulae:

65.

(1) (2) (3) (4) (5) (6)

u = ab + ei ,

where ei is the sign digit of Jo ,

V = a

where e, is the sign digit of IE ,

W = U + V + 63 ,

where eg is the sign digit of 11 + v, z = fl + e* , ^

where £4 is the sign digit of a ^ , a°°B = w + z + Eg ,

where e^ is the sign digit of w + ^ , a~B =!["&+ T^° (-6^ -tj +63 -64 +65) .

It should again be remembered, that all tnese relations must be interpreted modulo 2, and that the positional value of a sign digit is 2°.

We can now draw the flow diagram, as shown in Figure S.^. There will again be some transient storage in the accinulator , as well as in A. 3, 4. Since we have discussed similar situations in previous FVoblems, we need not go now into this more fully.

The static coding of the boxes I -XV I f 0I lows There will be one deviation from the scheme indicated in Figure 9.^^ fo is formed in X, hence at the samg time "5"^ becomes avai lable. Si nee To will be needed in XVI , we will store it after X. Since E occupying A. 3 is needed after X solely for the purpose of forming Id, we can remwe "6, and store a d in A. 3.

i.l

A.I

R

2

A.i^

X

3

IM

Cc

(to 111,1)

11,1

A.4

S

C.I

0

11,2

C.I

3

B

s

(to IV, 1)

C.2

-1

lll.l

C.2

h-

2

A. 4

S

C.3

r**

111,3

c.3

-

H

B

s

(to IV, 1)

IV, 1

A.2

R

2

A.3

X

3

v,i

Cc

(toVI.I)

V.l

kA

h

2

A. 4

S

(to VIM)

R Ac

A. 4

Ac

0

B

0

Ac

u = a't + 1

A. 4

u

Ac

.2-39

B

_2-^»

R Ac

h

Ac

^

u+v=u+a E

A.4

u + v

66.

FIGURE 9.H

X I

o

1

A.

3

b

4-

b

B

ab

toB

A.3

b

l-l-

3

u.

2 N' /

IK

u = a b + 1 -toA.H-

2 /\ )

^— OC

zsr a '\

2

«) >■

©

ab

u.+v = u,+ab toA.H-

A.3

b

u

a-i-v

B

s"'"(-s-ea'^

3ZI

u--(-v =u. -t-ab -+- ( +6 A.J+

3 3 A

/

3

3z:

sn: 3

(£>^

u + v

UJ = U.4- V

tc A.4-

39/

2 ^ C- =, -Ea + Sg^ = S^^^C-E -f g-) t6 B

A.3 b

^^'

IX

r

->-

^

U; = U- + V4. 1 to A.M-

31

(2>

M-

X 4- /^

ab

UJ + z = lu + ab

+c A.^

2'^'C-E,-ffa-i-e3-^M-)= a T-E-.-^a-^fa^toB

5 Y /

A.3 b

XII

r

aj-«--z = uj-t-ab+l +0 A.14

o

TTV

(I>

5

xm 5/f

+

ab = UJ + -2. to ^.4-

xsc

\/

Cx,b =a)+Z.+l +0 A.4-

/S

^-O

&

6

XVT

-39

cub = ab + a" C-ei-ea+Eg-e^^ + es") to a. 3

7

1

A.3

B

ab

■o

a , a , b, b

A .1

a a.

A

.3

ab

M-

Ob

67.

Vl,l

A.H

h

2

C.2

h-

3

A.i^

S

4

C.3

-

5

B

h

6 (to VII, 1)

B

S

VII, 1 2 (to IX, 1) VIII

(toX,l) IX, 1

2

3

A. 4 VIII, 1

C.2 KM C.3

Cc

h- S

4

B

h

5 (toX,l)

B

S

x,i

A.I

R

2

A.3

X

3

A. 3

S

^

5 (to XII, 1) XI, 1 2 (to XIII, 1) XII, 1

XI, 1

A.4 A. 4

A^'

A Oc

h S

h

2

0.2

h-

3

kA

S

4

C.3

-

5

8

h

6

(to Xltl,l)

B

S

XIII, 1 2 (toXV,!)

A. 4 XIV. I

Cc

XiV

(to XVI, 1)

XV, 1 2 3

C.2 A. 4 0.3

h- S

4

B

h

5

B

S

(to XVI, 1)

Ac

Ac

A. 4

Ac

Ac

6

Ac

Ac A. 4 Ac

Ac

B

R

Ac R

A.S Ac

Ac A.H

Ac Ac

A.i;

Ac Ac B

Ac

Ac

A.U

Ac

Ac

Ac

u + a

u + V = u + Id +

u + V

2-='^-e,) -2-" u + V

w

w

u + V + I

i

f%

n

n

w+z=w+ai w + z

w + ao

w + z = w + Id +

w + z

2-'*'(-€, -6, -63) -2-''

0-3 8 / ^ \ «v-3 O

2 (-61-62 +63) rT

w + z

T^ = w + z + I 2-3»

2^"(-ei -62 +63 -€4) +2"' 2"^" (-61 -62 -^Ca -eJ+2"^''

68.

XVI,

3

^

A.3

B

A.3 e

S C

Ac Ac

A.3

n

a~B * aD +

rb

+2' (-ei -€2 +€3 -£4 +65)

Note, that the boxes VIM and XIV required no coding, hence their inmediate successors (X,l and XVI, I) must follow directly upon their irmediate predecessors. However, these two boxes have actually no immediate predecessors, VMM and XIV, I appear in the Cc orders VII, 2 and XI 11,2. Hence they must be replaced there by X,l and XVI, I .

The ordering of the boxes is t. III, IV, VI, VII, IX, X, XII, XMI, XV XVI; II; V; XI (VIM and XIV omitted, cf. abovej, and IV, VII, XIII must also be the immediate successors of II,' V, XI, respectively. This necessitates the extra orders

11,1^

IV, 1

Cc

V,3

VII, 1

Cc

Xi,3

XIII, 1

Cr

We must now assign A. 1-1, B, C. 1-3 their actual values, pair the 55 orders 1,1-3, 1 1,1-4,; 1 1 IJ-H , IV, 1-3, V, 1-3, VI, 1-6, VI 1, 1-2, IX, 1-5, X, 1-5, XI, 1-3, XII, 1-6, XIII, 1-2, XV, 1-5, XVI, 1-4 to 28 words, and then assign |,1 - XVI, 4 their actual values. These are expressed in t^is table:

1,1-3

0- 1

IX, 1-5

9 - II

11,1-4

22'-2H

111,1-4

!'- 3

X,l-5

Il'-I3'

v,l-3

24' -25'

IV,i-3

3'-4'

XI 1,1-6

14 -16'

XI, 1-3

26-27

VI, 1-6

5- 7'

XI II, 1-2

17 -17'

A.iJ+

28 - 31

VI 1,1-2

8-8'

XV, 1-5

18-20

B

32

XVI, 1-4

20' -22

C.I-3

33 - 35

Now we obtain this coded sequence;

0

28 R ,

31 X

12

30x

30 S

24

3 Cc',

31 h

1

22 Cc'

, 34 h-

13

A

26 Cc

25

31 S ,

8 Cc

2

31 S ,

35 -

14

31 h

34 h-

26

31 h ,

31 S

3

32 S ,

29 R

15

31 S

35 -

27

17 Cc ,

- -

4

30 X ,

24 Cc'

16

32 h

32 S

28

a

5

31 h ,

34 h-

17

31

20 Cc'

29

a

6

31 S ,

35-

18

34 h-

31 S

30

B

7

32 h ,

32 S

19

35

32 h

31

1

8

31 ,

II Cc'

20

32 S

30

32

-

9

34 h-.

31 S

21

32 h

30 S

33

0

!0

35 ,

32 h

22

eC

31 S

34

-1

II

32 S ,

28 R

23

33

32 S

35

2-39

It is likely that this will be stored in the memory together with the two variants (+ and -) of Problem 8. Hence 28.-31, 33-35 of this code can be comnon with 7-10, 13, M, 12, respectively, in the code of that problem. Also, 32 is likely to occur in other coded sequences, too. So this problem is likely to require 23 or 29 additional words.

69.

The durations may be estimated as follows:

I: 19b u, II: 150 u, Ml: 150 u, IV: 195 u, V: 125 ^, VI: 225 [x, VII: 75 u, IX: 200 n, X: 250 n, XI: 125 u, XII: 225 n, XIII: 75 u, XV: 200 n, XVI: 150 tx.

Total: I + (11 or III) + IV + (V or Vl)+ VII + (nothing or IX) + X + + (XI or XII) + XIII + (nothing or XV) + XVI

average = ( 195 + 150+ 195 + 175 + 7b + 100 + 250 + 175 + 75 +

+ too + 150) ^ = !,6i«) n = 1.6 m.

To sum up:

The double precision multiplication can be prwided for by instructions which require 28 or 29 words in addition to those required by Problem 8 (double precision addition and subtraction) i.e. about an additional .7% of the total (selectron) memory capacity. The operation lasts l,6*M) ti«=*l.6 m.

This sequence is comparable to A. I R, A. 3 x, A. 3 S in the case of ordinary precision, which consiimg 195 n. Thus the double precision slows multipli- cation by a factor 8.4. In contrast with the situation described in connection with the double precision addition and subtraction (cf. the end of 9.8), there is probably no significant loss of flexibility involved in the present case.

9.10 Division offers no particular difficulties. In orderto obtain a doifcle precision quotient of a (represented by §, 1) by b (represented by b, d) one may

first "approximate" the desired double precision qiiotiertt q = ^ , by forming the

b

ordinary precision quotient qo = ■*- , and then refine the result by any one of several

b well known methods. The availability of double precision addition, subtraction, and

multiplication makes these matters quite simple. We do not propose, however, to go

now further into this subject.

We may sumnarize the results of 9.8 and 9.9 as follows:

Double precision arithmetics, comprising addition, subtraction and multiplication, can be provided for by instructions which require H6 to 50 words, i.e. 1.2% of the total (selectron) rnetnory capacity. Due to these changes addition and subtraction are slowed by a factor 3.2 and multiplication by a factor 8.4, in comparison to ordinary precision operations. Furthermore there is a certain loss in the flexibility of the Bse of the two first mentioned operations. It seems therefore reasonable to expect an o/erall, average slowing by a factor between 6 and 8 in comparison to ordinary precision operations.

PLANNING AND CODING OF PROBLEMS FOR AN . ELECTRONIC COMPUTING INSTRUMENT

By Herman H. Goldstine John von Neumann

Report on the Mathematical and Logical Aspects of an Electronic Computing Instrument

Part II, Volume II

The Institute for Advanced Study Princeton, New Jersey

1948

PREFACE

This report was prepared in accordance with the terms of Contract No. W-36-034-OPD-748] between the Research and Development Service, U. S. Army Ordnance Department and The Institute for Advanced Study. It is a continuation of our earlier report entitled, Planning and Coding of Problems for an Electronic Computing Instrument", and it constitutes Volume II of Part II of the sequence of our reports on the electronic computer. Volume III of Part II will follow within a few months.

Herman H. Goldstine John von Neumann

The Institute for Advanced Study 15 April 19it8

TABLE OF CONTENTS

Page

PREFACE INTRODUCTORY REMARK

10.0 CODING OF SOME SIMPLE ANALYTICAL PROBLEMS 1

10.1 General Remarks. 1

10.2 Numerical integration methods. 1

10.3 Problem 10: First integration method.

(Simpson's formula) 3

10.4 Problem 11: Second integration method. 8

10.5 Problem 12: Lagrange's interpolation

formula. 14

10.6 Problem 13: Complete interpolation schemes

(13. a and 13. b). 25

10.7 Problem 13. a: Equidistant interpolation 25

10.8 Problem 13. b: Non-equidistant interpolation. 34

10.9 Problem 13 c: Same as Problem 13. b, but

storage of data differently arranged. 42

11.0 CODING OF SOME COMBINATORIAL (SORTING) PROBLEMS 49

11.1 General Remarks. 49

11.2 Definitions. Meshing and Sorting.

(Problems i4 and 15) 49

11.3 Problem 1^: Meshing. 50

11.4 Problem 15: Sorting based on meshing. 56

11.5 Summary and evaluation. 66

INTRODUCTORY REMARK

We found it convenient to make some minor changes in the positioning of the parts of all orders of Table II, and in the specific effect of two among them.

First: We determine that in each order of Table II the memory position number x occupies not the 12 left-hand digits (cf. the second remark of 7.2, cf. also 8.2), but the 12 right-hand digits. I.e. the digits 9 to 20 or 29 to 40 (from the left) for a left-hand or a right-hand order, respectively.

Second: We chstnge the orders 18, 19 (the partial substitution orders xSp, xSp ), so that they substitute these new positions, and these crosswise. I.e. 18 replaces the 12 right-hand digits of the left-hand order located at x (i.e. the digits 9 to 20 [from the left]) by the 12 digits 29 to 40 (from the left) in the accumulator. Similarly 19 replaces the 12 right-hand digits of the right-hand order located at x (i.e. the digits 29 to 40 [from the left]) by the 12 digits 9 to 20 (from the left) in the accumulator.

For the staindard fcrm of a jxisition mark, x = 2"^®x ■*" 2"^®x, as intro- duced in 8.2, these changes compensate each other and have no effect. Therefore all the uses that we made so far of these orders are unaffected.

On the other h<ind the new arrangement permits certain arithmetical uses of these orders, i.e. uses when the position x is not occupied by orders at all, but when it is used as (transient) storage for numbers. In this case the new arrangement provides very convenient 20-digit shifts, as well as certain other manipulations. These things will appear in more detail in the discussion immediately preceding the static coding in 10.7.

10.0 CODING OF SOME SIMPLE ANALYTICAL PROBLEMS

10.1 We will code in this chapter two problems which are typical constituents of emalytical problems, and in which the apprcrcimation character of numerical procedures is particularly emphasized. This is the process of numerical integration and the process of interpolation , both for a tabulated one-variable function. Both problems allow a considerable number of variants, and we will, of course, make no attempt to exhaust these. We will nevertheless vary the formulations somewhat, and discuss an actual total of six specific problems.

10.2 We consider first the integration problem.

We assume that an integral / f(z)dz is wanted, where the function f(z) is defined in the z-interval 0, 1, and assumes values within the range of our machine, i.e., size < 1. Actually f(z) will be supposed to be given at N+1 equidistant places

in the interval 0, 1, i.e., the values f(h/N), h = 0, 1 N, are tabulated. We wish

to evaluate the integral by numerical integration formulae with error terms of the order of those in Simpson's formula, i.e., 0(1/N*).

This is a method to derive such formulae. Consider the expression

(1) <p(u) = ^ I f(z)dz - [2f(b)a + I (f(hii) . 2f(t) + f(brLy)) £« ] u

/ N 3 N N N N

N

"niere will be h = 0, 1 N, 0 ^ £ ^ 1, 0 | u I 1.

Simple calculations, which we need not give here explicitly, give <jl(0) = <li'(0) = (})"(0) = 0 (indeed (p"'(0) = 0 and for £=1 even (p""(0) = 0), implying

(2) <p{u) = i^ du^ j^^ du^ fj^ du^cp-"(u^), and further

(3) <P'"(u) = [{"^hlhi) + f"(h;£ji)] Si . [f"(liiii) + f"(li^)] ^

N N N' N N N3

1 [f".(liii) . f'"(h-uJ] ^

-2-

(3) transforms into

q>"'(u) = [f"(!ii£ll) - f"(liii) + f"'(h±U) (l.£) U ] £_ +

N N N N N^

(4)

9

+ [£M(hz^) . fl.(ltil) . fMt(h^)(l.g) u ] S,

N N N N

. rf"'(h±ii) . f'"(hzii)] (1 . e) -L-si

N N 3 ^ N*

F\itting

M£"" = Max |f""(z)| ,

we see that (4) yields

(5) l<p"'(u)| ^ 2Mf"" d - 2£) ^ ,

and by (2) <6)

UU)|< MC; (I.2B 1-!

Putting u " 1, and recalling (1), we find:

(7)

^ f(z)dz = [2f(t)H . i (f(b±l) . 2f(h) . f (b^)) £^] 1 .,,

N "

i<pi< jif!!:i(7.6^j g- k.

' '" 90 N=

Putting g = 1 and sumning over h = Z+l, >f+3,..., k-1 (JT, k = 0, 1 N,

k-yi>0 and even) we get Simpson's formula:

k

N

^ , f(z)dz = , E [i[^) + 4f(ti)+ f(li:Jt)] -i + <P

/ / h=Z+l,^+3 k-1 N N N 3N 1

N

(8)

f(^) + 4f(<£ii) + 2f('£i^) + 4f{£i^) + ... +

N N N N

+ 4f (l^) + 2f(li^) + 4f(li^) + f(k)

N N N N

3N 1

< Mr::! k::^ < Mf:::: j,

90 2N^

180 N"

.3.

Putting £ = 54 and sumning over h = i'+l, X+2 k-1 Cf, k = 0, 1,...,N,

k-JPO and of any parity) we get the related formula:

f(z)dz = 1 [f(^) + 22f(fe) + i(^)] -1 + <P =

h=J'+l,/*2 k-1 N N N 24N 2

(9) =[£(ili).f(i^).... .r(l^)] 1 .

Mf(J)-f(^)-f(l^)>f(^)]^^^, .

icp I ^ Mi!::: k-^-i ^ m:^ a

' 2 ' 180 180 N*

10.3 We evaluate first by Sin^json's foraula, i.e., by (8), and in order to simplify matters we put «!' = 0, k = N. Hence N must be even in this case

PROBLEM iO:

The function f(z), z in 0, 1, is given to the extent that the values f(h/N), h = 0, 1,..., N, are stored at N ■♦• 1 consecutive memory locations p, p+1,..., p"*N. It is desired to evaluate the integral /^ f(z)dz by means of the formula (8).

We could use either form of (8)'s right side for this evaluation . UsinR the first form leads to an induction over the odd integers h = 1, 3,...,N-1, but requires at each step the preliminary calculation of the expression

[(f(h+l)/N) + 4f(h/N) + f ((h-l)yN)]/3N. Using the second form leads to an induction over the integers h = 0, 1,..., N, and requires at each step the simpler expression (2/3N)[f(h/N)] multiplied by a factor ^^ = 54 or 1 or 2. Tliis factor is best handled by variable remote connections. A detailed comparison shows that the first method is about 20% more efficient, both regarding the space required by the coded sequence and the time consumed by the actual calculation. We will nevertheless code this Problem according to the second method, because this offers a good opportunity to exemplify the use of vari- able remote connections.

Thus the expression to be computed is J = ?„ \-^ f(b) ,

h=0 h 3jyj N

\i for h = 0, N

\ ^ = n for h / 0, N and f

h even

h odd

-4-

Tliis amounts to the inductive def initial

J,l = 0.

\ -\.l'\ h f^S^ forh=0, 1 N.

J = Jn

3N N

Let A be the storage area corresponding to the interval of locations from p to p + N . In this way its positions will be A. 0, 1,...,N, where A.h corres- ponds to p +-h, and stores f(h/^). These positions, however, are supposed to be parts of some other routine, already in the machine, and therefore they need not appear when we pass (at the end of the whole procedure) to the final enumeration of the coded sequence. (Cf. the analogous situation in Problem 3.)

Let B be the storage area which holds the given data (the consteints) of the problem p, N. (It will actually be convenient to store p, N as p , {p-»N-l) ). Storage will also have to be provided for various other quantities (0, 1 ; it is ccmvenient to store 2/3N; the exit-locations of the variable remote connections), these too will be accomodated in B. Next, the induction index h must be stored, h is really relevant in the combination p + h, which is a position mark (for A.h, storing f(h/N)), so we will store (p+h)^ instead. (Cf. the analo- gous situation in Problem 3.) This will be stored at C. Finally the quantities which are processed during each inductive step will be stored in the storage area D.

These things being understood, we can now draw the flav diagram, as shown in Figure 10.1. It will prove to be convenient to store (2/3N) f(h/t<) after II as well as ^^ (2/3N) f(h/N) after III and IV (but not after V) not at D.2, but in the accumulator, and to transfer it to D.2 in VI only (but also in V). The disposal of Qti, OLq, f^a, shovn in IX, VIII, VI will be delayed until X, and they will be held over in the accumulator, finally, the transfer of (A.h+D^ into C is better delayed from X until after the Cc order in XI, whereby it teikes place only on the - branch issuing from XI, but this is the only breinch on which it is needed.

-5-

(D^

(A.0\ to C O toRl

(iH°

k= N

S..+ -i>^

(h-N),

c (/t.h-nl

S'n

zc

C (A.Ol D.I 0

I

I

5

c( =«,

(A.h+l)o *o C

6(.

« '

0-*-h

3<^

OC ■= OCj i/ h-0,N

01 » OCj if h ^ O, N and eyert

01 = Otj if K oe'o'

■'4

377 ^''■^^ toD.2

^l-vK♦l

m

* ^ JZ

^f r^; to v.i.

SS. "f

D.Z£^,^f(^)

Ch-(N-l)]

e

-''7 7t"*- ynr

oC«cc,

8

JX.

'■^^f(i)

©

^

■0

< (a

/t.h

^C^)

p, N k

Figure 10.1

Tlie static coding of the boxes I-XI follows:

B.l

I.l

2

B.2

1,3

4

B.3

1.5

6

II. 1 2 3

B.4 11,4

5

[ III.l

IV

V.l 2

( VI. 1

B.5 VI. 2

(to 11,1)

(to VI.l) (to VI, 1)

(to VII, 1)

(toX,l)

VII, 1

B.6

VII, 2

3

B.7 VIII, 1

IX, 1

0

B.l

D.l

B.2

C

(ai)o B.3

II. 5

C 11.3

p+h

2 3N

B.4

(to VIII, 1)

(toX,l) (toX.l)

D.2

D.2

(03)0 B.5

C

(p^N-Do B.6

IX, 1

(02)0 B.7

B.3

Sp

Sp R

R ]

c

c ] R

L

S

h- Cc

Ac D.l

Ac C

Ac 11,5

Ac II.3

R

Ac Ac

Ac D.2

D.2

Ac Ac

Ac

Ac Ac

0

0

Po

Po

(ajo

C

(P^>0

p + h

R

f(ii)

N

2 f(h)

3N N

^ 3N

f(ii) =

N

^f(h)

3N N

e^ 2_ ^.(h)= 4_f(h)

^> 3N N 3N N

e, ^ f(il)

h 3N N

e, ^ f(li)

(03)0 (p+h),

(h-(N-l))^

(02)0 (ajo

-7-

X,l 2

II.5 D.l

Sp

3

D.2

h

4

D.l

s

(to XI, 1

XI

1)

C

2

B.6

h-

B.8

lo

XI, 3

B.8

h-

4

5

e C

c:c

6

B.8

h

7

C

s

(to II. 1)

11,5 Ac

Ac D.l

Ac

Ac

Ac

Ac

Ac C

h-1

h " -^h-l

(p-h)„ (h-(N-l))^

(h-N)„ (p+ti +1)

%

A f(h) 3N N

Note, that box IV required no coding, hence its inmediate successor (VI, 1) must follow directly upon its inmediate predecessor. However, this box has actually no inmediate predecessor; IV, 1 corresponds to n^. Hence it must be replaced there by VI, 1.

The ordering of the boxes is I, II; III, VI, X, XI; V, VII, VIII; IX (IV omitted, cf. above) and X, X, II must also be the inmediate successors of VIII, IX, XI, respectively, lliis necessitates the extra orders

11.2

x.i

C

IX, 2

x.i

C

XI, 8

11,1

C

Ci, Oa. *3. correspond to 111,1, VI, 1 (instead of IV, 1), V, 1. In the final enumeration the three o's must obtain numbers of the same parity. TTiis may necessitate the insertion of dunmy (ineffective, irrelevant) orders in appropriate places, which we will mark

We must now assign B. 1-8, C, D. 1-2 their actual values, pair the 35 orders 1.1-6, 11.1-5, III.l. V. 1-2, VI, 1-2, VII, 1-3, VIII, 1-2, IX,l-2, X, 1-4, XI, 1-8 to 18 words, and then assign 1,1 -XI, 8 their actual values. These are expressed in this table:

1,1-6

0 - 2-

X, 1-4

7'- 9

VIII, 1-2

16 - 16

11,1-5

3 - 5

XI, 1-8

9'- 13

IX, 1-2

17 - 17

III.l,'

5'- 6

V,l-2

13'- 14

B.1.8

18 - 25

VI, 1-2

6'- 7

vn,i-3

14'- 15'

C

D.l^

26

27 - 28

-8-

Now we obtain this coded sequence:

0

18

27 S

10

23 h-

25 h-

20

5^

1

19

26 S

11

e Cc

26

21

2/3N

2

20

5 Sp

12

25 h

26 S

22

13 0

3

26

4 Sp

13

3 C

L

23

(P^-I)o

4

- R

, 21 X

14

28 S

26

24

U

6„

5

- C

R

15

23 h-

17 Cc

25

lo

6

--

28 S

16

24

7 C

26

u

7

22

5 Sp

17

20

7 C

27

_ .

8

27 ,

28 h

18

0

28

-

9

27 S

26

19

Tlie' durations may be estimated as follows:

I: 225 U, II: 270 ^, III: 30 ^, V: 55 |a, VI: 75 n: VII: 125 u, VIII: 75 u, IX: 75 M,, X: 150 ^, XI: 300 n.

Total: I + II X (N+1) + III x 2 + VI x (!!^ + 1) + (V + VII) x N +

2 2

+ VIII X (^ . 1) + IX + (X + XI) x(N+l) =

= (225 + 270 (N+1) + 60 + 75 (!^ + l) + 180 !!:i + 75 (^ - 1 ) + 75 + 450 (N+D) a

2 2 2

= (885 N + 1080) n^i (.9 N + 1.1) m.

10.4 We evaluate next by the formula (9), and this time we keep J', k

general. We had >f , k = 0, 1 N and k-2'>0. This excludes k = 0 as well as ^ = N.

It is somewhat more convenient to write ^-1 f or /^. Then/*', k = /J', . . . ,N and k-^0. Thus (9) becomes

(10)

k4^

N

N

/

f(z)dz = [f(^) + f(iii) +

N N

f(!-l) ] 1

N N

N N

N

) + £&)]

N

1

24N

M

Mf"

180

MS

g Mfi:::

180

_i

N*

+ (P2

Finally the requirement k-/^0 may be dropped, since for k-Z^ 0

k=%

N

N N

-9-

Thus N and/^, k = 1, . .. ,N are subject to no further restrictions. We state accordingly: PROBLEM 11. Same as Problem 10, with this change . It is desired to evaluate the integral

^ / f{z)dz (/, N c/

k - 1,...,N) by means of the formula (10) (for k ^■i, for k < -f

interchange /, k).

The expression to be computed is

J = - J' for where J' is defined as follows: F\it

k ^^r

k <r

■'■(

r =

for

k=>X k < -I'

then

and

J' = JM + _1_ [ii^jd) . f (?) . f(klJ:) + f(kL) ] ,

24N N N N N

k'-l

J" = 1 V f(t) N h=Z' N

The last equation amounts to the inductive definition

J-r'-i = 0

Jh-i ^ h f(.^) .

N N

J" = J

k'-l .

The storage areas A, B, C, D and thf induction index h will be treated the same way as in Problem 10, but h runs now over i' , J^'+l k -1.

We can now draw the flow diagram as shown in Figure 10.2. It will be found convenient to store the contents of E. 1-2, (p+k' )^, (p+/l" ) , in the same place where (p+k)., (p+/) are originally stored, which proves to be b. 1-2. This simplifies II and reduces the memory requirements, but since we wish to have B. 1-2 at the end of the routine in the same state in which they were at the beginning, it requires restor- ing B. 1-2 in DC. VIII, on the other hand, turns out to be entirely unnecessary.

-10-

£.1 (/\.k').

(A.k%'(A.K), UEJ. (AjOo'(A.£Ki>, z

CA.hX- (A.£), to EJ (A.l')^tA.K)^U Z

C (A.l% D o

IE

{A.l')c ** C O to D

3

r-*h

h + l-

m

-fr

iS

(h-k')\

XL

h«fc'

1

6

^@

m.

@M- ^-j''*z:feK4v-:fr/;]*ilir[f f^)-f(^t-i^i0

D J

8

@-^-[7w^

^•>»kr^)

Figure 10.2

-11-

B.1 2

I.l 2

3

( B.3

II.l

2

(

111,1

2

3

4

S

6

B.4

111,7

8

(

IV, 1

2

B.5' IV, 3

4 I

V,l 2

3

(

VI.l 2 3

[

B.6

VI, 4

5

6

7 B.7

(to 111,1)

(to IV, 1)

The static coding of the boxes I-IX follows: (p+k)o

(p+ir)

B.1 Ac

B.2 h- Ac

11,1 Cc

(to IV, 1)

(to V,l)

(to VI, 1)

(<Xi)o

B.3

VII,23

B.1 s.l B.2

s.l B.2

(a2)o

B.4

VII,23

B.2

C

0 B.5

D

C

B.1 VII, 1

C VI, 3

p+h

1 N B.6

D C 1

Sp

Sp

h- Cc

Sp

R

R

X

h

S

Ac VII,23

Ac

s.l

Ac

B.1

Ac

B.2

Ac VII, 23

Ac C

Ac D

Ac Ac

Ac

VI, 3

Ac

Ac

D Ac

(p+k)^

(aJo

(p^k)^ (p*k)^

(P^^>0

(p^^)„ (p^k)^ (p^k)^

(012)0

Ola (p+J")^

0 0

(p^)^ (h-k')

(p+h)^ p+h

f(b)

1 f(h)

N N

J. = J. 1 + i {(^) h h-1 [^ [^

\ (p+h)„

.12.

VI, 8

9

( VII, 1

2 3

4

5

[

7

8

B.8 VII, 9

10

11

12

13

14

15 16

17

18 19

20

21

22 23

(to V,l)

B.7

h

C

S

B.2

VII, 6 B.7

Sp h-

VII, 5

Sp

p+^'-l

-.

h-

p+^'

h-

s.l

S

s.l

R

1

24N

B.8

X

D

h

D

S

B.l

VII, 17

Sp

B.7

h-

VII, 16

Sp

p+k'-l

-

..

h

p+k'

h

s.l

S

s.l

R

B.8

D

D

S

c c

Ac C

Ac

VII, 6 Ac

VII, 5 Ac

Ac s.l

R

Ac

Ac D

Ac

VII, 17 Ac

VII, 16 Ac

Ac

s.l

R

Ac

Ac

D

(p+h+1)^ (p+h+1)^

(p+J:') ^ o

p+2'

(p.2'-l)^

p+J"-l N

N N

iiiLi) . f(£)

N N

ft

N

) - f(^)

24N N N

jn + J^ (f(il^) . f(ii))

24N N N

jr. + J_ (f(^:^) . f(il))

24N N N

(p+k') ^ o

p+k' h

(p+k'-l)^

p+k'-l

-f(l^)

f(!i:) . fckizi)

f(ii^) f(ii^)

N

1 (f(k:) . f(kia)

24N

N

N

J' = JM + J_ (f(^lzl)

24N N

N

+ _L (f(k!) . i(K^))

24N N N

J'

.13-

VIII

_.

(to

e)

IX, 1

D

.

2

D

S

3

B.l

4

s.l

s

5

B.2

6

B.1

s

7

s.l

8

B.2

s

(

to e)

Ac

J = -J'

D

J

Ac

(P^^^o =

^p'^'K

s.l

(p.^)„

Ac

<P^)o =

(p+^•)

0

B.l

(p.k)^

Ac

(p.^)^

B.2

(p+1')

Note, that the box VIII required no coding, hence its iiiriediate successor (e) must follow directly uf)on its irmiediate predecessor. However, this box has actually no iimiediate predecessor; VIII, 1 corresponds to Oti , which may appear (by substitution at 11,2) in the C order VII, 23. Hence VIII, 1 must be replaced by e in Oli.^

The ordering of the boxes is I, III, IV, V, VI; II; VII; EX (VIII omitted, cf. above), and IV, V, e must also be the immediate successors of II, VI, IX, respectively. This necessitates the extra orders:

11,3

IV, 1

C

VI, 10

v,i

c

IX, 9

e

c

ttj corresponds to VIII, 1, i.e., to e (cf. above), (ti corresponds to IX,1. This implies, as in the corresponding situation in Problem 10, that IX, 1 and e must have in the final enumeration numbers of the same parity. (? need not be considered, since it represents a fixed remote connection and therefore does not appear in the above detailed coding.

\^e must now assign B. 1-8, C, D, s.l their actual values, pair the 63 orders 1,1-3, 11,1-3, 111,1-8, IV, 1-4, V,l-3, VI, 1-10, \TI,l-23, DC, 1-9 to 32 words, and then assign I,1-IX,9 their actual values. These are expressed in this table:

39

1,1-3

0 - 1

VI, 1-10

9-13'

B.1-8

32

111,1-8

1'- 5

11,1-3

14 - 15

C

40

IV, 1-4

5'- 7

VII, 1-23

15'- 26'

D

41

V,l-3

7'- 8'

DC, 1-9

27 - 31

s.l

42

e is supposed to have the parity of IX, 1, i.e., to be unprimed.

.14-

Now we obtain this coded sequence:

0

32

33 h-

14

34 ,

26 Sp'

28

32 ,

42 S

1

14 Co

32

15

5 C

33

29

33 ,

32 S

2

42 S

33

16

18 Sp

38 h-

30

42 .

33 S

3

32 S

42

17

17 Sp'

.

31

e C ,

--

4

33 S

35

18

- h-

42 S

32

(p+k)o

5

26 Sp'

33

19

42 R

39 X

33

(P^^)o

6

40 S

36

20

41 h

41 S

34

eo

7

41 S

40

21

32

23 Sp'

35

27o

8

32 h-

15 Cc'

22

38 h-

23 Sp

36

0 1

N

9

40

10 Sp

23

- -

- h

37

10

- R

37 X

24

42 S

, 42 R

38

24N

11

41 h

41 S

25

39 X

41 h

39

12

40

, 38 h

26

41 S

, - c

40

13

40 S

, 7 C

27

41 -

, 41 S

41

42

--

The durations may be estimated as follows:

I: 125 [i, II: 125 ;i, III: 300 \i, IV: 150 u, V: 125 a, VI: 445 u, VII: 1015 u, R: 350 p..

Total: I + (II or III) + IV + V x (Ik-^l + 1) + VI x | k-<r| + VII + (VIII or DC)

maximum = (125 + 300 + 150 + 125 (|k-l| +1) + 445 | k-i-l + 1,015 + 350 u =

= (570 \k-yi\ + 2,065) |i maximum = (570 (N-1) + 2,065) yi = (570 N + 1,495) u:- (.6 N + 1.5) m.

10.5 We pass now to the interpolation problem.

Lagrange's interpolation formula expresses the unn^ue polynondal P(x) of degree M-1, which assumes Ni given values pi,...,P^i at M given places xj,...,x^j, respectively:

(1)

;i(j/i)

P(x) = P(xi, Pi;...; xjvi' PmI"^ " Ji Pi ~^

= 1

4^./.:

(x -X:

(X^-Xj]

Ihere would be no difficulty in devising a (multiply inductive) routine which evaluates the right hand siae of (1) directly. This, however, seems inad- visable, except for relatively sirall values of M. Tlie reason is that the denominators

:], are likely to -be inadmissibly small.

-15-

This point may deserve a somewhat irore detailed analysis.

From our general conditions of storage and the speed of our arithmetical organs one will he inclined to conclude that the space allotted to the storage of the functions which are evaluated by interpolation should (in a given problem) be comparable to the space occupied by the interpolation routine itself. Tlie latter amounts to about 100 words. (Problem 12 occupies together with Problem 13. a or 13. b or 13. c 99 or 101 or 106 words, respectively, cf. 10.7 or 10.8 or 10.9, respectively. Other possible variants occupy very comparable amounts of space. ) CVie problem will frequently use interpolation on several functions. It seems therefore reasonable to expect that each of these functions will be given at ~ i 100^26 points. (Tliis means that the N of 10.7 will he'^ 26 -- not our present M ! Note also, that the storage re^pjired in this connection is N in Problem 13. a, but 2N in Problems 13. b and 13. c.) Hence we may expect that the points xj,...,X|^ will be at distances of the order'*' 2'^ between neighbors.

Hence I x— x- 1^1 i-j I " 2"^, and so

j=l ^''^-'^j^

~ (i-l) ! (M-i) ! 2-5<^'-l^

The round-off errors of our multiplication introduce into all these products absolute

•rki/i) errors of the order 2"*°. Hence the denominators -^j ^"i""!^' ""*" with them the

corresponding terms of the sum T in (1), are affected with relative errors of the

i-l c/u n 9 5M-45 M-1 order 2-*°: (i-l) ! (M-i) ! 2*^^'^"^' = '^ (■ ^). The average affect of these

relative errors is best estimated as the relative error

1 ^ 2 5M-45 ^M.i . _ 2^'-^^ M i = l (M-D! ^-^ (M-D! v^

2 9^1-45 / (2M-2) - 2^^'-^^ / (2(M-DJ!

(M-D! M" V ^-^ (M-D ! ^W \ [(M-1)!]'

(2(M-1))! 1 o5M-45

M [(M-D!?

On the other hand, an interpyolation of degree M-1, with an interval length'*'?"^ , is likely to iiave a relative precision of the order ~' C'2" , wliere C is a moderately large number. (The function that is being inter[>oUted is assumed to be reasonably smooth. )

.16-

Qxisecjuently the optimum relative precision e which can be obtained with this procedure, and the optimum M that goes with it, are determined by these conditions:

H

(2<M-1))! M

1 oS

[(M-1)!] ~

From this

% =

/ {2(M-1))! \l M

1

[(M-l)!p

Now we have

5M-45 ^ c 2-^

2lOM-45^Q

M

3

4

5

6

7

%

8-10-e

10-2

5

I.S-IO^'

6-10^

The plausible values of C are in the neighborhood of M ~ 5, while M = 6 is somewhat high and M = 4 and 7 are extremely low and high, respectively. Hence under these conditions M = 5 (biquadratic interpolation) would seem to be normally optimal, with M = 6 a somewhat less probable possibility. We have

M

5

6

e

1.4- 10-'

1.7-10-e

It follows, therefore, that we may expect to obtain by a reasonable application of this method relative precisions of the order ^-« 10-®'>-'2-2°. Tliis is, however, only the relative precision as delimited by one particular source of errors: The arithmetical (round-off) errors of an interpolation. The ultimate level of pre- cision of the entire problem, in which this interpolation occurs, is thei'efore likely to be a good deal less favorable.

These things being understood, it seems likely that the resulting level of precision will be acceptable in many classes of problems, especially eunong those which originate in physics. There are, on the other hand, numerous and importeuit problems where this is not desirable or acceptable, especially since it represents the loss of half the intrinsic precision of the 40 (binary) digit machine. It is therefore worthwhile to look for alternative procedures.

The obvious method to avoid the loss of (relative) precision caused in

M

the formula (1) by the smallness of a denominator

^,H

(

Ci-Xj),

is to divide

by its factors x—x- (j = 1,...,M and j / i) singly and successively. This must.

.17-

^sfo

however, be combined with a similar treatment of the numerators TT (x-x-), since

j = l J

they may cause a comparable loss of (relative) precision by the same mechanism. A possible alternative to (1), which eliminates both sources of error in the sense indi- cated, is

p(x) = X Pi n, '

1=1 ^ j-1

(2) p(.) = y. n. n^

X--Xj

(2) involves considerably more divisions than (1), but this need not be the dominant consideration. There exists, however, a third procedure, which has all the advantages of (2), and is somewhat more easily handled. Besides, its storage and induction prob- lems are more instructive than those of (1) or (2), and for these reasons we propose to use this third procedure as the basis of our discussion.

This procedure is based on A. C. Aitken's identity

X -Xl

(3) P(xi. pi;. ..; x^, nvi Ix) = xu-x, P<X2. P2;- ••; ^, PfA |x) +

x^j-xi ''^"l- PI'--- '^-1' ^-1 '"^

Since (3) replaces an M-point interpolation by two M-1 point interpolations, it is clearly a possible basis for an inductive procedure. It might seem, however, that the reduction from an M-f)oint interpolation to one-point ones (i.e. to constants) will involve 2 steps, which would be excessive, since (2) is clearly an M(M-l) step process. However, (3) removes either extremity (xj or Xu) of the point system xj xj^; hence iterating it can only lead to point systems x-,...,x- (i, j ~ 1 M,

i ^ j , we will write j = i+h-1), of which there are only ^^ ; i.e., '^~

X -XI

'Sn-''i

'^-''

not

counting the one-point systems. Hence (3) is likely to lead to something like an step process.

M(M-l) 2

Regarding the sizes we assume that xj,...,xj^ as well as x and pj,...,f^ lie in the interval -1, 1. We need, furthermore, that the differences x^+j^-x^, X-X-, p+k-p also lie in the interval -1, 1, and it is even necessary in view of the particular algebraical routine that we use, to have all differences P^+^'Pi (absolutely) smaller than the corresponding x^+j^-x^. (Cf. VII, 19. ) I.e., we must use appropriate size adjusting factors for the p^ to secure this "Lipschitz condition". The same must be postulated for the differences P^+j(x)-P^(x) of the intermediate interpolation polynomials. All of this might be circumvented to various extents in various ways, but this would lead us deeply into the problems of polynomial interpolation which are not our concern here.

We now state:

-18-

PROBLEM 12.

Tlie variable values xj, . . . ,3^ (xi< X2< ...< x^) and the function values P2,...,p^ are stored at two systems of M consecutive memory locations each: q, q+1, ..., q+M-1 and p, p+1, . .., p-t-M-1. The constants of the problem are p, q, M, X, and they are stored at four given memory locations . It is desired to inter- polate this function for the value x of the variable, using Lagrjinge's formula. The process of reduction based on the identity (3) is to be used.

It is clear from the previous discussion, that we have to form the family of interpolants

(4) P.(x) =P(xi, Pi;...; Xi+h-l- Pi+h.1 Ix) for i = 1 M.

h = 1... .,M-i+l .

Applying (3) toP(x-, p^;...; x^+i^. p-^j^ | x) instead of Plxj, Pi;. . . ; x„, py !x) gives

h+1, , X -X- h , , X;+.-X h, ,

or equivalently

,h+l, , h, ^ X -X- , h , , h

(5) Pi (x) =P^(x) - 5^-^^ (Pi,j(x) - P^(x)) .

Combining this with

(6) pj(x) = Pi

and

M

(7) P(x) =P(xi. pi;...; XM, p^, !x)=Pi(x) .

we have a (doubly) inductive scheme to calculate P(x).

. Let A and B be the storage areas corresponding to the two intervals of locations from p top+M-1 and from q toq+M-1. In this way their positions will be

A. 1 M and B. 1,...,M, where A.i and B. i correspond to pH-1 and q+i-1, and store

Pi and Xi, respectively. As in the Problems 3, 10, and 11, the positions of A and B need not be shown in the final enumeration of the coded sequence.

The primary induction will clearly begin with the pj,...,pij, i.e., PjCx),. . . ,f^(x), stored at A, and obtain from these Pj(x), . . . ,P^_]^(x); then from

these the f\(x) , . . . ,P^_2^x) ; from these the Pf(x) ^^.S^x); etc., etc., to

conclude with Py(x), i.e., *ith the desired P(x). These successive stages corres- pond to h = 1, 2, 3,...,M, respectively. This h is the primary induction index.

.19-

. In passing from h to h-t-1, i.e., from Pi(x) ^M-h+l^"^

P (x),..., Py,.h^''^' ^^^ ^i ^"^ have to be formed successively for i =l,...,M-h.

This i is the secondary induction index.

h h There is clearly need for a storage area C which holds Pj(x) Pj^^^^^j^Cx)

at each stage h. As the transition to stage h+1 takes place, each P^(x) will be re- placed byP^^^Cx), successively for all i = 1 M-h. Hence the capacity required

for C is M-h+1 during the stage h, but for h = 1 the P^Cx) = are still in A, and need not appear in C. Hence the maximum capacity for C is M«-l. Accordingly, let C correspond to the interval of locations from r to r+M-2. In this way its positions

will be C. 1 M-1, #here C.i corresponds to r+i-1, and stores P^(x). The positions

of the area C need not be shown in the final enumeration of the coded sequence . All that is necessary is that they be available (i £ . empty or irrelevantly occupied) when the instructions of the coded sequence are being carried out by the machine.

As stated above, the P^(x) occupying C.i have necessarily h ^ 1. To give more detail: P^Cx) moves into the location C.i at the end of the i-th step of stage h-1, and remains there during the remainder (the M-h+l-i last steps) of stage h-1 and during the i first steps of stage h.

Further storage capacities are required as follows: The given data (the constants) of the problem, p, q, r, M, x, will be stored in the storage area D. (It will be convenient to store them as p^^, (q-p-D^, r^,, (M-D^, x. ) Storage will also have to be provided for various other fixed quantities (1^, the exit- locations of the variable remote connections), these too *ill be accormodated in D. Next, the two in- duction indices h, i, will have to be stored. As before, they are both relevant as position marks, and'it will prove convenient to store in their place (M-h)^, (p+i)^ (i.e., (A. i+1^ ). These will be stored in the storage area E. Finally, the quanti- ties which are processed during each inductive step will be stored in the storage area F.

We can now draw the flo* diagram, as shown in Figure 10.3. Tlie variable remote connections (X and 3 are necessary, in order to make the differing treatments required for h = 1 and for h ^ 1 possible: In the first case the K-'(x) are equal to p- stfid come from A, in the second case they come from C (cf. above). It should be noted that in this situation our flow diagram rules imf>ose a rather detailed showing of the contents of the storage area C.

The actual coding contains a number of minor deviations from the flow diagram, inasmuch as it is convenient to move a few operations from the box in which they are shewn to an earlier box. Since we had instances of this already in earlier problems, *e will not discuss it here in detail. CVi the other hand, sane further condensations of the coding, which are possible, but deviate still further from the flow diagram, will not be considered here.

-20-

&

(m-i)„ to e.i

£.1 CM-ll

E.I (M-hl

I

C.i

n (^^\ artoL h>l

Z -(A.ZU

1

2 I >J-

3 I

^/«.2;. <o £-.2

I

^^

©

z

0

I

.7 I

^^ " ' •— 1 \! I rn«

®^

A = l -^

c/i

Av-i

Othei-wtat

E.I (M-k)^

F.l PfCX) Z

A!

»--

lf^,U)-p.^^ioF.&

10

Pi>'

to

F.& ^ '

F.z ^n I

£.1 (»1'h)o 2 (A. 1*1),

F.l P^ (H)

z p,t/x;

IT

" HI

A*i

to c.i

c.i'pydf) /or n ^-f, 1

pt'^'f^J fo^l'<i

„'' ^^iS for iii'lM-,

-h*t

IZ

'UJIT

T\' (X) for I i^l ^•'i r-/' r.,\ffor i<iiM-

-h*-l

Oth»

a +h- M)o

tz

#

(M-h -z).

14

H^

I ' M-h

14

IZ

E.i (M~h)o Z(A.i+Z),

F.l P.':^ (X)

Z

fA.i*tl to £.Z T?^^ (X) to F.1

13 I

i*i-*i

8

(M-h-l)^ U E.I

IS

i I

h + l-- h

E.l(M-h-l)^

h = M-l

16

<S)

<Z)

<D

E.i fAl-h)o

C.i P^(x) fof liM-k-^t

C.i P(X) = P^(X)

P. % n ^

K'i

A,i B.i

Pi

IG-URE

10.3

-21.

D. 1

1,1

2

D.2

1,3

4

D.3

1,5

6

The static coding of the boxes I-XI follows:

(M-1),

Ac E.1

Ac

n.4

D.4 5

11,1 2 3 4

111,1

2 3

4

5

6

D.6

IV, 1

2

(to 11,1)

[

[

D.l

E.l

S

(ai)o D.2

(3i)o

D.3

Sp

111,6

Sp

Po D.4

D.5

h

E.2

S

a D.4

c c

111,3

Sp

P

F.l

s

E.2

'o D.6

IV. 3

(to 111,4)

C C

Sp

v.i

2

V.2

p+i

Sp

3

F.2

S

(to VII, 1)

VI. 1

D.4

h-

2

D.6

h

3 4

VI, 4

r*i

Sp

5

F.2

S

Ac III. 6

Ac

(M-1)^ (M.1),

(ai)o

Oi)o 01

Ac

Po

Ac

(P-Do

E.2

(P^l)o

Ac

Po

111,3

P

Ac

P}(x)

F.l

m if

PI

pj if reached from 111,3

P^(x) if reached from IV

(p+l)pif reached from 111,4 (p''"i)Qif reached from IX (i.e. y)

Ac

^0

IV. 3

T

Ac

P^(x)

V.2

PH

Ac

Pi*l

F.2

Pi*l

Ac

io

Ac

(r^i).

VI. 4

r+i

Ac

P?*l'->

F.2

Pj,l(x)

.22-

(to VII, 1)

VII, I 2 3 4

5

6

D.7

VII, 7

8

9

10

11

12

13

14

19

D.8

VII, 20

21

[

22

23

24

25

E.2

D.4

h-

D.6

h

D.5

h-

VII, 25

Sp

E.2

(q-p-1).

D.7

h

VII, 15

Sp

VII, 21

Sp

D.l

h

E.l

h-

D.5

h

VII, 14

Sp

q+i+h-1

15

--

h-

q+i-1

h-

16

s.l

S

17

F.2

18

F.l

h-

s.l

X

D.8

q+i-1 s.l

s.l

F.l

rn-

h-

h- ] S

S

s

Ac

(p^)o

Ac

io

Ac

(r+i)^

Ac

(r+i-l)„

VII, 25

r+i-1

Ac

(pH)o

Ac

(q+i-l)„

VII, 15

q+i-1

VII, 21

q+i-1

Ac

(q+i+M-2)^

Ac

(q+i+h-2)^

Ac

(q+i+h-D^,

VII, 14

q+i+h-1

Ac

"i+h

Ac

"i+h-'^i

s.l

"i+h'^i

Ac

l*,l(x)

' Ac

p5+i(x)-PJ(x)

R

F*,i(x)-P5(x)

(to VIll,l)

Ac

Ac s.l

Ac Ac

C.i

h- h-

*i*h-

x-x

1

X -X-

5^ (p5.i(x)-P5(x)) P^*l(x) = I*(x) +

X -X;

^l+h-^i

i (p5^i(x)-P5(x))

p5'Mx)

.23.

VIII, 1

E.2

2

D.5

h

3

E.2

S

4

E.l

h-

5

D.5

h-

6

D.4

h-

7 (to

IX, 1)

X.l

Cc

IX.1

F.2

2 (to

111,5)

F.l

S

X.1

E.l

2

D.5

h-

3

E.l

s

4

D.5

h-

5 (to D.9

e)

XI, 1

(02)0

Cc

XI, 1

D.9

2

11,4

Sp

D.IO

(£12)0

XI, 3

D.IO

4 (to

11,1)

111,6

Sp

Ac

(p*i)o

Ac

(p-i-l)„

E.2

(pH-l)„

Ac

(p+i+h-M+l)g

Ac

ipH-^-iA)^

Ac

(i+h-M)„

Ac

Pj,i(x)

t.l

Pj,l(x)

Ac

(M-h),

Ac

(M-h-l)

0

E.l

(M-h-l)g

Ac

(M-h-2)„

Ac

(a2)o

II.4

<h

Ac

({3a)o

111,6

&2

The ordering of the boxes is I, II; III; IV; V, VII, VIII, IX; X; XI; VI, and MI, e, II must also be the iinnediate successors of VI, X, XI, respectively, and 111,4 and 111,5 must be the irmediate successors of IV and IX, respectively. This necessitates the extra orders

VI. 6

VII, 1

C

X.6

e

C

XI, 5

II. 1

c

IV, 4 IX, 3

111,4 111,5

C C

^t, <h, Pi. p2 correspond to 111,1, IV, 1, V,l, VI, 1, respectively. Hence in the final enumeration 111,1, IV, 1 must have the same parity, and V,l, VI, 1 must have the same parity.

.24-

We must now assign D.1-10, E.1-2, F. 1-2, s.l their actual values, pair the 75 orders 1,1-6, 11,1-4, 111,1-6, IV, 1-4. V,1.3, VI, 1-6, VII, 1-25. VIII. 1-7, IX, 1-3. X. 1-6, XI, 1-5 to 38 words, and then assign I,1-XI,5 their final values. These are expressed in this table:

1,1-6

11,1-4

111,1-6

IV, 1-4

V,l-3

0 .2'

3 -4'

5 .7'

8 -9'

10 -11

VII, 1-25 VIII. 1-7 IX, 1-3 X,l-6 XI,l-5,*

11'. 24 . 27'. 29 .

23' 27 28' 31'

32 -34'

VI, 1-6

D.1-10

E.1-2

F.1-2

s.l

35 -37' 38 -47 48 -49 50 -51 52

Now we obtain this coded sequence:

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

38 39 40 41 49 41

49 43

48 4

7 42

6 50

9 6

S

Spi

Sp'

h c

Sp

s c

Sp

c

10 Sp'

, -

51 S

49

41 h-

, 43 h

42 h- 49

23 Sp' , 44 h

18 Sp 38 h

, 21 Sp' , 48 h-

42 h

. 18 Sp

18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

52 50 45 52 50 49 49 42

S h-

S h

S h- 29 Cc 50 S 48

48 S 32 Cc 46 47 3 C 41 h-

h-

51 52

52

42 48 41 51 7

42

42

e

4

7

h-

X

S h h- h-

c h-

h- C

Sp' Sp'

43 h

36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52

36 Sp', 51 S , (M-l),

Pq lo

(q-p-l)o

X

k

11 C

The durations may be estimated as follovs:

I: 225 u. II: 150 ^x. III: 225 a, IV: 275 n, V: 125 ^i, VI: 225 n, VII: 1140 u, VIII: 275 u, IX: 200 ^i, X: 225 n, XI: 200 n.

Total: I + II X (M-1) + III f IV x {M-2) + V x (M-1) + VI x (M-l)(M-2) +

+ (VII + VIII) M(M-l) + IX X (M-1) (M-2) + ^ x (M-1) + XI x (M-2) = 2 2

= (225 + 150 (M-1) + 225 + 275 (M-2) + 125 (M-1) + 225 (M-lKM-2) +

+ 1 415 M(M-l) + 200 (M-1) (M-2) + 225 (M-1) + 200 (M-2)) \i = 2 2

= (920 VP - 370 M - 575) \i ?*(.9 M* - .4 M - .6)

-25-

10.6 We now pass to the problem of interpolating a tabulated function based on the coding of Lagrange's interpolation formula in Problem 12.

PROBLEM 13.

The variable values y^^ y^ (yj< y2*^ ...< y^^) and the function values

q^i- "'^j are stored at two systems of N consecutive memory locations each: q, q*^l, . . . , q+N-1 and p, p+1, . . . ,p-*N-l. "Die constants of the problem are p, q, N, M, y, to be stored at five given memory locations. It is desired to interpolate this function for the value y of the variable, using Lagrange's formula for the M points y- nearest to y.

The problem should be treated differently, according to whether the y,,...,y]\j are or are not to be equidistant.

PROBLEM 13. a.

yi»'''>yN '""^ equidistant, i.e., y- - a + ^^— (b-a). In this case only yj^ = a and y*^ = b need be stored.

PROBLEM 13.b.

yi»-"i'yN> ^re unrestricted.

In both cases oui- purpose is to reduce Problem 13 to Problem 12, with

"1 ^\ equal to yk.---.yk4M.l. and pj p,^ equal to qj^, .q^+l^.li where

k = ] , . . . ,N-M+1 is so chosen that the y|.,.. •lyu-ff^^.l li^ ^s close to y as possible.

10.7 We consider first Problem 13. a.

In this case the definition of k, as formulated at the end of 10.6, amounts to this: The remoter one of yi = a + ^^— (b-a) and yi,-»A< ]^ = a + ■■ (b-a)

should lie as close as possible to y. This is equivalent to requiring that their mean, 9Wi,''^L-»\<.l^ - a '* , ' \ (l^'a^i lie as close as possible to y, i.e.,. that

k lie as close as possible to (N-1) ^^^ - ^^^-— . •^ b-a 2

There are various ways to find this k " K, based on iterative trial and error procedures. Since we will have to use a method of this type in connection with Pj"(J}leni 13. b, we prefer a different one at this occasion.

Tliis method is based on the function Izl , which denotes the integer closest to z. F\jtting

k- = /(N-1) P - ^1 . \_ b-a ^ J

we have clearly

.26-

for k* ^ 1, for 1 I k ^ N-M+1, M+1 for k* ^ N-M+1

Now the multiplication order (11, Table II), permits us to obtain tz) directly. Indeed, the round off rule (cf. the discussion of the order in cpiestion) has the effect that when a product uv is formed, the accumulator will contain

^ = 2"^® {2^®uv), and the arithmetical register will contain u> = 2^®uv - {2^®uv}.

Hence putting u = 2-3«(N-l) and v = J^ - -^, will produce 11^ = 2- = « {2^«uv} = 2-'V

b-a 2(N-1; in the accumulator.

After k* and E have been obtained, we can utilize the routine of Problem 12 to complete the task. This means, that we pro|K)se to use the coded sequence 0-52 of 10.5, and that we will adjust the coded sequence that will be formed here, so that it can be used in conjunction with that one of 10.5.

Among the constants of Problem 12 only p, q, and x need be given values

which correspond to the new situation, x is clearly our present y. p p'tM-l are

the positions of the pj,.. .,p|^ of Problem 12, i.e., the positions of our present qjT, . . . ,qTT4»«_-|^, i.e., they are p-^fi- 1 , . . . , p">ic"*M-2 . Hence p = p+Jc-1. q,...,q+M-l are the positions of the xi,...,X|l« of Problem 12, i.e., the positions of our present yr. lYtr-aj.!' Since we determined in the formulation of Problem 13. a, that only

yj = a and y[yj = b will be stored, but not the entire sequence yi yj^, this means

that the desired sub-sequence yr> (Yr-MW.l does not exist einywhere ab initio.

Consequently q may have any value, all that is needed is that the posi- tions q, ...,q+M-l should be available and empty (or irrelevantly occupied) when the qoded sequence that we are going to formulate begins to operate. This sequence must then form

''i = yf+i-1 = ^ " w ^'-^^

and place it into the position q+i-1 for all i " 1,...,M.

It might seem wasteful to form x- first, then store it at q+i-1, and finally obtain it from there by transfer when it is needed, i .e. during the period VII, 1-19 of the coded sequence of 10.5. One might think that it is simpler to form X- when it is actually needed, i.e., in VII, 1-19 as stated above; the quantities

X -X-

needed are more specifically x , x-+l, in the combination r^ ), and thus avoid

1 in "i+h'^i

the transfers and the storage. It is easy to see, however, that the saving thus

effected is altogether negligible, essentially because the size of our problem is

proportional to M^ (cf. the end of 10^5), while the number of steps required in

forming and transferring the x^'s in the first mentioned way is only proportional

to M . (Remember that M is likely to be ^ 7, cf. the beginning of 10.5. ) It does

therefore hardly seem worthwhile to underteike those changes of the coded sequence

of 10.5 which the second procedure would necessitate, juid we will adhere to the

first procedure.

-27-

In assigning letters to the various storage areas to be used, it must be remembered that the coded sequence that we are now developing is to be used in con- junction *ith (i.e., as a supplement to) the coded sequence of 10.5. The latter requires storage areas of various types: D-F, which are incorporated into its final enumeration (they are 38-51 of the 0-52 of 10.5); A (i.e., p, . . . ,p-*M-l), which will be part of our present A (i.e., of p, . . . ,p-*N-l, it will be p+R-1, . . . ,p+E+M-2 ; B

(i.e. , q q+M-1), which may be at any available place; and C (i.e. , r, . .. ,r-*M-2),

which, too, may be at any available place. Therefore we can, in assigning letters to the various storage areas of the present coding, disregard those of 10.5, with the exception of B, C. Furthermore, there will be no need to refer here to C (of 10.5), since the coded sequence of 10.5 assujnes the area C to be irrelevantly occupied. It will be necessary, however, to refer to B (of 10.5), since it is supposed to con- tain the = yjj+j.i (i - 1 M) of the problem. We will therefore think of the

letters which are meant to designate storage areas of the coded sequence of 10.5 as being primed. This is, according to the above, an imniediate necessity for B. We can now assign freely unprimed letters to the storage areas of the present coding.

Let A be the storage area corresponding to the interval from p to p+N-I. In this way its positions will be A.l,... .,N, where A. i corresponds to p'*"i-l and stores q^. As in previous problems, the positions of A need not be shown in the final enumeration of the coded sequence.

The given data of the problem are p, M, N, a, b, y, also the q, r of the coded sequence of 10.5. M, r are already stored there (as (M-D^^, r^ at 38, 43); and y, too (it coincides with x at 45). q, however, occurs only in combination with R (as (q-p-Dp = (q-p-Ic)^ at 44) and p, of course, contains k (as p^^ = (p+R-D^ at 41); and k originates in the machine. Hence, 41, 44 must be left empty (or, rather, irrelevantly occupied) when our present coded sequence begins to operate, and they must be appropriately substituted by its operations, q, however, must be stored as one of the ccnstants of our present problem. Hence the constants requiring storage now (apart from M, r, y which we stored in 0-52, cf. above) are p, q, N, a, b. They will be stored in the storage area B. (It will be convenient to store them as a, b, (N-l)jj, (p-D^, (q-l)o- *e will also need 2"^® and 1 ; we will store the former in B and get the latter from 42. ) The induction index i is a position mark; it will be stored as (q+i-D^ (i.e. , (B'. i)^) in the storage area C. Tlie quantities which are processed during each inductive step will also be stored in the storage area C.

Obr task is to calculate k; to substitute p - (p+k-l) and (q-p-1) = (q-p-k) into 41 and 44; and then to transfer x- - yr+i.l from A.kH-l to B'.i. This latter operation is inductive. Finally, the control has t o be sent, not to e, but to the beginning of 0-52, i.e., to 0.

We can now draw the flow diagram, as shown in Figure 10.4.

(J>^

y- a M~-3

'^ ' b-^ ~ &(M-1)

■"■^-ZT^ to c.i

C.l Z'^K*

31

&-" (k*-l)

-^'i.

*''+

s.

.-»'/!.♦

2 Y/f-«/ + M-l)

ioC.1

+ ^

«"■

"3

toCA

"S

3"

c.l Xi 1

B'A'-

C.l Xj

«w

"THT

1-^i

-J *■

51

--\c.i z^R

Ip + H-l)„ tc 41 (q-}o'k)c to 44

f + I-*i

JZ

^a/l+i)o

teCZ

7,.

7

! =w

I

8 > I

(

L.

<?)

0* - w).

B'.i' X.-'

C?.l Xj^i

2 (B.'£*a).

/Voti

AJ

Ki

B' ^e^ez-j to the S of 10, S

e tefers *o O of O-SZ in lot's.

Numloers 0-S& refer to 0~SZ in lO.S.

p.^, r, M, N, xr,h, y

Figure 10.4

.29-

The actual coding will again deviate in some minor respects from the flow diagram, as in previous instances. In connection with this we will also need sane extra storage capacity in C (C. 1.1).

A matter of somewhat greater importance is this: We have noted before that since our machine recognizes numbers between -1 and 1 only, integers I must be stored in sane other form. Frequently the form of a position mark, t^, is per se more natural than any other (cf . 8.2); occasionally 2"'"j[ can be fitted more easily to the algebraical use to be made of t (cf. I in the present coding); sometimes j is most convenient. (We could, of course, add to this list, but the three above forms seem to be the basic ones.) The transitions between these three forms are easily effected by using multiplications and divisions, but it seems natural to want to achieve the transitions between the two first ones (/^ tmd 2"^ /) in a more direct way.

This can be achieved by means of the partial substitution orders 18, 19 of Table II (x Sp, x Sp'), if they are modified as indicated in the Remark imne- diately preceding this chapter. We propose to use these orders now for arithmetical rather than logical (substitution) purposes, for positions x which contain no orders at all, but which are storing numbers in transit. Specifically: With t~. in the accumulator, x Sp' produces 2"^*/ at the position x; with 2'^^J' in the accumulator X Sp produces 2'^^t at the position x, and a subsequent x h produces / in the accumulator.

We mention that - can be obtained from t^ or 2" ^®/ by dividing them into 1- or 2"^®, resptectivelyf and this without more than the usual loss in precision: Indeed, our division p : O is precise within an error 2"^®, no matter how small o is (subject, of course, to the condition | o| ^ |p | ), provided that p, 0 are given exactly. (If they are not given exactly, then their errors are amplified by ■^ , ^, respectively. In this case a small 0 is dangerous, even though | o| > | pi .) In the present case p O are given exactly. Forming 1^, t^, as well as 2*^®, 2' i, involves no round- offs.

These methods will be used in our present coding: For transitions

between t^ and 2"3'*/,cf. 1,22-23, 111,3-4; VII, 1-3; For forming reciprocals: -

»i o N-1 from (N-1) as 1„: (N-1) in VIII, 4-5, and the very similar case of -^ - from " " o 2 (N-1)

(M-3)„, (N-l)„ as (M-3)„: 2(N-1) in 1,9-15. Regarding -^ we also note this:

O' 0 0 Q ' DO N. 1

We need ^^ in VIII. We will form -^ = 1„: (N-l)„ first and ^ = -^ x (b-a) N-1 N-1 ° ° N-1 N-1

afterwards. Forming 1^ ^ (b-a) first and ^ - [l^ x (b-a) ]: (N-D^, afterwards

would lead to a serious loss of precision, since 1^ '*■ (b-a) plays the role of P above, and as it involves a round-off it is not given exactly, and hence may cause a loss of precision as indicated there.

We will have to refer in our present coding repeatedly to 0-52 in 10.5. It should therefore be remembered that this coded sequence is now supposed to be changed insofar that 41, 44 are irrelevant and 45 contains y. 38, 43 contain (M-1)^,. r^, as in 10.5.

.30-

The static coding of the boxes I-X follows:

B.1

2

I.l 2 3

4 5

7

8

B.3 1.9

10 11 12 13 14

15

16

17

18 19

a

b

B.2

B.1

h-

s.l

S

45

B.1

h-

8.1

+

A

s.l

S

(N-l)o

B.3

B.3

h

S.2

S

38

42

h-

42

h

5.2

A

S

20

s.l

S

21

s.l

R

22

B.3

23

s.2

Sp

24

s.2

X

25

C.l

S

(to II

1)

B.4

II. 1 2

3

2-3 9

C.l B.4 111,1

h- Cc

Ac

Ac

s.l

Ac

Ac

R Ac

s.l

Ac

Ac

s.2 Ac Ac Ac

R

(to IV, 1)

Ac

Ac

b

b-a

b-a

y

y-a X^

b-a

Xia

b-a b-a

(N-l)„

2(N-l)j

2(N-1)^

(M-l)„

(M-2)^

(M-3)„

M-3 2(N-1) 2(N.l),

(M-3),

Ac

2(N-1)

s.2

M-3

2(N-1)

Ac

3ta

b-a

Ac

b-a 2(N-1)

s.l

V

R

V

Ac

(N.l),

s.2

u = 2-='«(N-l)

Ac

2-^V = ilv

CI

2-3V

2-3»(k'-l)

-31-

111,1 2 3

4 5

6

7 ( IV, 1

(

v,i

2

VI,

VII, 1

2

3 B.5

VII, 4

5

6

B.6

VII, 7

8

9

(

VIII, 1

2

3

4

(to VI, 1) L (to V,2)

(to VII, 1) (to VII, 1)

(to VIII, 1)

B.3

38

h-

42

h

C.1.1

Sp

CI

C.1.1

h-

v,i

Cc

B.4

C.1.1 C.l

CI

s.l

Sp

s.l

h

(P-I)o

B.5

h

41

S

s.l

S

(q-i)o

B.6

s.l

h-

44

S

B.2

B.1

h-

s.l

S

42

B.3

6

s.l

X

7

C.1.1

S

8

Cl.l

R

9

C.l

0

B.4

h

Ac Ac Ac

Cl.l

Ac

Ac

Ac

Ac CI

Ac

s.l Ac

Ac 41 s.l

Ac

Ac 44

Ac Ac s.l Ac

R

Ac

Cl.l

R

Ac

Ac

(N-1)^

(N-M)„

(N-M+Dp

2-='9(N.M+l)

2-3V

2-3e(k*.N^M-l)

2-39IJ = 2-

30

2-^^ = 2-3«(N-M+l) 2-3\

2-3^ 2-^«C

IT^ = 2-i*ir+2-="nt

(p+t-l)„

(q-i)o

(q-p-K)„ (q-p-E),

b

b-a

b-a

lo N-1

(N-1)^

b^ N-1

N-1

h^ N-1

2-="'(E-l)

.32.

VIII, 11 12

13

s.l s.l

S

X

14

B.l

h

IS

C.l

S

16

B.6

17

42

h

18

C.2

S

(to IX, 1)

a.i

C.2

2

IX,6

Sp

3

42

h

4

C.2

S

5

CI

6

-

S

q+i-1

s

7

C.1.1

h

8

C.l

s

(toX.l)

X.l

C.2

2

38

h-

3

B.6

h-

4

42

h-

5

42

h-

6

e'

Cc

s.l

2-='«(E-l)

R

N^^-^

Ac

N^ii^^-^

Ac

x^ = a +

N>-^^

CI

Ac

Ac

C2

(q-i)o

qo

%

Ac

(qH-l),

IX, 6

q+i-1

S

Ac

(q+i)o

C.2

Vi)o

Ac

X;

B'

Ac

''i+l = ''i

C.l

"i+l

Ac

(q^)o

Ac

(q+i-M+l)^

Ac

(i-M+2)^

Ac

(i-M+D^

Ac

(i-M)

N-l

(to IX.l)

Note, that the box VI required no coding, hence its iimediate successor (VII) must follow directly upon its imnediate predecessor (III).

llie ordering of the boxes is I, II, IV; III, VII, VIII, K, X; V and VII, IX must also be the itimediate successors of V, X, respectively, and V,2 must be the inmediate successor of IV. This necessitates the extra orders

V.3 X.7

VII, 1 IX, 1

c c

and

IV,2 V,2 C

As indicated in Figure 10.4, e' is 0.

.33.

We must now assign B. 1-6, C. 1-2, 1.1, s.1-2 their actual values, pair the 82 orders 1,1-25, 11,1-3, 111,1-7, IV,l-2, V,l-3, VII, 1-9, VIII, 1-18, IX,l-8, X,l-7 to 41 vrords, and then assign I,l-X,7 their actual values. We wish to do this as a continua- tion of the code of 10.5. We will therefore begin with the number 53. Furthermore the contents of C. 1-2, C.1.1, s.1-2 are irrelevant like those of 48-52 there. Hence thev may be made to coincide with these. We therefore identify them accordingly . Sumning all these things up, we obtain the folloving table:

1,1-25

53 -65

VII, 1-9

71 '-75'

V,l-3

92 '-93'

11,1-3

65 '-66'

VIII, 1-18

76 -84'

B.1-6

94 -99

IV, 1-2

67 -67'

IX, 1-8

85 -88'

C.1-2

48 -49

111,1-7

68 -71

X.1.7

89 -92

C.1.1 s.1-2

50 51-52

Now we obtain this coded sequence:

53

95

94 h-

69

42 h ,

50 Sp'

85

49 ,

87 Sp'

54

51 S

45

70

48

50 h-

86

42 h ,

49 S

55

94 h-

51 -

71

92 Co'

48

87

48 ,

- S

56

A

51 S

72

51 Sp

51 h

88

50 h ,

48 S

57

96

96 h

73

98 h ,

41 S

89

49 ,

38 h-

58

52 S

38

74

51 S ,

99

90

99 h-.

42 h-

59

42 h-

42 h-

75

51 h-

44 S

91

42 h-.

0 Cc

60

52 ^

A

76

95

94 h-

92

85 C ,

50

61

52 S

51

77

51 S

42

93

48 S ,

71 C

62

52 h-

51 S

78

96 -

51 X

94

a

63

51 R

96

79

50 S

50 R

95

b

64

52 Sp'

52 X

80

48

97 h-

96

(N-1),

65

48 S

48

81

51 S

51 X

97

2-3S

66

97 h-

68 Cc

82

A

, 94 h

98

(P-I)o

67

97

93 C

83

48 S

99

99

(q-l)o

68

96

38 h-

84

42 h

49 S

For the sake of completeness, *e restate that part of 0-52 of 10.5 which contains all changes and all substitutable constants of the problem. This is 38-52:

48

49

SO 51 52

38

(M

39

5o

40

10

41

42

1

43

'•o

44

45

y

46

8o

47

35o

The durations may be estimated as follws:

I: 1,220 n, II: 125 u. 111: 275 n, IV: 150 u, V: 125 u, VII: 350 u, VIII: 915 u, R: 300 n, X: 275 ^.

-34.

Total: I + II + (IV or (III + V) or III) + VII + VIII + (IX + X) x M = maximum = (1,220 + 125 + 400 + 350 + 915 + 575 M) u = = (575 M + 3,010) n 5:i (.6 M + 3) m. Hence the complete interpolation procedure (10.5 plus 10.7) requires

(.9 m +.2 M + 2.4) m.

10.8 We consider next Problem 13. h. We are again looking for that k = 1,...,N-M+1, for which Yi^i ty^+M-l ^^® ^^ close to y as possible (cf . the end of 10.6), i.e., for which the remoter one of y^ and Yj^-f^j.! lies as close to y as possible.

Since yi y)y are not equidistant, we cannot find k by an arithmetical

criterium, as in 10.7. We must proceed by trial and error, and we will now describe a method which achieves this particularly efficiently.

We are then looking for a k = R which minimizes )Jj^ = Max (y-yj^. Yk+M-l'V^ in k = 1,...,N-M+1.

Let us first note this: y-yj^ > y-yj^+j, hence y-yj^ > yi^+^-y implies y-yjj > \+i, and therefore [J^ > Pj^+j. Qi the other hand y^+^.l-y < Yk+M'^' ^^^"ce y-Yk i Yk-tM'Y implies [i^ i Y^-tM-Y- and therefore [i^ s [t^^-^. Hence n^ ^ or ^ Mj^+l. according to whether y-yi. > or ^ ^k-^M'^ i-e-, Y^ "*■ Yw -tM ~ 2y < or J 0.

In order to keep the size between -1 and 1, it is best to replace Vk * Yk+M-y - 2y by

(1^ ^k = J Vk ^ ^ Vk+M - y

zi^ is monotone increasing in k. Therefore z^ '^ ^ implies zj^ < 0 and hence M^ > ^-^-l for all h^k, i.e. ,^1 >n >... >Mj^> ^Hc+l" Similarly zj^ ^ 0 implies zjj - ^ ^^^ hence Mj^ < pj^^j for all h ^ i, i.e., [i^ ^ pj^+j ^ ... ^ M^.M ^ H^-M+l" ^^°^ ^^^^^ *^ may infer

zi^ < 0 implies Ii > k,

Zi^ ^ 0 implies that we can choose Ic ^ k.

Consequently we can obtain [c by "bracketing" guided by the sign of Zj^.

Note that zj^ can be formed for k = 1,...,N-M only, but not for k = N-M+1. The "bracketing" must begin by testing the sign of zi for k = 1, if it is +, then f = 1, ' if it is -, then we continue. Next we test the sign of zk for k = N-M, if it is -, then E = N-M+1, if it is +, then we continue. In this case we know that 1 "^ I< g N-M. I\it k = 1, k j^ = N-M. Consider more generally the case where we know, that k- "^ C ^ k^ .

fhis implies k—k^ ^ 1. If k--kj^ = 1, then k = k-; if k--k^ > 1, then we continue.

-35-

In this case we use the function [*! which denotes the largest integer ^ w. I^lt

(3) ''i = ^ 2 ^^^ ^^V^ '

and test the sign of z. for k = k9, if it is + then E < k9, if it is - then C > k?. ^ k i' - i' ^ 1

We can therefore put k^+j^ = k^, k^+j^ = or k~+]^ = k?, k . = k^ , respectively. This completes the inductive step from i to i+1. Sooner or later, say for i = i , k- - k^ = 1 will occur, smd the process will terminate.

Note, that k-+i-k-+i ^ i(k[ - k" + 1), i.e., k-.k" i 2(k2+i-k-+i^ -1, i.e., k- i-k7 1 ^ 2(k- - k7)-l. For i = i , however k—k" = 1, k- i -k^ 1^1. hence k^.i-ki'i ^ 2.' Thus k^ .^ - k- .1 ^ 2, k- .2 " ^i .2 ^ 3 kj-k^ ^ 2"°' +1.

00 GO

However, ki-kj ~ N-M-1, therefore,

(4) i < 2 1og(N.M-2) + 2.

o - "

The virtue of this "bracketing" method is, of course, that the number of steps it recpiires is of the order of ^log N, and not, as it would be with most other trial and error methods, of the order of N . (Note, that N is likely to be large compared to M, which alone figures in the estimates of 10.5 and 10.7.)

After K has been obtained, we can utilize the routine of Problem 12 to complete the task, just as at the corresponding point of the discussion of Problem 13. a in 10.7. This means that we propose to use the coded sequence 0-52 of 10.5, and that we will adjust the coded sequence which will be formed here, just as in 10 .7.

The situation with the constants of Problem 12 is somewhat simpler than it was in 10.7. Again, p, q, and x need be given values which correspond to the new situation, x is clearly our present y. p,...,p-*W-l and q,...,q+M-l are

the positions of the pj^, ...,p|^^ and x^ ''M °^ Problem 12, i.e., the positions of

our present qj^ %-m-l ^'^ ^E ^It+M-l' ^•^■' ^^^^ ^^^ p-^'^-l p+Ii+M-2 and

q+Ic-1 q+E-tM-2. Hence p = p+Ic-1, q = q+Ii-l. Tlie complications in 10.7, connected

with q, or, more precisely, with the yj^ Vl^+M-l' '^° "*"" ^^^^^ here, since Problem

13. b provided for storing the entire sequence yj >^.

In assigning letters to the various storage areas to be used, it must be remembered, just as at the corresponding point in 10.7, that the coded sequence that we are now developing is to be used in conjunction with (i .e. , as a supplement to) the coded sequence ol lU.5. As in 10.7, we have to classify the storage areas required by the latter, but this classification now differs somewhat from that one of 10.7: We have the storage areas D-F, which are incorporated in the final enumera- tion (they are 38-51 of the 0-52 of 10.5); A and B (i.e., p p-»W-l and q q+M-1),

which will be part of our present A and B(i.e., ofp,... ,p"HV-l and q q+N-1, they

will be p+E-l,...,p+C41-2 and q+I?-l q+R^-2); and C (i.e., r, . . . ,r-HW-2) , which

may be at any available place. Therefore, we caui, in assigning letters to the various storage areas in the present coding, disregard those of 10.5, with the

-36-

exception of C. Furthermore, there will again be no need to refer here to C (of 10.5), since the coded sequence of 10.5 assumes the area C to be irrelevantly occupied. We will, at any rate, think of the letters which are meant to desig- nate storage areas of the coded sequence of 10.5 as being primed. We can now assign freely unprimed letters to the storage areas of the present coding.

Let A and B be the storage areas corresponding to the intervals from p to p^N-l and from q to q+N-1. In this way their positions will be A. 1,...,N and B. 1,...,N, where A.i and B. i correspond to p+i-1 and q+i-1 and store q- and y-. As in previous problems, the position of A and B need not be shown in the final enumeration of the coded sequence.

The given data of the problem are p, q, M, N, y, also r of the -coded sequence of 10.5. M, r are already stored there (as (M-1) , ro at 38, 43); and y, too (it coincides with x at 45). The definitions of p, q involve E (p=p+E-l, q=q+Ic-l), and R originates in the machine. The form in which p is stored accord- ingly involves E (as p = ip+E-Dp at 41); while the form in which q is stored does not happen to involve E (as (q-p-1) = (q-p-1) at 44). Hence 41 must be left empty (or rather, irrelevently occupied) when our present coded sequence begins to ojserate, and it must be appropriately substituted by its operation. 44 might be used to store (q-p-1) from the start, but we prefer to leave it, too, empty (i.e., irrelevantly occupied) and to substitute it in the process. Hence the constants requiring storage now (apart from M, r, y which are stored in 0-52, cf. above) are p, q, N. They will be stored in the storage area C. (It will be convenient to store them as (p-1) , (a-1) , (N-1) .) The exit- locations of the variable remote connections will also

0 0

be accoomodated in C. The induction index i need not be stored explicitly, since the quantities k-, k^, k- contain all that is needed to keep track of the progress

of the induction. (The i = i for which the "bracketing", i.e., the induction, ends, is defined by k- -k^ = 1, cf. above.) k-, k^, k- are position marks, they

will be stored as (q+k?-l) , (q+k7-l) , (q+k^-l) (i.e., (B.k?) , (B.k;) (B.kt)^)

^lo'^io'^io lO lO lO

in the storage area D. Finally, k, when formed (in the form (q+E-1) , i.e., (B.E) ) , will be stored in D, replacing the corresponding expression of k^.

The index i runs from 1 to i . In drawing the flow diagreun, it is convenient to treat the two preliminary steps (the sensing of the sign of zj^ for k = 1 and k = N-M) as part of the same induction, and associate them ideally with two values of i preceding i = 1, i.e., with i = -1 euid i = 0. For i = -1, 0 may be defined as the value of k for which the sign of zj^ is being tested (this is its role for i g 1), i.e., as 1, N-M, respectively; while k^, k- may remain undefined for i = -1, 0.

Our task is to calculate k (in the form (q+k-1)^, i.e., (B.E)^); to substitute p = (p+E-1) and (q-p-1) = (q-p-1) into 41 and 44; and finally to send the control, not to e, but to the beginning of 0-52, i.e. to 0.

We can now draw the flow diagram, as shown in Figure 10.5. The variable remote connections OL and 3 are necessary in order to make the differ- ing treatinents for i = -1, for i = 0, and for i ^ 1, possible (cf. above).

.37-

3

#

«

3IL

(B.kUX= (B.H-)o

to to

D.Z 3

/^iTV

i? 1

K'^r

(5h

(S>-

(§>■

3

tf.) >-

fi^—^

3

13

J = O ^t= N- M

6

i = -1

4

1= -1

5

J '0 X[= A/ - /W

7

1?1

^, ?. r, M, /V, y. i

(B.k'), - f^.lJo to D.Z (.B.i^W - (B.N-M),to 3

M

(B.k), « rS.Dc to i).v5

IZ

fB.k',1 = (B.N-M)^ to D.i

/J

Cfl.K^ = (B.N-M+l^io D.3

l-*i

j*i-* J

14

H

I'/i

•gnr

(B.kj"^^;„= (B./<°)„ to D.Z (B.kf^i)o= CB.Kpo to 3

/3

(^-p-l\ to 44

D.3 fB.k),

D.2 rS-Kpo

aCB.Kp,

14

(/

(B.kp to D.l

3

J4^

IX

14 -

(K- - kj* + 1 ),

I I I

Z,,« , ^,r, 2^ - J X.^ 5 Vk+^T y

D.l (B.

KB. 3(B.

k,')o ktl

A. I 3 A

y.

FiCURE 10.5

/Vote :

e refers to O of 0-SZ Jn 10. S.

Nurrktrs O - 5Z h-tfer to O-SZ !n lO.S.

.38.

Regarding the actual coding we make these observations: Since k^, k^ are undefined for i " -1, 0, therefore the contents of D.2, 3 are irrelevant for i = -1, 0 (cf. the storage distributed at the middle bottom of Figure 10,5). Ihe forming of (B.k^) in X, with k^ = |i (k^+kp ], is best effected by detouring over the quantities 2-^o(q+k°-l), 2"38(q+kT.l), 2-3s(q+}i+.l) , because the operation m = [^ n] is most easily performed with the help of 2"3^, 2"39n: Indeed the right-shift R carries the latter directly into the former. Tlie transitions between / and 2'^°i (in both directions) are performed as discussed at the corresponding place in 10.7.

We will use 0-52 in 10.5 just as in 10.7, and the remarks vAich we made there on this subject apply again.

The static coding of the boxes I-XI follows:

CI

2

1,1

2

3

4

C.3

1,5 6

7

( 11,1

2

3

4

5

6

(to II. 1)

10 11 12

(ai)o

(Pijo

C.l

11,13

Sp

C.2

11,14

Sp

(5-1)

^ 0

C.3

42

h

D.l

s

D.l

11,6

Sp

38

h

42

h

11,9

Sp

q+k?-l

3.1

S.l

45

R

S

5+k?+M-l ]

R

h

h-

Ac

11,13 Ac 11,14

Ac

Ac D.l

Ac

11,6

Ac

Ac

11,9

Ac Ac

s.l

Ac

Ac

Ac Ac

(aJo (Pi)o

(q-1)

(5^k9-l)^

q-k9-l

(5+k?+M-2) ^ 1 o

(q+k?+M-l) ^1 o

q-tk-'-HVl-l

Yk?

2X

Ik

yk°4M \ Yk^^i

hk° ^ -

Cc C

2 Vk°^l

X ^ 2 ^^i ' 2 X"^ '^

-39.

11.13

"

Cc

[

a

Cc

14

--

C

[

P

c

III.l

C.3

2

42

h

3

D.3

s

(to

XI, 1)

C.4

(a2)o

5

(fe)o

IV. 1

C.4

2

11,13

Sp

3

C.5

4

11.14

Sp

C.6

(N-1) o

IV,5

c.6

6

38

h-

7

C.3

h

8

D.l

S

(to

II.

1)

C.7

(a3)o

8

(P3)0

v.i

c.7

2

11,13

Sp

3

C.8

4

11.14

Sp

5

C.3

6

42

h

7

D.2

s

8

C.3

9

C.6

h

10

38

h-

11

D.3

S

(tc

)IX.l)

VI. 1

C.3

2

C.6

h

3

38

h-

4

42

h

5

D.3

S

(to

XI

.1)

Ac Ac D.3

(5-1)

Ac

(012)0

11,13

ttj

Cc

Ac

(Mo

11,14

32

C

Ac Ac

(N-1) 0

(N-M)

0

Ac

(54N-M-1)^

D.l

(5-^N-M-l)

Ac

(013)0

11,13

0.3

Ac

{Mo

11,14

Ps

Ac

(5-1) ^ 0

Ac

^0

DJ2

^0

Ac

(q-1) ^ 0

Ac

(5+N-2) ^ 0

Ac

(5+N-M-l)^

D.3

(5-tN.M-l)o

Ac

(q-i^o

Ac

(q^-2)^

Ac

(5+M-M-i)^

Ac

(q+N-M)

D.3

(5-tN-M)

Cc

-40-

VII, 1

2

( VIII, 1

2

( IX,1

2

3

4

(to IX,1)

(to IX,1)

(to X,l)

X,l 2 3 4 5

6 7 8

(to 11,1)

D.l

D.3

S

D.l

D.2

s

D.2

D.3

h-

42

h

XI, 1

Cc

D.2

D.3

h

S.l

Sp

s.l

(p-1)

R

s.l

Sp

s.l

h

D.l

S

C.9 XI, 1 2 3 4 5 6 7 8 9

The ordering of the boxes is I, VIII, and II, XI, IX, IX, II must also be the VIII, X, respectively. This necessitates the

C.9

C.3

h-

D.3

h

41

S

C.3

C.9

h-

42

h-

44

s

e'

c

Ac D.3

Ac D.2

Ac Ac Ac

(q+kf-1) ^1 o

(5+k?-l)

^1 o

(5+k?-i) (5+k?-l)

^ 1 o

(q-*7-l) ^ 1 o

(k--kt) 1 1 o

(k--kt+l)

1 1 o

Ac

(q^k--l)^

Ac

(25<^--2)^

s.l

2-3e(2q+k^+k--2)

Ac

2-3s(2q+kt+k^-2)

Ac

2-3e(q+k9.1) =

= 2-3 9(q, ^[k++k-] .1)

s.l

2-i8(q+k?-l)

Ac

(q.k9-l)^

D.l

(5.k°-i)^

Ac

(p.l)^

Ac

(p-5)„

Ac

(p-HT-l)^

41

(p^-l)°

Ac

(q.l)^

Ac

(q.p)^

Ac

(q-p-1).

44

(5-5-1)

II; III, XI; IV; V, IX, X; VI; VII; immediate successors of IV, VI, VII, extra orders

IV, 9

II. 1

C

VI, 6

XI, 1

c

VII, 3

IX, 1

c

VIII, 3

IX.l

c

X,9

11,1

c

-41-

As indicated in Figure 10.5, e' is 0.

«!, a'2, Ota, 3i, p2, p3 correspond to 111,1, V,l, VII, 1, IV, 1, VI, 1, VIII, 1, respectively. Hence in the final enumeration 111,1, V, 1, VII, 1 must have the same parity and IV, 1, VI, 1, VIII, 1, must have the same parity.

We must now assign C. 1-9, D.1-3, s.l their actual values, pair the 78 orders 1,1-7, 11,1-14, 111,1-3, IV, 1-9, V,l-ll, VI, 1-6, VII, 1-3, VIII, 1-3, D(,l-4, X,l-9, XI, 1-9 to 39 words (actually two dumny orders, necessitated by the adjusting of the parities of V, 1 and VIII, 1 to those of 111,1 and IV, 1, respectively, increase this to 40) amd then assign I,1-XI,9 their actual values. We wish to do this again as a continuation of the code of 10.5. We will therefore again begin with the number 53. Furthermore the caitents of D.1-3, s.l are irrelevant like those of 48-52 there. Hence they may be made to coincide with four of these. We therefore identify them with 48-51 there. Suiiining all these things up, we obtain the following table:

1.1-7

53 -56

V,l-ll

74'.79'

VIII. 1-3

91'-92'

11,1-14

56 '-63

IX, 1-4

80 -81'

C.1-9

93 -101

111,1-3

63 '-64'

X.1-9

82 -86

D.1.3

48 -50

XI, 1-9

65 -69

VI, 1-6

86 '-89

S.I

51

IV. 1-9.*

69 '-74

VII, 1-3.*

89 '-91

Now we obtain this coded sequence:

53

93

62 Sp'

54

94

63 Sp

55

95

42 h

56

48 S

48

57

59 Sp

38 h

58

42 h

60 Sp'

59

-

R

60

51 S

.

61

R

51 h

62

45 h-

- Cc'

63

- C

95

64

42 h

50 S

65

101

95 h-

66

50 h

41 S

67

95

101 h-

68

42 h-

44 S

69

0 c ,

96

70

62 Sp',

97

71

63 Sp,

98

72

38 h-.

95 h

73

48 S ,

56 C

74

99

75

62 Sp'i

100

76

63 Sp,

95

77

42 h ,

49 S

78

95 ,

98 h

79

38 h-,

50 S

80

49 ,

50 h-

81

42 h ,

65 Co

82

49 ,

50 h

83

51 Sp',

51

84

R .

51 Sp

85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101

h , C. h . h , C , S ,

51 56 98 42 65 50

49 S , "o

(q-1)

74 °

86°

(N?l)

89 °

91°

(p?l)

48 95 38 50 48 80 48 80

10.7.

The state of 0-52 of 10.5 must be exactly as described at the end of

The durations may be estimated as follows;

I: 275 n, II: 485 u , III: 125 H , IV: 350 ^ , V; 425 u . VI: 225 u , VII: 125 a , VIII: 125 u , DC: 150 u , X: 330 u , XI: 350 n.

.42.

Total: I + [II or II X 2 or II x (i^+D] + [HI or (IV + VI) or {{IV + V + + (VII or VIII) X (i .1) + K X i + X X (i -1))]+ XI

O 0 0

(the two first alternatives in each bracket [ ] refer to two possibilities which cEin be described by io = 1 and io = 0)

maximum = (275 +485 (i +1) + (775 + 125 (i -1) + 150 i + 330 (i -1) + 350) n =

O 0 0 0

= (1,090 i + 1,430) u.

o

maximum = (1,090 ^og (N-M.2) + 3610) u « (1.1 =log (N-M-2) + 3.6) m.

Hence the complete interpolation procedure (10.5 plus 10.8) requires

(.9 M2 - .4 M + 1.1 ^log (N-M-2) + 3) m.

10.9 To conclude, we take up a variant of the group of Problems 12-13, which illustrates the way in which minor changes in the organization of a problem can be effected ex post, i.e., after the problem has been coded on a different basis. (In this connection, cf. also the discussion of 8.9.)

The description of the function under consideration in Problems 12 and

13. b, i.e., the two sequences pj^,. .. ,pj^j and xj,. .. ,5<f(4 on one hand, and qj^ qjyj and

y, ...,y|^ on the other, were stored in two separate systems of consecutive memory

locations: p,...,p+M-l and q, ...,q+M-l on one hand, and p,...,p-tN-l and q q+N-1

on the other. (lliese are the two storage areas A and B of those two problems. ) For

Problem 13. a the situation is different, since here qj o^yj alone are stored (at

the locations p, . . . ,p-*M-l, storage area A).

Assume now, that these data are stored together with the p^, x^, or the q^, y^, alternating. I.e., at the locations p, . . . ,p+2M-l, or p, . . . ,p+2N-l, with p^, x^ at p+2i.2, p+2i-l,or q^, y^ at p+2i-2, p+2i-l.

Since this variant cannot arise for Problem 13. a (cf. above), and since its discussion for Problem 13. b comprises the same for Problem 12 (because the coding of the former requires combining with the coding of the latter, cf. 10.8), therefore we will discuss it for Problem 13. b.

.43-

We state accordingly:

PROBLEM 13. c.

Same as Problem 13 in its form 13. b, but the quantities yi.-.^.yM and q]^,...,c|)j are stored in one system of 2N consecutive memory locations:

p, p-»-l,...,p+2N-l in this order: qj, y^.-.-.c^, y^.

We must analyze the coded sequences 0-52 of 10.5 and 53-101 of 10.8 which correspond to Problems 12 and 13. b, and determine what changes are necessi- tated by the new formulation, i.e., by Problem 13. c.

Let us consider the code of 10.8, i.e., of Problem 13. b, first. The changes here are due to two causes: First, y- is now stored at p+2i-l instead of q+i-1; second, since the code of 10.5, i.e., of Problem 12, will also undergo changes, the substitutions into it will change.

The first group is most simply handled in this way: Assume that p is odd. Replace the position marks (B. i) , which should be (p+2i-l) instead of

(q+i-1) , by their half values: (i (p+2i-l)) = (Hi + i-1) . We note, for later o ' 2 o 0

use, that this has the effect that D. 3 will contain immediately before XI

(i (p+2K-l)) instead of (B.C) . 2 0 0

Returning to the general question: we must charge the coding of all those places, where such a position mark is used to obtain the corresponding y-. The values of these position marks must be doubled before they are used in this way. Apart from this, however, we must only see to it that q is replaced by

Eii . Tliis affects C. 3 (of 10.8), i.e., 95.

The use of position marks in the above sense occurs only in II, when yj^ and yi^+^^ are obtained. This takes place at 11,6 and 11,9. However, the position marks in question originate in the substitutions 11,2 and 11,5, and it is therefore at these places that the changes have to apply.

We now formulate an adequate coding to replace II. 2-4, so as to give 11,2 and 11,5 the desired effect. Note that at this point D.l contains

(i (p+2k?-l)) = (Eli + k?-!)^ instead of (q+k^-l)^ = (B.k?)^. Hence after 11,1 the accumulator contains (- (D+2k°-l)) .

9 r \ o

.44-

11,1.1

L

2

II.6

Sp

3

38

h

4

38

h

5

42

h

6

42

h

Ac

(p.2k°-l)^

11,6

p+2k°-l

Ac

(p+2k?+M-2)

'^ 1 0

Ac

(p+2k°+2M-3)^

Ac

(p+2k?+2M.2)^

Ac

(p+2k°+2M-l)^

Thus we must replace the three orders II, 2-4 by the six orders 11,1.1-6. Hence the third and second remarks of 8.9 apply: We replace 11,2-3 by 11,1.1-2, then 11,4 by

11,1.2,1 11,1.3 C and let 11,1.3-6 be followed by

II. 1.7

II. 5

Then 11,1.3-7 can be placed at the end of the entire coded sequence. We will give a final enumeration that expresses these changes after we have performed all the changes that are necessary.

The second group must be considered in conjunction with the code of 10.5, i.e., of Problem 12. In the code of 10.8 only XI is involved in the operations of this group. In the code of 10.5 the situation is as follows: Replace the position marks A.i, B. i (of 10.5), which should be (p+2i-2)^, (p+2i-l)^, i.e., (p+2ir+2i-4)^,

(p+2I^+2i-3) , instead of (p+i-1) , (q+i-D^, i.e., (p+R+i-2)^, (5+E'+i-2)^, as nearly

by their half values as possible. Since p is odd, we will use the half value of the

second expression: (- (p+2Ic+2i-3) ) = (E + I^ + i-2) . Then we must change the

'^ 2 ° 2 °

coding of all those places where such position marks are used to obtain the corres- ponding p- and y-: The values of these positicxi marks must be doubled before they are used for a yj , ernd then decreased by 1 before they are used for a p^ . We must also take care that the storage locations, which supply the modified (A.i) , (B.i) position marks, are properly supplied themselves. Apart from these, however, we

must only see to it that XI (of 10.8) produces (~ (p+2k-l))^= (E^l + K + i-2)^ji=i

instead of (p+Ic-1) = (p+lt+i-2) j=]^. Since p, q, or p, q, no longer appear inde- pendently, it is not necessary to projluce (q-p-1) in XI.

The use of position marks in the above sense occurs only in III, V, and VII (of 10.5), when p-^, p-, and x-, Xj+l are obtained. These take place at 111,3, V,2, and VII, 14, 15,21. However, the position marks in question originate in the substitutions 111,2, V,l, and VII,8,9,13, and it is therefore at these places that the changes have to apply.

.45.

TKe position marks (A.i) , (B. i) are supplied from E.2, which in turn is supplied by II and DC (of 10.5). II will no* supply to E.2

(i (p+2R+l)) = (Eli +ir+ i-2) |..2 instead of (p+1) = (p+R) = (p+K+i-2) |. ,.

The function of DC is actually performed by VIII, and it will maintain in E.2

(i (p+2E-+2i-l))^= (E^ + E + i-1)^ instead of (p+id)^ = (p+E+i-D^. If we keep

these facts in mind when modifying III, V, VII, then we need not change II, IX (i.e., VIII).

We now give adequate codings, to insert before 111,2 and before V,l, and also to replace VII, 7 before VII, 8, 9, and to replace VII, 10-12 before VII, 13, so as to give 111,2, V,l, and VII, 8, 9, 13 the desired effect. Note that at these pyoints, as we observed above, D.4 (i.e., 41, substituted from XI of 10.8) contains

(i (p+2ir-l))^, and E.2 contains (| (p+2ir+l))^ and (1 (p+2ie+2i-l))o, respectively.

Hence before 111,2, V, 1, and VII, 7, the accumulator contains (— (p+2Ic-l)) ,

(i (p+2f+2i-l)) and (i (p+2K+2i-l)) , respectively. 2 0 2 o '^ '

111,1.1

L

2

D.5

h-

V.O.l

L

2

D.5

h-

VII, 6.1

D.5

h-

2

L

VII, 9.1

E.2

2

D.l

h

3

E.l

h-

4

L

Ac Ac Ac Ac Ac Ac Ac Ac Ac Ac

(p+2ir.l)^

(p+2K-2)°

(p+25J+2i.l)^

(p+2E+2i-2)^

(% (p+2E+2i-l)-l)^

(p+2ie+2i-3)^

(% (p+2R+2i-l))^

(H (p+2I?-2i.l)4M-l)^

{% (p+2E+2i-l)+h-l)

(p+2ir+2i+2h-3)

Thus we must insert the orders 111,1.1-2 before 111,2; insert the orders V,0.1-2 before V,l; replace the order VII, 7 by the two orders VII, 6,1-2; and replace the three orders VII, 10-12 by the four orders VII, 9. 1-4. Hence the third and second remarks of 8.9 apply again: We replace 111,1 by

111,0 111,1.0 C

and let 111,1.0 coincide with 111,1 and be followed by 111,1.1-2 and then by

111,1.3 111,2 C

Next we replace V, 1 by

V.O V.O.l c

and let V,0.1 be as specified above, and be followed by V,0.2, then by V, 1, and

finally by

.46-

V.1.1

V.2

Finally we replace VII, 7 and VII, 10-12 by VII, 6. 1-2 and VII, 9. 1-4. It is best to effect this as a replacement of the entire piece VII, 7-12 by VII, 6. 1-2, VII, 8-9, VII, 9. 1-4 (a total of six orders to be replaced by a total of eight orders). Tliis means that we replace VII, 7-11 by VII, 6. 1-2, VII, 8-9, VII, 9.1, then we replace VII, 12 by

VII, 9. 1.1 VII, 9.2 C

and let VII, 9. 2-4 be followed by

VII, 9.2. 5 VII, 13 C

Then 111,1.0-3; V, 0.1-2, V.l, V,l.l; VII, 9. 2-5 can be placed at the end of the entire coded sequence. We will give a final enumeration that expresses these changes after we have performed all the changes that are necessary.

Returning to the second group

affects only XI (of 10.8). We saw above that

in the coding of 10.8, we not at XI must produce (— (p+2It-l

te that it

-^ ,f, I)) and

substitute it into 41, smd that this is all that has to be done there. However, we noted before that D. 3 before XI contains precisely {- (p+2ir-l)) . Hence XI, 1-9 (i.e., XI in its entirety) may be replaced by

XI,

3.1

D.3

2

41

S

3

e'

c

Ac 41

(j (p+2K-l))^ (1 (p+2R-l))

Hence we replace XI, 1-3 by XI, 0.1-3, and since operations of the code of 10.8 end at this point, XI, 4-9 may be left empty.

To conclude, we observe that C. 3 must contain (El_) = (E-i - 1)

2 0 2 °

instead of (q-1) , and that neither p nor q are needed in any other form, so that

C. 9 may be left empty.

We are now in possession of a complete list of all changes of both codes 0-52 of 10.5 and 53-101 of 10.8. We tabulate the omissions and modifications first, and the additicns afterwards.

Ohiissions and Modifications:

From

To

(10.8)

11,2-3

11,1.1-2

II. 4

11,1.2.1

(10.5)

111,1

111,0

V.l

V,0

VII, 7-8

VII, 6.1-2

VII, 9-10

VII, 8-9

VII, 11

VII, 9.1

VII, 12

VII, 9. 1.1

.47.

Cbiissions and Modifications (cont. ):

From

To

(10.8) : XI, 1-3

XI, 4.9

C.3

C.9

XI, 0.1-3 Empty

2 0 Empty

Additions:

(10.8) :

11,1.3-7

(10.5) :

111,1.0-3

(10.5) :

V, 0.1-2

v,i

V.1.1

(10.5)

VII, 9. 2-5

We can use five of the six empty fields )Q,4-9 (from 10.8) to acconriodate 11,1.3-7 (from 10.8) -- say XI, 4-8. C.9 is the last word of the code: 101, hence we can place 111,1.0-3; V,0.1-2, V,l, V,l.l, VII, 9.2-5 (from 10.5) in a sequence that begins there. They will then occupy these positions:

111,1.0-3 V. 0.1-2

101-102' 103-103'

v.i

V.1.1

104 104'

VII, 2-5

105-106'

(All these are from 10.5.)

Now we can formulate the final form of all changes in the coded sequences 0.52 and 53.101:

5

10 14 15 16 17 57

101 c ,

103 C ,

42 h-

L ,

18 Sp'

21 Sp',

49

105 C ,

L .

59 Sp

66 C

50

41 S

e'C

38 h

38 h

42 h

42 h

58 C

--

58 65 66 67 68 69

The following durations are affected:

(10.5) :

(10.8)

III:

+ 130 IX

V:

+ 130 n

VII:

+ 130 n

II:

+ 180 ^

K:

- 225 u.

95

(^)o

101

41 2 ,

L

102

42 h-.

5 C

103

L ,

42 h-

104

10 Sp',

10 C

105

38 h ,

48 h-

106

L .

17 C

.48-

Total: (10.5) : (130 + 130 (M-1) + 130 MiMJi ) ^ =

= (65 M= + 65 M) (.07 M* + .07 M) m. Total: (10.8) : (180 (i + 1) - 225 i ) ^A = (- 45 i„ + 180) \i

0 0 o

maximum SS . 2 m. Hence there is no relevant change in the estimate at the end of 10.8.

-49. 11.0 CODING OF SOME COMBINATORIAL (SORTING) PROBLEMS

11.1 In this chapter we consider problems of a combinatorial, and not analytical character, lliis means, that the properly calculational (arith- metical) parts of the procedure will be very simple (indeed almost absent), and the essential operations will be of a logical character. Such problems are of a not inconsiderable practical importaince, since they include the category usu- ally referred to as sorting problems. They are, furthermore, of a conceptual interest, for the following reason.

Any computing machine is organized around three vital organs: The memory, the logical control, and the arithmetical organ. The last mentioned organ is ein adder-subtractor-multiplier-divider, and the multiplier is usually that aspect which primarily controls its speed (cf . the discussions of Part I. ) The efficiency of the machine on all analytical problems is clearly dependent to a large extent on the efficiency of the arithmetical orgein, and thus primarily of the multiplier. Now the non-analytical, combinatorial problems, to which we have referred, avoid the multiplier almost completely. (Adding and subtracting is hardly avoidable even in purely logical procedures, since the operations are needed to construct the position marks of memory locations 2ind to effect size comparisons of numbers, by which we have to express our logical alternatives. ) Consequently these problems provide tests for the efficiency of the non-arith- metical parts of the machine: The memory and the logical control.

11.2 We will consider two typical sorting problems: Those of meshing and of sorting proper. There are, of course, m8iny others, and many variants for each problem, but these two should suffice to illustrate the main methodical principles.

In order to formulate our two problems, we need the definitions which

folic

We operate with sequences of complexes. A complex X = (x; u,,...,u ) consists of p+1 numbers: The principal number x and the subsidiary numOers

u ,...,u . p is the order of the complex. A sequence S= (X X '^

consists of n complexes X = (x ; u. ,...,u ). n is the length of the sequence. Throughout what follows we will never vary p, the (arbitrary but) fixed order of all complexes to be considered. We will, however, deal with sequences of various lengths.

A sequence 5= (X* ,...,X " ) is a monotone if the principal elements x of its complexes X = (x, u;,...,u) form a monotone, non decreas- ing sequence:

(1) x'" g x*=" g ... ^

(1) <r „(2) ^ < ^<

S X"

A sequence T - (Y Y") is a permutation of another sequence S - (X

...,X*" )of the same length, if for a suitable permutation i »i' of the i = 1 n

(2) Y<'' = X<i'' (i = l,...,n).

-50-

Given two sequences 5 = (X'^' X<°'), T=(Y<1' Y'"') (of not necessarily

equal lengths n, m), their stun is the sequence [5, T] = (X<^' X'"\ V'^ ',...,¥<■ ')

(of length n + m).

We can now state our two problems:

PROBLEM iU. (Meshing)

Two monotone sequences S, T, of lengths n, m, respectively, are stored at two systems of n(p+l), m(p+l) consecutive memory locations respectively: s, s+1, . . . , s+n(p+l)-l and t, t+1,..., t+m(p+l)-l. An accomodation ftr a sequence of length n + m, cmsisting of (n + m)(p + 1) consecutive memory locations, is available: r, r+l,..., r+(n-hn)(p+l)-l. The constants of the problem are p, n, m, s, t, r, to be stored at six given memory locaticns. It is desired to find a monotone jjermutation R of the sum [S, T] , and to place it at the locations r, r+l,..., r+(n-*m)(p+l)-l.

PROBLEM 15. (Sorting)

A sequence 5 (subject to no requirements of monotony whatever) is stored at n(p+l) consecutive memory locaticxis: s, s+1,..., s+n(p+l)-l. The constants of the problem are s, n, p, to be stored at three given memory locations. It is desired to find a monotone permutation S* of 5, and to replace S by it.

11.3 We consider first Problem 14, which is the simpler one, eind whose solution can be c aiveniently used in solving Problem 15.

u(i) .. (i)

We have 5 = (X<1> X<°'), T= (¥<!' Y<-') with X< ^ ' = (x''';

., ..... u'i'), Y<J' = (y<j'; v{j\... v^j'), and we wish to form fl = (Z '^*,..., 2(n+m)) ^^ith Z'"*' = (z^''^ w|''\... ,w*^').''which is a monotone permutation of [S, T],

Forming /f can be viewed as an inductive process: IfZ ,...,Z for

a k=l n+m, have already been formed, the inductive step c msists of forming

Z . It is preferable to allow k = n+m+l,tcK), in the sense that when this value of k is reached, the process is terminated. Assume, therefore, that we have formed Z ,...,Z for a k = 1, . .. , n+m+l. It is clear, that we may assume in addition,

that these Z^^ ' . . . . .Z""" ^ ' are the X' ^ * X'^k' together with the Y< ' ' Y'-i*.

for two suitable i, , i, with

(1) i|^+j^ = k-l i^=l,...,n, j^ = l,...,m.

Then we have the following possibilities:

(a) i. =n. j, ~ m : By (1) k= n+m+l, hence, as we observed above, B is fully formed, and nothing remains to be done.

(b) Not i =n, j =m: By (1) k ^ n +m, hence, as we observed above, R is not fully formed, and Z"* must be formed next. Clearly, we may choose Z"'' as one of X'^k"^'' and Y*Jk+l>, we must decide which.

so that u = 0 for z"'' = X<'k'^" and

k

We introduce a quantity W. . (J. = 1 for Z<'''=Y'Jk+i)/

.51-

(i). =

1^ - 0 implies i^+i = i^ "^ 1. j^+i = j^! "^k = ^ implies i^+j = i^, j^+l ~ J|| "'^^- '^k is determined according to the following rules: (b.l) i^ = n, hence j^^ * m: S is exhausted, hence w = 1. ^''•2) j^ = m, hence i^ + n: T is exhausted, hence (») = 0. (b.3) i^ * n, j|^ * m: Neither S nor T is exhausted. We must distinguish further:

(b.3.1) x*'k"^^* < y<Jk"^'': Necessarily U)^ = 0.

(b.3.2) x'»k*^' > y'Jk+": Necessarily U)^ = 1.

(b.3. 3) x''k*'> = y^Jk"^^*: Both W^ = 0 and OJ^ = 1 are acceptable. We choose W. = 0.

As pointed out above, (a), (b) describes an inductive process which runs over k = 1,..., n+m+l. It begins with k = 1 and ^l ~ Jl ~ '^ (owing to (1)), and then progresses from k to k+1, forming the necessary i , j and w as it goes along.

It is convenient to denote the locations s and t, where the storage of the sequences 5 and T begins, by a conmon letter and to distinguish them by an index:

(2) s" = s, s^ = t.

Correspondingly, let A and A be the storage areas corresponding to the two inter- vals of locations from s to s +n(p+l)-l and from s to s + m(p+l)-l. In this way

their positions will be A .1 n(p+l) and A .1,..., m(p+l), where A .a and A .b

correspond to s +3-1 and s +b-l, and store x for a = (i-1) (p+1) +1, u ' for a - (i-l)(p+l)+q+l, y<j' for b = (j-l)(p+l)+l, v<J> for b = (j-l)(p+l)+q +1. respectively. Next, let B be the storage area intended for the sequence fi, corres- ponding to the interval of locations from r to r+(n+Tn)(p+l)-l. In this way its positions will be B.l,..., (n+m)(p+l), where B.c corresponds to r+c-1, and is intended to store z'^' for c = (k-l)(p+l)+l, w"'* for c = {k-l)(p+l)+q+l, respectively. As in several previous problems, the positions of A , A , and B need not be shown in the final enumeration of the coded sequence.

Further storage capacities are needed as follows: The given data (the constants) of the problem, s , s , r, n, m, p, will be stored in the storage area C. (It will be convenient to store them as (s )q, (s )g, r^, (n(p+l))Q, (m(p+l))Q, (p+l)g. We will also store 1q in C. ) Next the induction indices k, q' will have to be stored. It is convenient to store i. , j. , too, along with k, while it turns out to be unnecessary to form and to store U) explicitly. These indices i, j, k, q' are all relevsmt as position marks, and it will prove convenient tostcre in their place (s° + i (p+1 ) )q, (s' + j (p+1 ) ) q, ( r + (k-1 )(p+l) )q

(s"+h(p+l) +q'-l)o, (r +(k-l)(p+l) +q'-l)o (i.e. (A° . i(p+l )+l)o , (A' . j (p+D+D^, (B.(k-l)(p+l)+l)o, (A'^.h(p+1) +q')o, (B.(k-l)(p+l) +q')o; here(.) = u)^, and h = i or j for U) = 0 or 1, respectively) Note, that two position marks that correspond to q' are being stored. The three first quantities will be stored in the storage area D, and the two last ones in the storage area E.

-52-

The static (

:ocl

ing of

the

boxes I-X follows

(s'')o

CI

Ac

D.l

S

D.l

(sMo

C.2

Ac

D.2

S

D.2

C.3

Ac

D.3

S

D.3

(to II, 1)

We CEUi now draw the flow diagram coding obtains from this without a need for

CI

I.l

2 C2 1.3

4

C3 1.5

6

C4

II, 1

2

3

4

C5

111,1

2

3

4

IV, 1 2 3

4

as shown in Figure 11.1. The actual further conments.

(to 111,1)

(to V,l)

(n(p-t

■l))o

D.l

CI

h-

C4

h-

IV, 1

Cc

(m(p+

l))o

D.2

C2

h-

C5

h-

VI, 1

Cc

D.2

C2

h-

C5

h-

(to VII, 1)

V.l 2 3 4

5

D.l •V,6 D.2 V.5

Co

Sp Sp

s^ +j(p+l)

h-

s^+Kp+l) h-

VI. 1 Cc

(to VII, 1)

Ac Ac Ac

Ac

(s°),

(sM( (sM„

(r)o (r)„

(s° +i(p+l))o

(i(p+l))o ((i-n)(p+l))o

Ac

(s^+j(p+l))„

Ac

(j(p+l))o

Ac

((j.m)(p+l)),

Ac

(s'^j(p+l))o

Ac

(j(p^l))o

Ac

((j-m)(p+l))o

Ac

(s°+i(p+l))(,

V,6

s''+i(p+l)

Ac

(s^+j(p+l))o

V.5

s^ +j(p+l)

Ac

yj+1

y . , - X. ,

-53-

D.i (a: I),

3 i^.\).

©-

1

CA'.I\, toD.l (A'.iX to Z (B.% to 3

O-Yl

D.l (A'.i(ion) -^ l)t Z(A'.f(f*0-tl)»

"3

3

-"♦-

f- K'-

' t

■i

K

, a -n

JL -f 3 f -»• Jg

SL

y: -1 3 t*

' -

±L

n

SE

i'

= i + )

f

= /

CO

= o

h

= J

2

W y/l*)

(A'.j,Cp-hi)*ii UE.i

10

D.I

2 £.1

Co

MA

[?5

/o

>.-»■

F^

vnr

(B.K (r*')-i-')o to D.3

ft) B.(K-lXirH)*l

P. 3

«?'

H

^

K>

E.I Z B.df-iXfit-O-n

(A.h(p*i)*f'-K). (B.(K-i)(r>-ih<(fi),

i""

- for .f>f'

"PT

W.-

ia;

Y io d.(K-iXf*i)->-<j'+i

ca'^h (r>+i)->-f'-i-i)o to E.I

(B.CK-l)(pi-i)-Kf'+l).i« 2

^'. -5' »", «, '^;

IGURE

11.1

£./ (A'lhip^O-'-f'L

^ (B.(K-o(/^ii-^<r'i

B.(K-0(p*i)i-i

i (p.n) i-l A'.i. (p*i) ff-f-i

'*>

-54-

C.6

(p+l)o

vi.i

D.l

2

E.l

S

3

C.6

h

4

D.l

s

(to

VIII

1)

VII, 1

D.2

2

E.l

s

3

C.6

h

4

D.2

s

(to

VIII

1)

VIII, 1

D.3

2

VIII, 9

Sp

3

E.2

s

4

C.6

h

5

D.3

s

6

E.l

7

VIII, 8

Sp

8

_.

s'^+h(p+l)

r+(k-l)(p+l)

]

S]

Ac E.l Ac D.l

Ac E.l Ac D.2

Ac

VIII, 9

E.2

Ac

D.3

Ac

VIII, 8

Ac

(s^+ilp+D),

(s"+i(p+l))o (s'' + (i+l)(p+l))o (s°+(i+l)(p+l))o

(s^+j(p+l))o

(s^+j(p+l))o

(s^+(j+l)(p+l))o

(si+(j+l)(p+l))o

(r+(k-l)(p+l))o

r+(k-l)(p+l)

(r+(k-l)(p+l))o

(r+k(p+l))Q

(r+k(p+l))o

(s'^+h(p+l))„

s'^+h(p+l)

(to IX, 1)

10

r+(k-l)(p+l)+q' S]

(toX,l)

B.(k-l)(p+l)+l z"'>

C.7

lo

IX,1

E.2

Ac

(r+(k.l)(p+l)+q'-l)o

2

C.7

h

Ac

(r+(k-l)(p+l)+q')o

3

IX,10

Sp

IX, 10

r+(k-l)(p+l)+q'

4

E.2

S

E.2

(r + (k-l)(p+l)+q')o

5

EJ

Ac

(s'^4h(p+l)+q'-l)o

6

C.7

h

Ac

(s^+h(p+l)+q')o

7

IX, 9

Sp

IX, 9

s"^ +h(p+l)+q'

8 9

E.l

S

E.l

(s'^+h(p+l)+q')o

s'*'+h (p-

H)+q' ]

Ac

a

(k)

B.(k-i)(p+i) +q'+i w*";

q

-55-

1

E.2

2

D.3

h-

3

C.7

h

4

11. 1

Cc

(to IX.l)

Ac

(r+(k-l)(p+l>+q')o

Ac

(q'-p-Do

Ac

(q'-p)o

The ordering of the boxes is I, II, III, V, VII, VIII, IX, X, and VII, VIII, IX must also be the iinnediate successors of IV, VI, X, respectively. This necessitates the extra orders

IV. 5

VII, 1

c

VI,5

VIII, 1

c

X,5

IX, 1

c

We must now assign C. 1-7, D.1-3, E.1-2 their actual values, pair the 59 orders 1,1-6, 11,1-4, 111,1-4, IV,l-5, V,l-7, VI, 1-5, VII, 1-4, VIII, 1-9, IX, 1-10. X,l-5 to 30 words and then assign I,l-X,5 their actual values. These are expressed in this table:

1,1.6

II. 1-4

111,1-4

V.1.7

0 -2'

VII, 1-4

3 .4'

VIII, 1-9

5 -6'

IX,1-10

7 -10

X,l-5

10'-12 12'-16' 17 -21' 22 -24

IV, 1-5

VI, 1-5 C.1-7 D.1-3 E.1-2

24 '-26' 27 -29 30 -36 37 -39 40 -41

Now we obtain this coded sequence:

0

30 .

37 S

1

31 .

38 S

2

32 ,

39 S

3

37

30 h-

4

33 h-

24 Cc'

5

38

31 h-

6

34 h-

27 Cc

7

37

9 Sp'

8

38

, 9 Sp

9

-

, - h-

10

27 Cc

, 38

11

40 S

, 35 h

12

38 S

, 39

13

16 Sp

, 41 S

14

35 h

39 S

15

40

16 Sp

16

-

- S

17

41

36 h

18

21 Sp'

, 41 S

19

40

, 36 h

20

21 Sp

, 40 S

21

.

, - s

22

41

, 39 h-

23

36 h

, 3 Cc

24

17 C

, 38

25

31 h-

, 34 h-

26

e Cc

, 10 Cc'

27

37

, 40 S

28 29 30 31 32 33 34 35 36 37 38 39 40 41

35 h , 12 C, (s°)o (sM„

(n(p+l))o (m(p+l))o

(p^Do

37 S

The durations may be estimated as follows:

I: 225 u, II: 150 u, III: 150 ^, IV: 200 u, V: 275 u, VI: 200 n, VII: 150 u, VIII: 350 u, IX: 375 ^i, X: 200 n.

_ , ^ / II + (III or (III +V) or IV) + (VI or VII) +)

Total: I -U VIII . (IX . X) x p / x („ .^) Mil*

IV)

.56-

maximum = (225 + (150 +425 +200+350+575 xp) x (n + m) + 350) ^ = = ((575 p + 1,125) (n + m) + 575) ^i »=> «^.6 ((p + 2) (n + m) + 1) m

This result will be analyzed further in 11.5.

11.4 We pass now to Problem 15, which will be solved, as indicated above, with the help of the solution of Problem 14.

We have 5 = (X']' X*"') with X'^' = (x'^'; u'^* u^^'), and we

wish to fonii an S* = (X' ,...,X ), which is a monotone permutation of S.

This can be achieved in the following manner: If a certain permutation S*° - (X .....X*" ) of 5 has been found, which may not yet be fully monotone, but in which at least two consecutive intervals X*"" ', ...,X ''''"^' and X +' , . . . ,X ''+*+J * are (each one separately) monotme, then we can mesh these (in the sense of Problem 14), and thereby obtain a new permutation

5*o° =x<l'°°> X'"'°°') of 5*°, i.e. of 5, for which the whole interval

X X "'"*■*■•'" is monotone. Thus we can convert two monotone

intervals of the lengths i, j into one of the length i + j. The original 5 is made up of monotone intervals of length 1, since each X (separately) may be viewed as such an interval. Hence we can, beginning with these monotone intervals of length 1, build up monotone intervals of successively increasing length, until the msLximum length n is reached, i.e. the permutation of S at hand is monotone as a whole.

This qualitative description can be formalized to an inductive process. This process goes through the successive stages v = 0, 1, 2 In the stage

V a permutation S*^ =(X ,...,X " ) of S is at heind, which is made up of consecutive intervals of length 2^, which are (each one separately) monotcne. (Since n may not be divisible by v, the length of the last interval has to be the remainder r of the divisioi of n by 2^, r < 2^. If n is divisible by 2'', we should put r - q and rule this interval to be absent, but we may just as

well put r = 2*, and still rule it to be the last interval.) Now a sequence of steps of the nature described above will produce a new permutation S*^ of 5*", i.e. of S, in which the monotone intervals of length 2^ in S" are pairwise meshed to monotcne intervals of length 2'"'" in S*^ . (The end-effect for v+1 can be described in the fame terms as above for v.) This inductive process begins with v =0 jmd S*" = S. It ends when a v with 2'' ^ n has been reached, the corresponding S*^ is the desired (monotoie) 5*. (Note, that at this jx)int there is only one interval: It is the final interval of length r 12" referred to above, in this case with r =n . ) Using the function <z> , which denotes the smallest integer ^ z, we may therefore say that this process terminates with

V = <^log n>.

The induction over v = 0, 1, 2,..., <^ log n> is, however, only the primary induction. For each v we have <^ ^ intervals of length 2" (cf. above),

these form<y i <^-i^^ = <\-^)> pairs, which have to be meshed to <^-^^ intervals of length 2"'^ (cf. above), in order to effect the inductive step from v to v + 1.

.57.

If we enumerate these interval pairs by an index w = 1,..., <^ '^'^^ i then it becomes clear that we are dealing with a secondary induction, of which w is the index.

We can now state the general inductive step with complete rigor:

Gjnsider a v = 0, 1, 2, . . . , and assume that the permutation

5*' = (X X " ) has already been formed. We effect a secondary induction

over a w = 0, 1, 2 Assume that a certain w has already been reached. Then

2^ w ^ n. We now have to mesh two intervals of the length n^, m_^, i.e. X with i = 2'+^w + l,..., 2»+lw+n^ and X<j"* with j + 2'+'w + n^ + 1 2''+lw +n^ +m^.

Ordinarily i\,, ~ "U ~ 2", i.e. this is the case when both these intervals can be accomodated in the interval l,...,n. Thus the condition fcr this case is 2»+ (w+1) g n. Otherwise, i.e. for 2^'*' (w+1) > n, we have two ptossibilities: First: n^ = 2' if this interval can be accomodated in the interval l,...,n, i.e. if 2^+ w+2' g n. nr, is then chosen so as to exhaust what is left of the interval l,...,n, i.e. m^, = n - (2" w +2*). Thus the condition fcr this case is

2'+'(w+l) > n ^2'+^w + 2\ We may include 2'+^(w+l) = n, too, since the formulae of the present case coincide then with those of the previous one. Second: Other- wise, i.e. for 2^'''w +2^ >n, the second interval is missing "U ~ 0- % ^^ then chosen so as to exhaust what is left of the interval l,...,n, i.e. n^ = n - 2^ w. Thus the condition for this case is 2"+ w + 2^ > n (zrnd, of course, i 2^"*' w). We

may include 2^* w + 2' =f n, too, since the formulae of the present case coincide then with those of the previous one. These rules can be sunned up as follows:

f %- 2^ . -^ = 2^

for 2^+^ (w+1) i n,

(3) < "w = 2' ' "\v = " - (2'"''w+2»)

^ for 2'^Hw+l) ^ n i 2»'-iw +2^

n^ = n-2'+^w , % = 0 ^ for 2'+lw + ^ n (^ 2^+^w).

If 2''*^(vi+l) < n, then the (secoidary) induction over w continues to w + 1; if 2»+l(w+l) ^ n, then the induction over w stqps. If the induction over w stops with a w > 0, then the (primary) induction over v coitinues to v + 1; if the induction over w stops with w = 0, then the induction over v stops. At any rate these meshxngs form the permutation S*'"^' . If the induction over v stops with a certain v, then its S*'+ is the desired S*.

There remains, finally, the necessity to specify the locations of S*' and 5*'*\ which control the meshing processes that lead from S*' to ^S*'* . Assume that 5*' occupies the interval of locatiorrs from a " to a ' ♦T»(p+1)-1, and S""^' similarly the interval of locations from a*'"^" to a*'"^'* + nfp+l)-l. Then the meshing process which corresponds to a given w meshes the sequences that occupy the intervals from a*'' +2'''*w(p+l) toa'"' + (2'''''w +n^)(p+l)-l and from a<»> +(2»+'w +n^)(p+l) to a*'' +(2'**w +n^ +in^^)(p+l)-l, and places the resulting sequence into the interval from a*'+* > +2'+'w(p+l) to a' '*' ' + (2' + 'w + n^ + m„)(p+l)-l . The meshing process is that one of Problem 14.

-58-

We distinguish the constants of that problem by bars. The above specifications of the locations that are involved can then be expressed as follows:

(4)

<

/^s" =a<^> + 2^+»w (p+1), s^ =a<^> +(2^+lw+n^)(p+l).

^

= "w'

= P

Clearly the interval from a to a +n(p+l)-l and the interval fron a to a +n(p+l)-l must have no elements in conmon .

We need such £in a , i.e. an interval from a to a +n(p+l)-l, for every v for which S*" is being formed. It is, however, sufficient to have two such intervals which have no elements in conmon, say from a to a+n(p+l)-l eind from b to b +n(p+l)-l. We can then let a alternate between the two values a and b, i.e. we define

(5)

■M

[- a for V even

(0)

Hence a *" ' - a. Consequently

(6)

It b for V odd

but 5* = S, hence the statement of IVoblem 15 requires a

s - a.

(0) =

Thus a is the s of Problem 14, and b is any such location such that the interval from a to a +n(p+l)-l and the interval from b to b+n(p+l)-l have no elements in conmon .

we want a'^+^' =a^*"

We want the final -S* to occupy the location of the original S, i.e. a for the final v with S"+^ =5*. I.e. this v+1 should be even. We saw further above, that the induction over v can stop when the induction over w stops with w=0, i.e. when 2^+ ^n. This v+1 may be odd; let us therefore agree to perform one more, seemingly superfluous, step from v to v+1. I.e. we will terminate the induction over v when

(7) 2"+^ ^ n and v+1 even, i.e. a<^+^' = a.

Hence this v + 1 is the smallest even X with 2 2 n, i.e. 2A.' for the smallest

integer X' with 2

(8)

^^' J n; i.e. 4^' ^ n. This means that +1 = 2 <*log n> .

-59-

In the coded sequence that we will develop for our problem, the coded sequence that solves Problem 14 will occur as a part, as we have already pointed out. This is the coded sequence 0-43 in 11.3. We propose to use it now, and to adjust the coded secjuence that we are forming accordingly.

This is analogous to what we did in 10.6 and 10.7 for the Problems 13. a and 13, b: There the coded sequence formed in 10.5 for Problem 12 was used as part of the coded sequences of the two former problems. There is, however, this diffe- rence: In 10.6, 10.7 the subsidiary sequence (of Problem 12) was attached to the end of the main sequences (of Problems 13. a, b), while now the subsidiary sequence (of Problem) 14) will occur in the interior of the main sequence (of Problem 15) indeed it is a part of the inductive step in the double induction over v, w. The constants of Problem 14 have already been dealt with: They must be substituted according to (4) above.

In assigning letters to the various storage areas to be used, it must be remembered, just as at the corresponding points in 10.6, 10.7, that the coded sequence that we are now developing is to be used in cmjunction with (i.e. as an extension of) the coded sequence of 11.3. It is therefore again necessary to classify the storage areas required by the latter: We have the storage areas C-E, which are incorporated in the final enumeration (they are 30-41 of the 0-41

of 11.1); and a", a* and B (i.e. + S (p+l)-l; s\ . . . , i' + Si (p+D-l

and r,..., r + (n+in)(p+l)-l) , which will be part of our present A, B (i.e. of

a a +n(p+l)-l and b, . . . , b +n(p+l)-l, they will be a*'' + 2' + lw(p+l), . . . ,a'' * +

+ (2'+lw +n^)(p+l)-l; a<^' +(2'+lw+n^)(p+l),..., a*' ' +(2'+!* +n^+ m^)(p+l)-l,

and a*^-'^' +2' + Mp+l) a<'+> '+(2^+^ +n^ +m^)(p+l)-l, cf. (4) above).

Therefore we can, in assigning letters to the various storage areas in the present coding, disregard those of 11.3.

Let A and B be the storage areas corresponding to the intervals from a to a+n(p+l)-l and from b to b+n(p+l)-l. In this way their positions will be

A. 1,. . . ,n(p+l) and B. 1 n(p+l), where A.i and B. i correspond to a+i-1 and b+i-1.

A will store 5 at the beginning and S* at the end of the procedure. B may be at any available place, and we assume it to be irrelevantly occupied. In the course of the procedure A and B are the alternate values of A (for a = a and b, i.e. for V even and odd, respectively), and 5 is stored at A * while S ' or S*'"'" ' is being formed. All these storages are arr2inged like the storage of S at in 11.3.

The given data of the problem, a, b, n, p, will be stored in- the storage area C, with the exception of p. (It will be convenient to store them as ag, b(j, n(p+l)Q. A 0 will also be stored in C. ) p is also needed in the coded sequence of 11.3, and it is the only one of the constsints of that problem which is independent of the induction indices v, w. (Cf. (4) above. ) Hence its storage in that sequence, at 35 (as (p+D.) is adequate for our present purfKjse. The other constants of that problem depend on v, w (cf. above), hence their locations, 30-34, must be left empty (or, rather, irrelevantly occupied), when our present coded sequence begins to operate, and they must be appropriately substituted by its operation.

.60-

The induction index v will be stored in D. (It will be convenient to form (2^"''^(p+l))(,, and to store (a^'Mg, (a**"*"^' )q along with it.) The induction index w is part of the expressions which have to be placed at 30 and 32 ((s )q

and (?)(,, i.e. by (4) (a<^' +2-+lw requires no other storage

■.p+D)

eind ((

oe piacea

2'+*w (p+l))o), hence it

We can now draw the flow diagreun, as shown in Figure 11.2. Tlie actual coding obtains from this quite directly, in one instemce (at the beginning of box VI) the accumulator is used as storage between two boxes.

The static coding of the boxes I-XIV follows.

CI

^0

2

bo

I.l

35

2

D.l

S

3

CI

4

D.2

S

5

C2

6

to

II. 1)

D.3

S

II. 1

D.2

2

30

S

3

D.3

4

32

s

(to

III.l)

III.l

30

2

D.2

h-

3

D.l

h

C.3

(n(p+l))o

111,4

C3

h-

5

(to

v.i)

IV. 1

Cc

IV. 1

C3

2

D.2

h

3

31

s

4

30

h-

5

33

s

C.4

0

IV. 6

C4

7

34

s

(to IX. 1)

Ac

(p-Do

D.l

(p+Do

Ac

«o

D.2

«0

Ac

\

D.3

\

Ac

(a^^>)„

30

(a<^')„

Ac

(a<'^^')o

32

(a^'^^Mo

Ac

(a''' +2-+lw(p+l))o

Ac

(2'+lw (p+l))g

Ac

((2'+lw + 2-)(p+l))

Ac

((2'+^w +2^-n)(p+l)),

Ac

(n(p+l))o

Ac

(a''>+n(p+l))o

31

(a<^>+n(p+l))o

Ac

((n-2»+lw)(p+l))

33

((n-2-+lw)(p+l))

Ac

0

34

0

-61-

o

^'1

(pi-i)o D-1 (B.l)c to 3

D.l (pi-Ik

Z (A.lK 3 CBJ\

Z \

3 (A'"*''. IK

-CIHEF

YTF

(/"^i'Oo to 2

nfl

©

M.

-♦-J. a i^-

A.h/^'^':i\

M

+ i\. 6 >k-

3

TUT.

#

Z''*-n

X

i->k g i.-

z'""(\Ni-i) - n

IK

jiB

O - 2*f (Ptx>hUm 14)

^ (A'^'.li 32 (a"^'.iX

(A"'*'ilXto 3Z

>■ 4

S

w

HL

Z^V/i-Z^'-rx

6 ^r

sr

z'""(w ■*■!)-»

'ynr

- '' G 'r+

7

mL

Z^pi-O ^o 3f ^f77-<'2'*tv^z%^/;;„ ^o 5f-

^r 7 ir

3/ r/^''';!r2'^W^«^X;;*';+/;.

34 ^»7^ C/^0)o

rt, ^, ;^, ^ V VV

A/oUt

AAur,ht.^S C-^l

Figure 11. £

-62-

V,l D.l

2 33

3 30

4 D.l

5 31 (to VI, 1)

VI.l D.2

2 D.l

3 C.3

4 VII, 1 (to VIII, 1)

VII, 1 C.3

2 30

3 D.2

4 D.l

5 34 (to IX,1)

VIII, 1 D.l 2 34 (to IX,1) DC (Problem 14: (to X,l)

30

X.1 2 3 4 5 6

D.2 D.l D.l C.3 XI, 1 (to XIII, 1) XI, 1 D.l

2 D.l

3 C.3

4 XII, 1 (to XIV.l)

XII, 1 C.l

2 D.3

3 s.l

4 s.l

5 e (to XIV, 1)

h S

h- h h- Cc

h-

h

h-

S

0-29.)

h-

h

h

h-

Cc

h

h-

Cc

h- S -M Cc

Ac 33 Ac Ac

31

Ac Ac Ac

Ac Ac Ac Ac 34

Ac

34

Ac Ac Ac Ac Ac

Ac Ac "s.l Ac

(2Mp+l))o

(2Mp+l))o

(a*"' +2'+iw (p+l))o

(a<''*+(2»+iw + 2»)(p+l))(j

(a'^'+(2-+lw+2')(pn))j

((2'+^+2M(p+l))„

(2-+i(w+l)(p+l))p

((2»+i(w+l).n)(p+l))o

(n(p+l))o

((n-2-+»w)(p+l).a<^')(,

((n.2'+lw)(p+l))o

((n-(2'+lw+2M)(p+l))o

((n-(2'+^+2''))(p+l))o

(2Mp+l))o (2'(p+l))o

(a'^'+2'+>w(p+l))Q (2'+lw(p+l))o ((2'+^w + 2M(p+l))o (2^+i(w+l)(p+l))o ((2-+Hw+l)-n)(p+l))(

Ac

(2Mp+l))„

Ac

(2»+i(p+l))o

Ac

((2^+l-n)(p+l))o

(a-a'^+l>)o (a-a<^+l>)o .|(a-a<^-l>)4

.63-

CIII.l

30

2

D.l

h

3

D.l

h

4

30

S

5

32

6

D.l

h

7

D.l

h

8

32

S

(to XIV, 1

III.l) D.l

2

D.l

h

3

D.l

s

4

D.2

5

s.l

s

6

D.3

7

D.2

s

8

s.l

9

D.3

s

(to II, 1)

Ac

Ac Ac 30 Ac Ac Ac 32

Ac

Ac

Ac

Ac

s.l

Ac

D.2

Ac

D.3

(a<»* +2^+1* (p+l))o (a'^' +(2»+'w+2»)(p+l))„ (a'»'+2''+l(w+l)(p+l))o (a<''+2'+Mw+l)(p+l))o (^(T+i) +2»+iw (p+l))o (^(r+l) +(2'+'w+2»)(p+l))o (^(,+1) +2^^i(w+l)(p+l))o (^(t+1) +2'^i(w+l)(p+l))o

(2'

(p-l))o

(2'

*'(p+l))o

(2^+»(p+l))o

(a<

^')o

(a*

^^)o

(a

T+l)^

(a'

^0

(a

(a

^')„

The ordering of the boxes is I, II. Ill, V, VI, VIII, DC, X, XIII; XI, XrV; IV; VII; XII, and IX^ DC, XIV, III, II must also be the irtmediate successors of IV, VII, XII, XIII, XIV, respectively. In addition, IX cannot be placed imnediately after VIII, since IX, 1 is 0 -- but IX must nevertheless be the iimediate successor of VIII. All this necessitates the extra orders

IV,8

IX. 1

c

VII, 6

IX. 1

c

VIII. 3

IX, 1

c

XII. 6

XIV, 1

c

XIII. 9

III.l

c

XIV, 10

II. 1

c

Finally in order that X be the imnediate successor of IX. the e of 0-41 (in 26) must be equal to X. 1.

We must now assign C. 1-4. D. 1-3. s.l their actual values, pair the 76 orders 1.1-6. II. 1-4, III. 1-5, IV,l-8. V.l-S, VI, 1-4, VII, 1-6, VIII, 1-3, X,l-6, XI. 1-4. XII. 1-6, XIII, 1-9, XIV, 1-10 to 38 words, and then assign 1,1 - XIV. 10 their actual values. (IX is omitted, since it is contained in 0-41.) We wish to do this as a continuation of the code of 11.3. We will therefore begin with the number 42. Furthermore the contents of D. 1-3, s.l are irrelevant, like those of 37-41 there. We saw, in addition, that 30-35 (with the exceptions of 30,32) are also irrelevant. We must, however, make this reservation: 30-41 are needed while box R operates, and during this period D. 1-3 are relevantly occupied, but not s.l. s.l is relevantly occupied only while boxes XII, XIV operate, and during this period 30-35 and 37-41 are irrelevant. Hence only s.l can be made to coincide with one of these, say with 41. Sunming all these things up, we obtain the following table:

-64-

1.1-6

42 -44'

VIII, 1-3

54 -55

IV, 1-8

70 -73'

11,1-4

45 -46'

X,l-6

55 '-58

VII, i-6

74 -76'

111,1-5

47 -49

XIII, 1-9

58'-62'

XII, 1-6

77 -79'

V.1-5

49'-51'

XI, 1-4

63 -64'

C.1-4

80 -83

VI, 1-4

52 -53'

XIV, 1-10

65 -69'

D.1-3 s.l

84 -86 41

Now we obtain this coded sequence:

42

35

84 S

43

80

85 S

44

81

86 S

45

85

30 S

46

86

32 S

47

30

85 h-

48

84 h

82 h-

49

70 Cc

84

50

33 S

30

51

84 h

31 S

52

85 h-

84 h

53

82 h-

74 Cc

54

84

34 S

55

0 C

30

56

85 h-

84 h

57

84 h

82 h-

58

63 Co

30

59

84 h

84 h

60

30 S

32

61

84 h

84 h

62

32 S

47 C

63

84

84 h

64

82 h-

77 Cc

65

84

84 h

66

84 S

85

67

41 S

86

68

85 S

41

69

86 S

45 C

70

82

85 h

71

31 S

30 h-

72

33 S

83

73

34 S

0 C

74

82

30 h-

75

85 h

84 h-

76

3i S

0 C

77

80

86 h-

78

41 S

41 -M

79

e Cc

65 C

80

^0

81

\

82

(n(p+

l))o

83

0

84

_

85

-

86

-

For the sake of completeness, we restate that part of 0-41 of 11.3, which contains all changes and all substitutable constants of the problem. This is 26 and 30-41:

26 30 31 32

55 Cc', 10 Cc'

33 34 35 36

37 38 39 40 41

The durations may be estimated as follows:

I: 225 ti, II: 150 n, III: 200 n, IV: 300 ^, V: 200 ^i, VI: 150 \x, VII: 225 n, VIII: 125 n, X: 225 yi, XI: 150 u, XII: 225 n, XIII: 350 g,, XIV: 375 p.. DC: The precise estimate at the end of 11.3 is

((575 p + 1,125) (n^ + m^) + 575) \i.

Total: Put ? = 2 <*log n> , n = 2 </*log n)> -<(^log n> = 0 or 1. w = < " .N . Then the total is

-65-

I + 1 In * 1

T=0 ,=0

This is majorized by

III + (iV or (V+VI +(Vir> or VIII))) + IX + X + (XI*' or XIII)

1 + XlV' Uxil (h+1)

(225 + "l J 150 + "Z

T=0 1 ,=0

- 375 + 225 (n+D) n

200+200 + 150 + 125 +(575 p + 1,125) x X (n^+m^)+ 575 + 225 + 350

+ 100 - 200 + 375

Since 2 (n^ + m^) = n, T) g 1, this is majorized by

r = 0

(225 + 'i {(575 p + 1,125) n + l,825<-iL_\ + 425} + 75) n

.1

Since 2 ^-r^^ ^ t ( -7^ + 1) I n + v, this is majorized by

((575 p + 1,125) n V + 1,825 n + 2,250 v + 300) ^ We Ccin write this in this form:

vhere

((575 p + 1,200 (1 + 6)) n V ) u =%s (.6 (p + 2 (1 + 6)) n y)

V = 2'^* log n^ .

6 = - .06 + L^ + LJ3 + _^

6 is a small and slowly changing quantity: For n = 100; 1,000; 10,000 (the last value is, of course, incompatible with the memory capacities which appear to be practical in the near future) we have v = 8; 10; 14 and hence 6 = .15; .09; .05, respectively.

At most once among the w in Z . We disregard this effect for IV, which

w=0

represents the shorter alternative. We replace VII, XI by their alternatives,

VIII, XIII, respectively, inside the 2 . This necessitates the corrections

w=0 -_,

VII-VIII = 100 ^, XI-XIII = -200 ti, respectively, outside the "l . (Cf. the

w = 0

third and second terms from the right in the brackets ( ... ) of the next formula.)

Missing once among the v in 2 We may therefore subtract XIV = 375 \x as

T-l

a correction outside the 2

T=0

r = 0

-66-

11.5 The meshing and sorting speeds of 11.3 and 11.4 are best expressed in terms of m per complex or of complexes per minute. The number of complexes in these two problems is n + m and n, respectively, hence the number of m per complex is ^-^.6 (p+2) and =^.6 (p+2(l+6)) 2 <*log n >?rl.2 (p+2.3) <^*log n , resp)€ctively. The number of complexes per minute obtains by dividing these numbers into 60,000, i.e. it is

(9) mm and - 50.000 ^ respectively.

P+2 (p+2.3)<*logn> "^

To get some frsune of reference in which to evaluate these figures, one might compare them with the correspxjnding speeds on standard, electro-mechanical pmnch-card equipment.

Meshing can be effected with the I.B.M. collator, which has a speed of 225 cards per minute. Sorting can be effected by repeated runs through the I.B.M. (decimal) sorter. The sorting method which is then used is not based on iterated meshing, and hence differs essentially from our method in 11.4. Strictly construed, it requires as many runs througt» the sorter, as there are decimal digits in the principal number. This number of digits is usually between 3 and 8. Since we are dealing in our case with 40 binary digits, corresponding to 12 decimal digits, the use of the value 6 in such a comparison does not seem unfair. The sorter has a normal sp)eed of 400 cards per minute, and it can unquestionably be accelerated beyond this level. 50% seems to be a reasonable estimate of this potential acce- leration. Making the comparison on this basis, we have a speed of , ' = 100

cards per minute. Hence we have these speeds for meshing and sorting in cards per minute:

(10) 225 amd 100, respectively.

A card corresponds to one of our complexes, since it moves as a unit in meshing sind in sorting. Hence the speeds of (9) and (10) are directly comparable, and they give these ratios:

(11) J9L ^44_ ^ 5^0 ^ respectively.

(10) ^ p+2 (p+2.3)<*logn>' ^

A standard I.B.M. punch card has room for 80 decimal digits. This is equivalent to about 270 binary digits, i.e. somewhat less than 7 of our 40 binary digit numbers. It is, of course, in most cases not used to full capacity. Hence it is best compared to a complex with p + 1 g 7, i.e. p =1,...,6. For n values from 100 to 1,000 seem realistic (in view of the probably availeible "inner memory capacities, 8ind assuming that no "outer" memory is used, cf. the seccmd remark at the end of this section), hence <^ log n^ = 4, 5. Gansequently the ratios of (11) become

(11') P^ =^ 150 to 55 and 30 to 15, respectively.

-67-

In considering these figures the following facts should be kept in mind:

First: In using an electronic machine of the type under consideration for sorting problems, one is using it in a way which is least favorable for its specific characteristics, and most favorable for those of a mechanical punch card machine. Indeed, the coherence of a complex X= (x; Uj,..., u ), i.e. the close connection between the movements of its principal number x and the subsidiary numbers u.,..., u , is guaranteed in a punch card machine by the physical identity and coherence of the punch card which it occupies, while in the electronic machine in question x and each u,,..., u must be trzinsf erred separately; there is no in- trinsic coherence between these items, and their ultimate, effective coherence results by synthesis fran a multitude of appropriately coordinated individual transfers. This situation is very different from the one which exists in properly mathematical problems, where multiplication is a decisive operation, with the result that the extreme speed of the basic electronic organs can become directly effective, since the electronic multiplier is just as efficiently organized and highly paralleled as its mechanical and electromechanical counterparts. Thus in properly mathematical problems the ratio of speed is of the order of the ratio of the, say, .1 m multiplication time of an electronic multiplier and of the, say, 1 to 10 second multiplication time of an electromechanical multiplier, i.";., say, 10,000 to 100,000 -- while (11') above gave speed ratios of only 15 to 150,

Second: The "inner" memory capacities of the electronic machines that we envisage will hardly allow of values of n (and m) in excess of about 1,000. vVhen this limit is exceeded, i.e. when really large scale sorting problems arise, then the "outer" memory (magnetic wire or tape, or the like) must also be used. The "inner " memory will then handle the problem in segments of several 100, or possibly up to 1,000, complexes each, and these are combined by iterated passages to and from the "outer" memory. This requires some additional coded instructions, to control the transfers to and from the "outer" memory, and slows the entire procedure some'vhat, since the "outer" memory is very considerably less flexible and less fast available than the "inner" one. Nevertheless, this slowdown is not very bad: We saw in 11.3 that meshing requires .6 m per number. Magnetic wires or tapes can certainly be run at speeds of 20,000-40,000 (binary) digits per second, i.e. 500-1,000 (40 binary digit words or) numbers per second. This means 1-2 m per number. Thus the times required for each one of these two phases of the matter are of the same order of magnitude. In addition to this the "outer" memory is likely to be of a multiple, parallel channel type.

We will discuss this large scale sorting problem later, when we come to the use of the "outer" memory. It is clear, however, that it will render the comparison of speeds, (11'), somewhat less favorable.

Third: We have so far emphasized the unfavorable aspects of sorting with an electronic machine of the type under consideration-- i.e. one which is primarily an all-purpose, mathematical machine, not conceived particularly for sorting problems . Let us now point out the favorable aspects of the matter. These seem to be the main ones:

-68-

(a) All the disadvantages that we mentioned are relative Mies (i.e. in comparison to the properly mathematical problems) -- electronic sorting should nevertheless be faster than mechanical, punch card sorting: In our above examples by factors of the order of 10 to 100.

(b) The results of electronic sorting appear in a form which is not exposed to the risks of the unavoidable human manipulations of punch cards: They are in the "inner" memory of the machine, which requires no human manipu- lation whatever; or in the "outer" memory, which is a connected, physically stable medium like magnetic wire or tape.

(c) The sorting operations cein be combined with and alternated with properly mathematical operations. This can be done entirely by coded instructions under the inner control of the machine's own control organs, with no need for human intervention and no interruption of the fully automatic operation of the machine. This circumstance is likely to be of great importance in statistical problems. It represents a fundamental departure from the characteristics of existing sorting devices, which are very limited in their properly mathematical capabilities.

PLANNING AND CODING OF PROBLEMS

FOR AN ELECTRONIC COMPUTING INSTRUMENT

By

Herman H. Goldstine John von Neumann

Report on the Mathematical and Logical Aspects of an Electronic Computing Ins trument

Part II, Volume III

The Institute for Advanced Study Princeton, New Jersey 1948

PREFACE

This report was prepared in accordance with the terms of Contract No. W-36-034-OPD-7481 between the l^search and Development Service, U. S. Army Ordnance Department, and The Institute for Advanced Study. It is another in a series of reports entitled, "Planning and Coding of Prob- lems for an Electronic Computing Instrument", sind it con- stitutes Volume III of Part II of that sequence. It is expected that Volume IV of this series will appear in the near future.

Herman H. Goldstine John von Neumann

The Institute for Advanced Study 16 August i9U8

TABLE OF CONTENTS

Page

PREFACE

12.0 COMBINING ROUTINES

12.1 Coding of simple and of composite problems. 1

12.2 Need for this program. 2

12.3 Routines and subroutines. 2

12.4 Changes required when using a subroutine. 3

12.5 Preparatory routines. 4

12.6 Analysis of the orders in a subroutine. 5

12.7 Criteria to be used by a preparatory routine. 6

12.8 Problem 16: The single subroutine preparatory routine.

12.9 Problem 17: The multiple subroutine preparatory routine.

12.10 Use of a preparatory routine in setting

up the machine. 19

12.11 Conclusions. 21

7 15

12.0 COMBINING ROUTINES

12. 1 Each one of the problems that we have coded in the past Chapters 8-11 had the following properties: The problem was complete in the sense, that it led from certain unambiguously stated assumptions to a clearly defined result. It was incomplete, however, in another sense: It was certain in some cases eind very likely in others, that the problem in question would in actual practice not occur by itself, as an isolated entity, but rather as one of the constituents of a larger and more complex problem. It is, of course, justified and even necessary from a didactical point of view, to treat such partial problems, problem fragments -- esjsecially in the earlier stages of the instruction in the use of a code, or of coding per se. As the discussion ad- vances, however, it becomes increasingly desirable to turn one's attention more and more from the fragments, the constituent parts, to the whole, In our present discussion, in particular, we have now reached a point where this change of emphasis is indicated, and we proceed therefore accordingly.

There are, in principle, two ways to effect this shift of emphasis from the parts to the whole.

The first way is to utilize the experience gained in the coding of simpler (partial) problems when one is coding more complicated (more complete) problems, but nevertheless to code all the parts of the complicated problem explicitly, even if equivalent simple problems have been coded before.

The second way is to code simple (partial) problems first, irrespective of the contexts (more complete problems) in which they may occur subsequently, and then to insert these coded sequences as wholes, when a complicated problem occurs of which they are parts.

We should illustrate both procedures with exEunples: This is not easy for the first one, because its use is so frequent that it is difficult to circum- scribe its occurrences with any precision. Thus, if we had coded the calculation of the general third order polynomial, then any subsequent calculation involving (as a part) a third order polynomial, would offer such an example. Also, in view of Problem 1, suiy calculation involving a quotient of a second order and a first order polynomial would be an example. Problem 3, where the whole of Problem 1 is recoded as a part of the new coded sequence (but not Problem 2, where this is not done) is a specific instance.

Examples of the second procedure are more clearly identifiable. Problem 12 was used in this sense as a part of Problem 13. a and of Problem 13. b, and also, after some modifications, as a part of Problem 13. c. Problem 14 was used as a part of Problem 15. In addition it is fairly clear that all of the Problems 4-11 and 13-15 must be intended as parts of more complicated problems, and that it would be very convenient not to have to recede any one of them when it is to be used as part of another problem, but to be able to use it more or less unchanged, as a single entity.

-2-

12.2 The last remark defines the objective of this chapter: We wish to develop here methods that will permit us to use the coded sequence of a problem, when that problem occurs as part of a more complicated one, as a single entity, as a whole, 2md avoid the need for recoding it each time when it occurs as a part in

a new context, i.e. in a new problem.

The importance of being able to do this is very great. It is likely to have a decisive influence on the ease emd the efficiency with which a computing automat of the type that we contemplate will be operable. This possibility should, more than anything else, remove a bottleneck at the preparing, setting up, amd coding of problems, which might otherwise be quite dangerous.

This principle must, of course, be applied with certain comnon sense limitations: There will be "problems" whose coded sequences are so simple and so short, that it is easier to recode them each time when they occur as parts of another problem, than to substitute them as single entities -- i.e. where the work of recoding the whole sequence is not significantly more than the work necessitated by the preparations and adjustments that are required when the sequence is substi- tuted as a single entity. (These prepiarations euid adjustments constitute one of the main topics of this chapter, cf. 12.3-12.5.) Thus the examples of the first procedure discussed in 12.1 above are instances of problems that are "simple" and "short" in this sense.

For problems of medium or higher complexity, however, the principle applies. It is not easy tQ name a precise lower limit for the complexity, say in terms of the number of words that make up the coded sequence of the problem in question. Indeed, this lower limit cannot fail to depend on the precise character- istics of the computing device under consideration, and quite particularly on the prof)erties of its input orgein. Also, it can hardly be viewed as a quite precisely defined quauitity under any conditicms. As far as we can tell at this moment, it is probably of the order of 15-20 words for a device of the type that we are contemplating (cf. the fourth remark in 12.11).

These things being understood, we may state that the possibility of substituting the coded sequence of a simple (partial) problem as a single entity, a whole, into that one of a more complicated (more complete) problem, is of basic imp)ortance for the ease and efficiency of running an automatic, high spieed computing establishment in the way that seems reasonable to us. We are therefore going to investigate the methods by which this can be dwie.

12.3 We call the coded sequence of a problem a routine, and one which is formed with the purpose of possible stibstitution into other routines, a subroutine. As mentioned above, we envisage that a prop)erly organized automatic, high speed establishment will include an extensive collection of such subroutines, of lengths ranging from about 15-20 words upwards. I.e. a "library" of records in the form of the external memory medium, presumably magnetic wire or tape. The character of the problems which can thus be disposed of in advance by means of such subroutines will vary over a very wide spectrum -- indeed a much wider one than is now generally appreciated. Some instances of this will appear in the subsequent Qiapters 13 and 14. The discussions in those chapters will, in p>articular, give a more specific idea of what the possibilities are and what aims possess, in our opinion, the proper proportions.

Let us now see what the requirements and the difficulties of a general technique are, if this technique is to be adequate to effect the substitution of subroutines into routines in the typical situations.

12.4 The discussion of the precise way in which subroutines can be used, i.e. substituted into other routines, centers around the changes which have to be applied to a subroutine when it is used as a substituent.

These changes can be classified as follows:

Some characteristics of the subroutine change from one substitution of the subroutine (into a certain routine) to another one (into another routine), but they remain fixed throughout all uses of the subroutine within the same substitu- tion (i.e. in connection with one, fixed routine). These are the changes of the first kind. Other characteristics of the subroutines may even vary in the course of the successive uses of the subroutine within the same substitution. These are the changes of the second kind.

*

Thus the order position at which a subroutine begins is constant through- out one substitution (i.e. routine, or, equivalently , one larger problem of which the subroutine's problem is part), but it may have to vary from one such substitution or problem to another. Ihe first assertion is obviously in accord with what will be considered normal usage, the second assertion, however, needs some further elaboration.

If a given subroutine could only be used with its beginning at one parti- cular position in the memory, which must be chosen in advance of all its applications, then its usefulness would be seriously limited. In particular, the use of several subroutines within one routine would be subject to very severe limitations. Indeed, two subroutines could only be used together, if the preassigned regions that they occupy in the memory do not intersect. In any extensive "library" of subroutines it would be impossible to observe this for all combinations of subroutines simul- taneously. Ck\ the other hand, it will be hard to predict with what other subroutines it may be desirable to combine a given subroutine in some future problem. Further- more, it will probably be very important to develop an extensive "library" of sub- routines, and to be able to use it with great freedom. All solutions of this dileimia that are based on fixed positioning of subroutines are likely to be clumsy and of insufficient flexibility.

Hence we should postulate the variability of the initial order position of a subroutine from one substitution to another. Consequently this is an example of a change of the first kind. This requires corresponding adjustments of all references made in orders of the subroutine to definite (order or storage) positions within the subroutine, as they occur in the final form (the final enumeration) of its coding. These adjustments are, therefore, changes of the first kind.

The parameters or free variables of the problem that is represented by the subroutine (cf. 7.5) will, on the other hand, usually change from one use of the subroutine (within the same substitution, i.e. the same main routine or problem) to another. The same is true for the order position in the main routine, from which the control has to continue after the completion (of each particular use) of the subroutine. Since the subroutine sends the control after its completion to e (this

-4-

is the notation that we have used in all our codings up to now, and we propose to continue using it in all subsequent codings), this observation can also be put as follows: The actual value of e will usually change from one use of the subroutine to another.

These remarks imply, that the parameters of the subroutines problem, as well as the actual value of its e, will usually undergo changes of the second kind.

12.5 All the changes that the use of a subroutine in a given substi- tution requires can be effected by the routine into which it is being substituted, i.e. by including appropriate coded instructions into that routine. For changes of the second kind this is the only possible way. For changes of the first kind, how- ever, it is not necessary to put this additional load on the main routine. In this case the changes can be effected as preparatory steps, before the main routine it- self is set in motion. Such preparations might be effected outside the machine (possibly by manual procedures, and possibly by more or less automatic, special, subsidiary equipment). It seems, however, much preferable to let the machine itself do it by means of an extra routine, which we call the preparatory routine. We will speak accordingly of an internal preparation of subroutines, in contradistinction to the first mentioned outside process, the external preparation of subroutines. We have no doubt that the internal preparation is preferable to the external one in all but the very simplest cases.

Thus changes of the first kind are to be effected by preparatory routines, which will be discussed further below. Qianges of the second kind, as we have pointed out already, have to be effected by the main routine itself (into which the subroutine is being substituted): Before each use that the routine makes of the subroutine, it must appropriately substitute the quantities that undergo changes of the second kind (the parameters of the subroutines problem and the actual value of its e, cf. the discussion in 12.4), and then send the control to the beginning of the subroutine (usually by an unconditional transfer order). It may happen that some of these quantities remain unchanged throughout a sequence of successive uses of the subroutine. In this case the corresponding substitutions need, of course, be effected once, jointly for the entire sequence. If this sequence includes all uses of the subroutine within the routine, then the substitutions in question need only be performed once in the entire routine, at any sufficiently early {X)int in it. In this last case we are, of course, really dealing with changes of the first kind, and the quantities in question could be dealt with outside the main routine, by a preparatory routine. It is, however, sometimes preferable to view this case as an extreme, degenerate form of a change of the sec aid kind, or at any rate to treat it in that way.

This discussion should, for the time being, suffice to clarify the principles of the classification of subroutine changes, and of the effect which they (specifically: the changes of the second kind) have on the arrangements in the main routine (into which the subroutine is being substituted). We now pass to the discussion of the preparatory routine, which effects the essential changes of the first kind: The adjustments that are required in the subroutine by the variability of its initial order position.

-5-

12.6 Assume that a given subroutine has been coded under the assump- tion that it will begin at the order position a. (I.e. at the left-hand order of the word a. To simplify matters, we disregard the possibility that it may begin at the right-hand order of the word a. In our past codings we had usually a = 0, excepting Problem 2 where a = 100, Problems 13,a-c where a = 52, and Problem 15 where a = 42. ) The orders that are contained in this subroutine can now be classified as follows:

First: The order contains no reference to a memory position x. It is then one of the orders 10, 20, 21 of Table II.

Second: The order contains a reference to a memory position x, but the place of this x is irrelevantly occupied in the actual code of the subroutine. In this case the subroutine itself must substitute appropriately for x, before the control gets to the order in question. I.e. some earlier part of the subroutine must form the substitution value for x, and substitute it into the order.

Third: The order contains a reference to a rtemory position x, the place of this X is relevantly occupied in the actual code of the subroutine, and this actual value of x corresponds to a memory position not in the subroutine.

hourth: Same as the third case, except that the actual value of x corresf>onds to a memory position in the subroutine.

fifth: Che of the preceding cases, but at some point the subroutine treats the order or its x as if it were irrelevantly occupied, i.e. it substitutes there something else.

Assume next, that the subroutine, although coded as if it began at a, is actually to be used beginning at a. This necessitates certain changes, which are just the ones that the preparatory routine has to effect, in the sense of the con- cluding remark of 12.5. CXir above classification of the orders of the subroutine permits us to give now an exact listing of these changes.

Orders of the first and of the third kind require clearly no change. The same is true of the orders of the second kind if they produce x's which correspond to memory positions not in the subroutine. And even if x's are produced which correspond to memory positiops in the subroutine, no change is necessary if the following rule has been observed in coding the subroutine: a was used explicitly in forming the x that corresponds to positions in the subroutine, and it was stored not as the actual quantity a, but as a parameter of the subroutine s problem. If it is then understood, that this parameter should have the value a, then it will be adequately treated as a parameter in the sense of 12.5. Indeed, it represents that degenerate form of a change of the second kind, which can also be viewed as a change of the first kind, as discussed in 12.5. Thus it might be treated by a special step in the preparatory routine, but we prefer to assume, in order to simplify the present discussion, that it is handled as a parameter (of the subroutine) by the main routine. In this way the orders of the second kind require no change either (by the preparatory routine).

Orders of the fourth kind clearly require increasing their x by a - a.

Orders of the fifth kind behave like a combination of an order of one of the four first kinds with an order of the second kind. Since all of these orders are covered by the measures that emerged from our discussion of the four first kinds of orders, it ensues that the orders of the fifth kind are automatically covered, too, by those measures.

Thus the preparatory routine has precisely one task: To add a - a to the X of every order of the fourth kind in the subroutine.

12.7 The next question is this: By what criteria can the preparatory routine recognize the orders of the fourth kind in the subroutine?

Let t be the length of the subroutine. By this we mean the number of words, both orders and storage, that make it up. We include in this count all those words which have to be moved together when the final code (final enumeration) of the subroutine is moved (i.e. when its initial order position is moved from a to a), £ind no others. The count is, of course, made on the final enumeration. In this sense a word counts fully, even if it contains a duimiy order (e.g. 14 in Problem 6, and 6 in Problem 10 or 74, 91 in Problem 13. b). Oh the other hand storage positions which are being referred to, but which are supposed to be parts of some other routine, already in the machine (i.e. of the main routine, or of an- other subroutine) do not count (e.g. the storage area A in Problem 3 or the storage area A in Problem 10).

for cin order of the fourth kind x must have one of the values a, ..., a +/ - 1, i.e. it must fulfill the condition

(1) a g X < a + Z .

For an order of the third kind x will not fulfill this condition. For orders of the first and of the second kind the place of x is inessentially occupied. Concerning its relation to condition (1) we can make the two following remarks:

First: We can stipulate, that in all orders where the position of x is inessentially occupied, x should actually be put in with a value x that violates

(1). This is a perfectly possible convention. The simplest ways to carry it into effect are these:

Let X always have the smallest value or always have the largest value that is compatible with its 12-digit character. (Regarding the latter, cf. section 6.2.) I.e. x = 0 or x = L-1, where L-1 is the largest 12-digit integer: L = 2'^ = 4,096. Then all subroutines must fulfill a 7^ 0 or a+Z^^L, respectively (in order that (1) be violated).

These rules are easy to observe. We chose a = 0 in most of our codes, hence we might prefer the second rule, but this is a quite unimportant preference.

-7-

Second: If an order of the first or of the second kind has an x which fulfills (1), and the order is thereupon mistakenly taken (by the preparatory routine) for one of the fourth kind, and its x is increased by a - a, this need not matter either. Indeed: The place x is irrelevantly occupied, hence changes which take place there before the subroutine begins to operate do not matter. There is, however, one possible complication: Adding a - a to this (inessential) X may produce a carry beyond the 12 digits that are assigned to x. (Regarding these 12 digits cf. above, and also orders 18, 19 of Table II and the second remark among the Introductory Remarks to Chapter 10. The carry in question will occur if a - a > 0 and x g L - (a - a), or if a - a < 0 and x < - (a - a) ; L = 2^ ^ , cf. above. ) Such a carry affects the other digits of the order, and thereby modi- fies its meaning in an undesirable way. This complication can be averted by special measures that paralyze carries of the type in question, but we will not discuss this here. No precautions are needed, if we see to it that no such carries occur. (I.e. if we observe -(a -a) g x g L - (a -a) for the inessential X, cf. above. )

In view of these observations we may accept ( 1 ) as the criterium defining the orders of the fourth kind. We will therefore proceed on this basis.

12.8 We have to derive the preparatory routines which are needed to make subroutines effective. For didactical reasons, we begin with a preparatory routine which can only be used in conjunction with a single (but arbitrary) sub- routine. Having derived such a single subroutine preparatory routine, we can then pass to the more general case of a preparatory routine which can be used in conjunction with any number of subroutines. This is a general, or multiple subroutine preparatory routine. The point in all of this is, of course, that both kinds of preparatory routines need only be coded once and in advance -- they can then be used in conjunction with arbitrary subroutines.

We state now the problem of a single subroutine preparatory routine. Tliis includes a description of the subroutine, in which we assume that the sub- routine has been coded in conformity with the (not a priori necessary) conventions that we found convenient to observe in our codings in these reports. It does not seem necessary to discuss at this place possible deviations from these conventions, and the rather simple ways of dealing with them.

PROBLEM 16.

A subroutine 2 consisting of / consecutive words, of which the k first ones are (two) order words, is given. (Concerning the definition of the length of a subroutine, cf. the beginning of 12.7. The subroutine under consideration may also make use of stored quantities, or of available storage capacity, outside this sequence of t words -- or rather of the / - k last ones among them. VVe need not pay any attention to such outside positions in this problem. ) This subroutine is coded as if it began at the memory position a. Actually, however, it is stored in the memory, beginning at the position a. It is desired to modify it so that its coding conform with its actual position in the memory.

-8-

Our task consists in scanning the words from a to a +k - 1, to inspect in each one of these words the two orders that it contains, to decide for each order whether its x fulfills the condition (1) of 12.7; and in that (and cmly in that) case increase this x by K = a - a.

Let the memory position u be occupied by the word w . w is then ain aggregate of 40 binary digits:

w = { w (1), w (2), ..., w (40) } .

u u ' u ' ' u

The two orders of which it consists are the two 20 digit aggregates (w (1), .... w (20)) , {w (21) w (40)) ,

u u ' u u

the two X in these orders are the two 12 digit aggregates

wl = {w (9), ..., w (20)), w" = {w (29), ..., w (40)}

u u ' u ' u u u

(cf. orders 18, 19 of Table II).

Reading w^ , w^' as binary numbers with the binary point at the extrem* left (and ein extra sign digit 0), the condition (1) of 12.7 becomes

(1) 2-l2a i wl <2-i2 (a + /),

and

(2) 2-12a < w" < 2-12 (a + t) .

~ u

Reading w as we ordinarily read binary aggregates, i.e. as a binary number with the binary pxsint between the first and second digits from the left (the first digit being the sign digit) we can now express our task as follows: If (1) or (2) holds, we must increase w by 2" K or 2' K, respectively. I.e.

(3)

(4)

Note, that we may replace (2), for its use in (4), by (2-) 2-12a ^ w'll < 2-12 (a + Jf) ,

w'

U

V

w u

w u

+ 2-1'k

if (1) holds, otherwise.

w"

u

w'

u

w'

+ 2-"k

if (2) holds, otherwise.

where

w' = ( w'(l), w'(2), .... w'(40)) , w'" = ( w'(29) w'(40)) .

a an

since w and w' have by (3) the same digits with the positional values 2' ,...,2' , i.e. with the numbers 21, ..., 40.

The words w with which we have to deal are in the interval of memory

locations a+K a+K+k- 1 (i.e. a, ..., a + k - 1, cf. above). Let this

be the storage area 0, we will index it with a u=a+K a+K+k- 1, so

that O.u corresponds to u, and stores w . This u has the character of an induction index.

Further storage capacities are required as follows: u (as Ug) in A, the w under consideration (and w' after it) in B, the given data of the problem, a, /, k, K, in C. (It will be convenient to store them as 2" a, 2" t, 2* k, 2""k. Regarding these quantities cf. also further below.) Storage will also have to be provided for various other fixed quantities (-1, 1q, 2" , 2" , 2" ), these too will be accomodated in C.

We can now draw the flow diagram, as shown in Figure 12.1. In coding it, we will encounter some deviations and complications which should be commented on.

a, /, k, K must occasionally be manipulated along the lines discussed in connection with the coding of Problem 13. a. Thus in the case of K transitions to 2""k and to K. occur, and these would be rendered more difficult if we had to allow for the possibility K < 0. In order to avoid this rather irrelevant compli- cation, we assume

(5) >^ ^ 0, i.e. a ^ a.

This has the further consequence, that the difficulties referred to in 12.7 can be avoided by giving every irrelevant x the value 0 (because of the second remark in 12.7) or the value L-1 (because of the first remark in 12.7). We also note this: (5) can be secured by putting all a = 0, i.e. by coding every subroutine as if it began at 0, but we will not insist here that this convention be made.

The conditions (1), (2') can be tested by testing the signs of the quantities

wl - 2-l2a. wl - 2-12(3+/), w'" - 2-'2a. w'" - 2-»2(a+Jf)

or, equivalently, the signs of the quantities

2-V - 2-"a. 2-V - 2-"(a+/). 2-^'n - 2-'\, I'^l^' - 2-i'(a+Z) .

10-

It is easily seen that replacing 2'^'a, 2"^'(a+/} by a^, (a+^Jg vitiates these sign-criteria, but replacing

w' = (w (9) w (20))

u u ' u

by

w' + e = {w (9) w (20); w (21) w (40))

u u u u u u

does not have this effect. It is convenient to use w + e in place of w .

u u *^ u

Both Quantities w + e and w must be read as binary numbers with

u u u

the binary point at the extreme left, with an extra sign digit 0. Indicating this sign digit, too, we have

w^ + e = ( 0, w (9), ..., (6) ^

w (40) ) ,

U

w'li = { 0, w'(29), ...

, w440)] .

With the same notations

' w = { w (1), w (2),

.... w (40)

u

(7) .

w' = w (1), w (2),

V.

..., wH40)

In order to get the w^ + e ,w''^ of (6) from the w , w' of (7), it seems sinqslest to multiply w , w' by 2'^^, 2"*^, respectively, and to pick up w' + e in the register (cf. order 11 of Table II). There is, however, one minor complication at this point: The register contains not the w + e , w of (6), but the aggregates

w (9), w (9), w UO) w (40)

(6')

w'(29), w'(29), w'(30) w'(40)

u u u u

The simplest way to get from (6') to (6) is to sense the sign of each quantity of (6), and to add -1 to it if it proves to be negative (i.e. if the sign digit is 1). We will do this; it requires an additional conditional transfer in connection with each one of the two boxes III and VI. For this reason two boxes III.l and VI. 1, not shown in the flow diagram, will appear in our coding.

To conclude, it is convenient to change the position of IX somewhat (it follows upon VIII and absorbs part of it) and to absorb XI into X (it is replaced by X,9).

-11-

O.V ^t,

O. V Wy /o»- A-t-K = W'< «

A Uo

.^ » ' r

I

g.

#

(1

^ V r

(a-^X^ to /I

a.i-X-^ u.

J *

Nf ! ir II

X. !

X,

' 3

K. ^o S

•YT ^ ?

"*

"

jr

<'it-»'i;„ to /^

«.f-l ->- M

/> ,

'4

7

•-H

B ^V^

6 ;

JS

tv.^-^"'*

JE

*" 4

' '

n^^-2%^-^;

4

TT

_' r ^ M +

-*"

to 5

'

■' J-

#

-B i^:

M^i*-*- tvj

k

EZ

+ ■'

' ^

'

r.

I'

j;-t"u.i)

J

'

l/fff

S

■f

to O.u

1

T

'

3K

^^

^

to O. u.

<

<t-flt.-A;-A+i

•~N. t^

^

(p\

" ^

I ^ /

I ^

1

V^ *

1 1

1 1

1

HV otherwise.

1

FiG-URE 12.1

-12-

The static coding of the boxes I-Xl follows:

C.1 C.2 I.l

2-l»a 2-1'k C.1

2

C.2

h

3

s.l

Sp'

4

s.l

h

5

A

s

11,1

(to

11,1)

A

2 3

[

11,3 u

Sp

]

4

B

s

C.3

(to

111,1)

2-32

111,1

C.3

R

2

6

X

3

A

4

C.4

111,5

III. 1,1

-1

C.4

Co h

C.5

(to

111.1,1)

2-^

III.l,

1

cs

R

2

s.l

S

3

s.l

X

4

C.1

h-

C.6

5 (

IV. 1

to VI, 1)

2-19/

Cc

IV. I

C.6

h-

2

v.i

VI, 1 (to V,l)

C.2

Cc

2

B

h

3

B

(to VI,1)

S

C.7

2-12

Ac

2-i'a

Ac

2-l'(a+K)

s.l

2-"(a+ic)

Ac

(a+K)o

A

(a+K)^

Ac

"o

11,3

u

Ac

w u

B

w

R R

Ac Ac

R

s.l Ac Ac

Ac Ac B

2-32

{w (9),w (9),w (10),..., w (40):

u a u u

= w (9) + w^ + e

a u u

w (9) +wi +e

w* + e

1-' ,1

w- + e

u u

2-^wl + e") -2-i'a

2-^(wl + e ) -2-i'(a+if)

2-i\

w +2-i9ic = w'

.13.

VI. 1 2

C.7 B

R

X

4

VI. 1.1

Cc

5

C.4

h

(to VI

.1

1)

VI, 1.1

C.5

R

2

s.l

S

3

s.l

X

4

C.l

h-

5

VII, 1

Cc

(

to

IX

1)

VII, 1

C.6

h-

2

IX, 1

Cc

(to

VIII,

1)

VIII, 1

C.2

2

s.l

Sp-

3

s.l

4

B

h

5

B

s

(to

IX

.1)

R.l

A

2

IX, 4

Sp

3

B

4

-

s

[

u

s

(to

X,

I)

X,l

C.l

2

C.2

h

C.8

2-"k

X,3

C.8

h

4

s.l

Sp-

5

s.l

h

6

s.l

s

7

A

C.9

lo

X.8

C.9

h

9

A

S

10

s.l

h-

11

e

Cc

(to

XI

1)

XI, 1

.

(to

II.

1)

R R

Ac

R

s.l

Ac

Ac

Ac

O.u

2-12

{w^29).wH29),w'(30) wj(40))

= wH29J + w^i w'(29) + w'"

u a

U

2-7 Jli .2-i9a

.III

-2-i*(a+/)

Ac

2-

1'k

s.l

2-

3 9^

.Ac

2-

3 9^

Ac

w'

u

+ 2-"k =

= w" u

B

w" u

Ac

"o

IX, 4

U

Sp

Ac

w"

Ac

2-1 "a

Ac

2-l'(a+K)

Ac

2-'»(a^+k)

s.l

2-''(a-»ic+k)

Ac

(a+K+k)o

s.l

(a-Hc+k)^

Ac

"o

Ac

(u+l)o

A

(u-l)o

Ac

(u-a-K-k+1)

-14-

Note, that the box Xj required no coding, hence its immediate successor (II) must follow directly upon its immediate predecessor (X).

The ordering of the boxes is I, II, III, III.l, VI, VI. 1, K, X; IV, V; VII, VIII, and VI, DC, II must also be the immediate successors of V, VIII, X, respectively. "Hiis necessitates the extra orders

V.4

VI, 1

c

tl.6

IX, 1

c

X,12

11,1

c

We must now assign A, B, C. 1-9, s. 1 their actual values,, pair the 59 orders 1,1-5, 11,1-4, 111,1-5, 111.1,1-5, IV,l-2, V, 1-4, VI, 1-5, VI. 1,1-5, VII, 1-2, VIII j 1-6, IX, 1-4, X, 1-12 to 30 words, and then assign I,l-X, 12 their actual values, "e wish to place this code at the end of the memory, so that it should interfere as little as possible with the memory space that is normally occupied by other subroutines and routines. Let us therefore consider the words in the memory backwards (beginning with the last word), and designate their numbers (in the reverse order referred to) by 1, 2,... . In this way we obtain the following table:

1,1-5

11,1-4

111,1-5

III. 1.1-5

VI, 1-5

40'-38 38'-36' 35 -33 33'-31'

VI. 1,1-5

30 -28

IX,l-4

28 '-26

X,l-12 IV, 1-2

26'-20 20'-19

V,l-4

19'-17

VII, 1-2 VIII, 1-6 A B

C,l-9 s.l

17' 16'

-16 -13

12

11

10

-2

I

Now we obtain this coded sequence:

52 41 40 19 38 37 ^ 33 li 33 35 31

29

10 ,

9 h

1 Sp',

1 h

T2 S ,

12

39Sp\

-

ns ,

5R

n X ,

A

55 Co,

7 h

6R ,

1 s

Tx .

10 h

2IJC<:',

4R

nx ,

A

30 Cc,

7 h

5R ,

IS

Tx ,

10 h

28 27 26 25 24 23 22 21 20 19 18 17 16 15

17 Cc',

12

26 Sp,

11

- !^ ,

TO

9h .

3 h

1 Sp',

1 h

1 s ,

12

2 h .

12 S

1 h-.

e Cc

40 C,

5 h-

33 Cc',

9

11 h ,

11 s

33 C,

5 h-

28 Cc',

9

ISp',

1

14 13 12

n

10 9 8 7 6 5 4 3 2 1

n h , 28 C,

2-i'a 2-32

-1 2-'H

2-12

0-1 9|.

11 S

The durations may be estimated as follows:

I: 200 n, II: 150 n. III: 250 p.. HI.l: 270 n, IV: 75 u, V: 150 p,, VI: 250 \i, VI. 1: 270 u, VII: 75 u, VIII: 225 n, IX: 150 n, X: 450 |i.

-15-

Total: I +

II + III + III. 1 + (6^ or IV or IV + V)

+ VI + M.l + (9*^ or VII or VII + VIII) + IX + X

maximum

200 +

150 + 250 + 270 + 75+150 + 250 + 270 + 75 + 225 + 150 + 450

X k

(2,315 k + 200) u^^(2.3 k + .2)

12.9 We now pass to the multiple subroutine preparatory routine. The requirements for such a routine allow several variants. We will consider only the basic and simplest one. It is actually quite adequate to taike care of most situa- tions involving the use of several subroutines -- even of very complicated ones, (t-xamples will occur in our future codings, in particular in Chapters 13 and 14.)

PROBLEM 17

Same as Problem 16 with this change: The modification is desired for

I subroutines 2j 2 . The characteristic data for 1. (in the sense of Problem

16) are a , ^., k. , K.. Each Z. is stored as its a., K. , and / indicate (cf. Problem lo), the a , Z , k , K (i = 1 I) are stored at 41 suitable, consecu- tive memory locations.

In order to be able to use the treatment of Problem 16 in 12.8, we assume in conformity with (5) in 12.8

(1)

K. ^ 0 for all i = 1,

I.

(Cf. also the other pertinent remarks loc. cit. )

i is the induction index, running from 1 to I. For each value of i we have to solve Problem 16. We can do this with the help of our coding of that problem, but we must substitute the data of the problem, a , X , k , K , into the appropriate places. Inspection of the coded sequence shows that these places are 10, 5, 3, 9, res{>ectively.

"e propose to place the coded sequence that we are going to develop imnediately before that one of Problem 16, i.e. immediately before 42, ..., 1. Let P be the number of the memory location imnediately before the coded sequence that we are going to develop -- i.e., if the length of that sequence is /' and the total memory capacity is L' (both in terms of words), then

(2)

P = 43 + /' = L' - 43'

6 represents the possibility of going directly from III via 4, 5 to VI, or from VI via 5 to IX, respectively, with no other boxes intervening. We will use this same notation in similar situations in the future.

-16-

We will place the a., t.. k,,ic. (i = 1, .... I), in the form 2-^'a. , 2-1'^ , 2-^'k., ^ 1111 t ' ' J J J

2" vc. , imnediately before these coded sequences, and in inverse order, i.e. at

P-4i4, P-4i+3, P-4i+2, P-4i+l, respectively.

The induction index i will be stored in the form (P-4i+4)Q in the storage area A. The quantities P, I will be stored in the form Pq, (P-4I)jj in the storage area ^ ^Iq ^^^^ ^ needed auid taken from 2).

We can now draw the flow diagram, as shown in Figure 12.2. The actual coding obtains from this quite directly, box V is absorbed into box II (it is replaced by 11,10).

The static coding of the boxes I-V follows:

B.l

Po

I.l

B.l

2

A

S

(to 11,1) I.l A

2

11,11

Sp

3

2

h-

4

11,13

Sp

5

2

h-

6

11,15

Sp

7

2

h-

8

11,17

Sp

9

2

h-

10

A

s

11

P-4i+4

12

lo

s

13

P-4i+3

14

5

s

15

P-4i+2

16

3

s

17

P-4i+l

18

9

s

Ac

Po

A

Po

Ac

(P.4i+4)

II,

11

P-4i+4

Ac

(P-4i+3)

II.

13

P-4i+3

Ac

(P-4i+2)

II.

15

P-4i+2

Ac

(P-4i+l)

II.

17

P-4i+l

Ac

(P-4i)„

A

(P-4i)„

Ac

2-l9a.

10

2- IV

Ac

2-1'/.

5

2-1%

Ac

2-'\.

3

2- IV

Ac

2-i'x.

9

2-K

(to 111,1)

-17-

(TV-i

I

£

*

V^to A \

l-^l

Va

vi; *

\

)

^— |/^ (P-^if^l

>^

(p-4iltoA

ii-1-^ i

/''

f

Ci

I

«

'

S

C?\

n

^

•f,

. BT ,

k **

M.

z"''a.i to to 2. li to J

r'% to 3

2"''>tj to f

42 -T

4

i - I

S

4-

' i

0 .P-4l-h4

Z'a.,

F-4i->-3

z-^ti

P-41 ^i

^"%

P-'fi + 1

a-"?Ci

r

i

4Z-T

refer- to

42-1

in It. J

Figure \Z.Z

.18-

III (Problem 16: 42 - 1. )

(to

IV, 1)

B.2

(P-«)o

IV, 1

B.2

2

A h-

3

Cc

. (to

v,i)

V

(to

11,1)

Ac Ac

(P-4I)„ (4(i-I)),

Note, that box V required no coding, hence its inmediate successor (II) must follow directly upon its inmediate predecessor (IV).

The ordering of the boxes is I, II, III, IV, and II must also be the imnediate successor of IV. In addition, III cannot be placed inmediately after II, since 111,1 is 42 but III must nevertheless be the inmediate successor of II. All this necessitates the extra orders

11,19 IV. 4

111,1 II. 1

C C

Finally, in order that IV be the inmediate successor of III, the e of 42 - 1 (in 21) must be equal to IV, 1.

We must now assign A, B. 1-2 their actual values, pair the 25 orders

1,1-2, 11,1-19, IV, 1-4 to 13 words, and then assign I,1-IV,4 their actual values.

(Ill is omitted, since it is contained in 42 - I. ) We wish to do this as a

(backward) continuation of the code of 12.8. In this way we obtain the following table:

1.1-2

58 -58'

11,1-19 IV, 1-4

57 -48 48'-46

A B.1-2

45 _ 44 - 43

Thus, in terms of equation (2), /' = 16 and (2') P = 59 = L' - 59 .

Now we obtain this coded sequence:

2 h-

37 S4

44

45S

45

52 Sp

2h-

5T Sp

2h-

SU Sp

2h-

45 Sp

53 52 5T 5U 49

45 S

10 S

5S

3S

9S

48

£

46 45 44 43

42C,

43

45 h-,

e Cc

57C,

- -

Po (P-4I)„

-19-

In addition 21 in 42 - 1 of 12.8 must read 7T T h-, 45 Cc'

The durations may be estimated as follows:

I: 75 n, II: 725 ^, IV: 150 n.

Ill: The precise estimate at the end of 12.7 is

maximum = (2,315 k. + 200) ^.

Total: I + i (II + III + IV) =

i = l

maximum

= (75 + i (725 + 2,315 k. + 200 + 150)) n =

i=i

= (2,315 i k. + 1,075 I + 75) ^^(2.3 i k. + 1.1 I) m .

i=i

Z k. is the total length of all subroutines. Hence it is necessarily

^ L' ^ L = 2 = 4,096. Actually it is unlikely to exceed, even in very canplicated problems, the order =si jL=5 1,000. 1.1 I is negligible compared to 2.3 Z k. .

Hence

2 , 300 m = 2 . 3 seconds

is a high estimate for the duration of this routine.

12.10 Having derived two typical coded sequences for preparatory routines, it is appropriate to say a few words as to how their actual use can be contemplated. We do not propose to present a discussion of this subject to any degree of completeness -- we only wish to point out some of the most essential aspects. Since the routine of Problem 17 is more general than that one of Problem 16, we will base our discussion on the former.

The discussion of the use of preparatory subroutines is necessarily a discussion of a certain use of the input organs of the machine, ^e have refrained in our reports, so far, from making very detailed and specific assump- tions regarding the characteristics of the input (as well as of the output) organs. At the present juncture, however, certain assumptions regarding these organs are necessary. Ch the basis of engineering developments up to date, such assumptions are possible on a realistic basis. Those that we are going to formulate represent a very conservative, minimum program.

.20.

Our assumptions are these:

As indicated in section 4.5, we incline towards the use of magnetic wire (soundtrack) as input (and output) mediuai. We expect to use it at pulse rates of about 25,000 pulses (i.e. binary digits) per second. We will certainly use several input (and output) channels, but for the purposes of the present discussion we assume a single one.

We assume that the contents of a wire can be "fed" into the machine, i.e. transferred into its inner, selectron memory, under manual control. We assume that we can then describe by manual settings

1) to which memory position the first word from the wire should go (the subsequent words on the wire should then go in linear order into the successive, following memory positions),

2) how many words from the wire should be so "fed".

We assume finally, that single words can also be "fed" directly into the machine by typing them with an appropriate "typewriter". (This "typewriter' will produce electrical pulses, and will be nearly the same as the one used to "write" on the magnetic tape.) We assume that we can determine the memory position to which the typed word goes by manual settings.

The last assumption, i.e. the possibility of typing directly into the memory, is not absolutely necessary. It is alternative to the previously mentioned "feeding" of words from a magnetic wire. When longer sequences of words have to be fed, the wire is preferable to direct typing. When single words, irregularly distributed, have to be fed, however, then feeding from appropriate wires would still be feasible, but definitely more awkward than direct typing. In addition, the possibility of direct typing into the memory is probably very desirable in connection with testing procedures for the machine. We are therefore assuming its availability.

These things being understood, we can describe the procedure of placing a, presumably composite, routine into the machine. It consists of the following steps:

First: T^ere are one or more constituent routines: "Hie main routine and the subroutines, where it is perfectly possible that the subroutines bear further subordination relationships to each other, i.e. are given as a hierarchy. All of these are coded and stored on separate pieces of magnetic wire.

These are successively fed into the machine, i.e. into the inner memory. The desired positions in the memory are defined by manual settings.

' TKese operations should also be feasible under the "inner", electronic control of the machine. We will discuss this aspect of the input-output organ, and the logical, code orders lAich circumscribe it, in a subsequent paper (Part III in this series).

.21-

Second: The multiple subroutine preparatory routine (Problem 17) is also coded and stored on an individual magnetic wire. (It is, of course, assumed to be part of the library of wires mentioned in section 4.6.)

This is also fed into the machine, like the "constituent" routines of the first operation, described above. As observed in 12.8 and 12.9 it has to be p>ositioned at the end of the memory.

Third: The constants of the multiple subroutine preparatory routine, i.e. of Problem 17, are typed directly into the memory. They are the following ones:

1) The number of subroutines, I, which is put in the form (P-4I)g into the position

?3 = L' - 43 = P + 16.

2) The 41 data which characterize the I subroutines: a., /. , k. , K,.

(i = 1 1), which are put in the form 2" a , 2' X , 2- k. ,

2-i\. into the positions P-4i+4, P-4i+3, P-4i+5, P-4i+l, respectively.

Fourth: The machine is set going, with the caitrol set manually at the beginning of the preparatory routine (58 = L'-48 = P+1), and the adiust- ment of all subroutines to their actual positions (in the sense of 12.5-12.7) is thus effected.

Fifth: Any further adjustments which are necessitated by the relationships of the subroutines to each other (cf. the first operation, as described above, and the fifth remark in 12.11) are made by typing directly into the memory.

After all these operations have been carried out, the machine is ready to be set going on the (composite) routine of the problem itself ^ne preparatory routine (in the 58 last memory positions) and its data (in the 41 preceding positions) are now no longer needed. I.e. these positions may now be viewed, from the point of view of the problem itself, as irrelevantly occupied. They are acccrdingly available for use in this sense.

12.11 We can now draw some conclusions caicerning the setting-up procedure for a machine of the type contemplated, on the basis of the dis- cussion of 12.10. We state these in the form of five successive remarks.

first: The pure machine time required to feed the (main and subsidiary) routines of the problem into the machine may be estimated as follows: A word coisists of 40 pulses. For checking and marking purposes it will probably have to contain some additional pulses. With the systems that we are envisaging, a total of, say, 60 pulses per word will not be exceeded. With the speed of 25,000 pulses per second, as assumed in 12.10, this gives 2.4 m per word.

.22-

Thus the pure machine time of the first sincl second operations of 12.10 is 2.4 m per word.

TKe pure machine time of the third operation of 12.10 is, as we saw at the end of 12 . 9, 2.3 m per word.

We also observed at the end of 12.9, that even in very complicated problems the number of words thus involved is not likely to exceed 1000. This puts on the total time requirement on these counts an upper limit of 2.4 + 2.3 = 4.7 seconds, i.e. of less them 5 seconds.

Second: These time requirements are obviously negligible compared to the time consumed by the attendant mainual operations: The placing of the magnetic wires into the machine, the setting of the (memory) position definitions, etc.

It follows therefore, that there is no need and no justification for any special routine-preparing equipment (other than the typing devices already discussed) to complement a machine of the type that we contemplate.

Third: Assuming a composite routine made up often parts, i.e. of a routine and nine subroutines, we have 1=9. This represents already a very high level of complication. The preparatory routine requires 58 + 41 words, i.e. for I = 9 94 words. This represents 2.3% of the total (selectron) memory capacity, if we assume that the latter is L' =2"^^ = 4,096.

Fourth: Each subroutine requires the direct, manual typing of four words into the machine (for a., t , k. , >c. ), as well as one for all subroutines together (for I). In addition the changes of the second kind in the sense of 12.4, i.e. those which the main routine must effect on the subroutine, require several words. Indeed, the sending of the control to the subroutine requires one order, i.e. half a word. Any number is sent there at the price of two orders (bringing the number to be substituted into the subroutine into the accu- mulator, substituting it into the subroutine) euid of possibly one storage word (for the number to be substituted), i.e. of a total of one or two words. There will usually be three or more such number substitutions (the e of the subroutine, i.e. the memory position in the main routine from where the control is to con- tinue after the completion of the subroutine, and two or more data for the sub- routine). Thus five words for these changes is a conservative estimate.

A subroutine consumes therefore ten words in extra instructions, by a conservative estimate. It seems therefore, that the storage of a subroutine in a library of wires, in the sense of section 4.6, and its corresponding treatment as an individual entity becomes justified when its length in words is significantly larger than 10. A minimum length of 15-20 words would there- fore seem reasonable.

To conclude this discussion, we observe that in making these estimates, we disregarded all operations other than the actual, manual typing of words (on wire or into the machine). This is legitimate, because the time and the memory requirements of the automatic operations that are involved are negligible, as we saw in our three first remarks.

.23-

Fifth: We pwinted out in our description of the first operation in 12.10, that the various subroutines used in connection with a main routine, may bear further subordination relationships to each other. In this case they will also contain actual references to each other, emd these will have to be adjusted to the actual positions of the subroutines in question in the memory. These adjustments may be made as changes of the second kind, in the sense of 12.4, by the routines involved. They may also be handled by special preparatory routines. We expect, however, that it will be simplest in most cases to take care of them by direct typing into the memory, as indicated in the description of the fifth operation in 12.10.

The adjusting of the references of a subroutine to itself, to the actual position of the subroutine in the memory, might also have been made by direct typing into the machine. We chose to do it automatically, however, by mezins of a prepara- tory routine, because these references are very frequent: The great majority of all orders in a subroutine contain references to this same subroutine. References to another subroutine, on the other hand, are likely to be rare and irregularly distributed. They are therefore less *rell suited to automatic treatment, by a special preparatory routine, than to ad hoc, meinual treatment, by direct typing into the machine.

Actual exeunples of such situations in vhich it will also be seen that the proportions of the various factors involved are of the nature that we have anticipated here, will occur in the subsequent chapters, and in particular in Chapters 13 and 14.

Jnstitut

(U, 8 & 11) 23503 Advanned ^tudy.

Electronic Computer Project, Report on the mathgmnticail rind

logical aspects of an electronic f nnpnt-i ng „i natrunent".

'ittlter. v.i*3

OCB '52

l>.fr Urn**

PV-?

\^rAA^d^.(La\/'

9iri'

iiii-^LaaAi 1 fav-bmcL <^

Institute for Advanced Study

Matti. Nat. Sci. Library

Princeton. N. J. 08540