258

• D. E. Knuth

numeric either. He used il, 21, "" for short

tanks NPRIME, MPRIME, etc. in the first

piece of code, and later is, ~2, "'" for the

short tanks in the second, etc. Long tank

locations were represented by unbarred

numbers with subscripts; for example, lines

32

and 33 in his notation were written as

follows:

"18) ~ -

~ ~)

~ o

2~) 2~-+ ¢

and from here on like (a) with 0,0 for

xn0, y0 .,, This was essentially a "regional"

addressing technique, which was used by

many programmers in the ensuing decade.

After having written the program, he

assigned actual addresses to the subscripted

ones. In order to make the code reloeatable,

for use as a general open subroutine, he

assigned the addresses relative to an un-

specified starting location e. His address

assignments are shown in Figure 2 at the

right of the instructions.

He made an interesting and rather subtle

error of judgment here, regarding latency

time. Since the instruction in location

ALPHA1-}-4 (line 50 of the program in the

preceding section) jumps into the short

tanks to execute three commands and

transfer to BACK1, he didn't want BACK1

to occupy location ALPHAI+5 since the

long tank wouldn't be ready for that instruc-

tion until at least 33 word times after

ALPHAI+4. So he intercalated 4 empty

words between ALPHAI+4 and BACK1,

"in

order to avoid a delay of about one long

tank." But since the instructions in

MOVEIN and MOVEOUT make essen-

tially random references to long tanks, an

elementary argument can be given to prove

that the

average

computation time which

elapses between the execution of instruction

ALPHAI+4 and the execution of instruc-

tion BACK1 is 2p + 49.5 word times, com-

pletely

independent

of the location of

BACKli Therefore BACK1 should really

have been placed so that its

subsequent

instructions are optimally located, i.e. so

that the TRA COMPARE takes the least

amount of time. Von Neumann inserted

extra blank words into the initialization

routine for the same fallacious reason. On

the other hand his allocation of ALPHA,

BETA, and GAMMA vis-a-vis each other

and the COMPARE routine was correctly

handled; the instruction in SWITCH is not

a random memory reference, so his intuition

didn't mislead him here. (ALPHA1 and

ALPHA2 .were placed badly; this was ap-

parently an oversight.)

Von Neumann discussed the relocatability

of this routine by enumerating the nine

instructions which are variable (those whose

codes depend on p, EXIT, or the relocation

factor e). He didn't say exactly how these

instructions were to be changed after they

have been read in from tape; he apparently

did not yet realize that the limited EDVAC

code he had proposed (with no shift instruc-

tions, for example) made it difficult to insert

p into the "PIK" and "PUT" instructions,

since the machine could only store into the

address field of instruction words.

It is perhaps significant that he thought of

this program as an open subroutine, not

closed, since he did not regard EXIT as a

parameter on a par with n, m, location(x0),

etc.

He concludes his memorandum with an

analysis of the running time, leading to a

total time of 2.60

+ (n + m)(p/16 +

2.61)

msec. (His actual figure was 1.61 instead of

2.61, due to a slip in arithmetic.) Some

errors in the calculation of latency times,

related to his misunderstanding cited above,

make this analysis slightly invalid; the

reader may verify that the actual running

time (averaged over all possible placements

of x0, y0, and z0 in the long tanks) is 3056 +

(n + m)(64p +

4016) ~sec. If we incorporate

all of the improvements to the coding that

have been mentioned above, the average

time decreases to 2576

+ (n + m)(64p +

2560) ~sec.

THE SEQUEL

After World War II came to an end, the

original EDVAC group disbanded; Eckert

and Mauehly remained in Philadelphia, to

form their own company, while Goldstine

and yon Neumann went to the Institute for

Advanced Study in Princeton. The veil of