<<

393 10.5 A NEW APPROACH TO THE FUNCTIONAL OF A DIGITAL COMPUTER

R. S. Barton Computer Consultant Altadena, California

Summary The Engineers' General Purpose Machine

The present methods of determining the func­ In the design of machines to meet competition, tional design of computers are critically reviewed the utilization of new components is likely to be of and a new approach proposed. This is illustrated vital concern to the . While requiring a by explaining, in abstracted form, part of the con­ complete new set of programs, the new product sel­ trol organization of a new and different machine dom shows more than minor variations of the tradi­ based, in part, on the ALGOL 60 language.*• The tional design. Its new features originate with both concepts of expression and procedure lead directly programmers and logical designers, but those ideas to use of a Polish string program. A new arrange­ which are contributed by the programmers stem usu­ ment of control registers results, which provides ally from applications experience with previous for automatic allocation of temporary storage within machines rather than from systematic theory. The expressions and procedures, and a generalized sub­ logical has the lastword and is most likely routine linkage. to accept ideas which require a minimum of new design. The simplicity and power of these notions sug­ gests that there is much room for improvement in The Programmers' General Purpose Machine present machines and that more attention should be given to control functions in new . It seems to be the case that as yet no machine's "design has been significantly effected by persons Introduction experienced in the development of automatic program­ ming systems. Programming still must be imposed The ideas presented arise from the conviction upon designs that have been determined by market­ that for a true general purpose digital computer both ing pressures and tradition. It must be admitted coding and operation should be fully automated. that the programmers of the last decade have been Higher programming languages , such as ALGOL, poorly prepared to make the kind of contribution that should be employed to the practical exclusion of should be expected. The art of programming has de­ machine language; questions of efficiency of object veloped in a helter-skelter manner, leaving behind program and translation process ought not to arise little of value. There is almost no theory and little if the machine has been properly designed. Opera­ standard methodology. The logical designers have tion should be under the control of the machine it­ a large body of switching theory as a basis for their self, in a fuller sense than is typical in current work and have, consequently, done better. practice. The functions of scheduling, segmenta­ tion of programs for multi-level storage, and control The Simultaneous Design of Computers of input - output operations should be handled by a and Programming Systems general operational program. Rather than hope for a new spirit of cooperation This new approach.will be illustrated after re­ among disparate product planning, , and viewing the customary methods of machine design. programming departments, a single small organiza­ tion is needed for each product conception. This The Special Purpose Machine would be comprised of three kinds of people respon­ sible for aspects of system model, program design, In simple and well defined applications, the and logical design. may dispense entirely with program­ ming assistance and the program may be entirely , As an example, for a computer to process appli­ or in large part, in the hardware. If the processing cations expressible in the ALGOL 60 language, the required is complex, programmers are invited to as­ system model group would interpret the language , sist the engineers. There will be a period of trading- specify a hardware representation and necessary off programmed and component logic, but the result­ language supplements, define speed or cost objec­ ing machine will tend to resemble the conventional tives , and the "use image" the machine is to present. general purpose computer. They would have responsibility for ensuring proper interpretation of the model by both programmers and logical designers. The program designers would have background can be included. Using the stack construct, next experience in the construction of translators and described, there is no need for store and fetch com­ some knowledge of logical design. They will con­ mands such as are normally associated with the sider necessary reductions in the source language temporary storage of intermediate quantities in the and translation techniques to enable efficient object evaluation of expressions. More important, there- time interpretation by hardware. suiting program is in a better form for the applica­ tion of procedures to improve program efficiency than The logical designers would be oriented in cur­ is the case with the usual command languages. rent programming practice and become familiar with the source programming language to be used. Their The Stack Construct task is to produce designs to handle the reduced languages. Assume that the elements of the string are exa­ mined from left to right so that operators need not Concepts for the Design be deferred. Normally, for unary and binary opera­ tors , the transformation to Polish form would ensure Some simple ideas are now presented that arise (excepting in the case of procedures) that at most quite naturally from using the ALGOL 60 language as two operands would have to be fetched before each a model. These ideas have actually entered into execution. the design of a new Burroughs Information Processing System, For purposes of exposition, they will be To mechanize the Polish string program, a spe­ considered out of the context of the actual machine, cial address-length register called the stack counter and liberties will be taken to avoid complications is provided to hold the most current cell address in which are not germane to the subject. a vector of temporary storage cells referred to as the. stack. Two word-length arithmetic registers-hold Polish String Program the most recently fetched or computed operands . Associated with each of the latter is an occupancy The Polish notation was invented by the logician toggle for indicating whether or not that register Lukasiewicz for use in the propositional calculus. contains an operand. It has the advantage that rules of operator prece­ dence and signs of grouping are not required. At The action of the stack is defined in Table I. least two logical machines have been built which The following notation applies: S, A, B, TA, Tg use it as a source language. The first of these was represent the contents of the stack counter , arith­ the Burroughs Truth Function Evaluator^. More re­ metic registers, and occupancy toggles. X is an cently, Bauer described a similar logical device ^ operand. © and © are unary and binary operators. and hinted of remarkable results which were dis­ S* signifies the contents of the cell addressed by cussed in another paper4. During the past few the contents of S. years , numerous persons have "discovered" the ex­ tension of this notation to arithmetic expressions Now, while the case of stack operation, which and found it useful as an intermediate language in is presented is somewhat simplified, it does show designing algebraic translators. how a Polish string program can be mechanized. The occurrences of operators with TA = TB = 0 is actually Any expression, as defined by ALGOL 60, can abnormal, but are included to allow continuation in be simply translated into Polish form, and this can the event that the evaluation of an expression is be the basis of an efficient machine language to be interrupted. The state T& = 1 / Tg = 0 is unstable. used in place of the customary single or multiple- address command formats. Methods for doing this It is worth noting that upon completion of the are well known and familiarity with an algorithm is evaluation of a well-formed expression we have assumed. While it would be q"uite feasible to con­ TA = 0, Tg = I, with the value of S upon completion struct a machine to directly interpret ALGOL expres­ equal to its initial value. This offers a possibility sions having suitably restricted identifiers, it was for checking in the hardware which does not exist in decided, in view of the simplicity of the transforma­ such a simple form for the usual command language. tion, to use the Polish form. At this point, it is important to stress that programs need never be In the event that the reader does not happen to written in Polish form; and no lower level assembly- be familiar with the Lukasiewicz notation, he may type language is required. find it useful to trace the operation of the stack for the program XY + VW/U + x Z + which corresponds This form provides a machine language with many to the expression 0C + Y) x (U + V/W) + Z. desirable properties. Programs consist of a string of elements which correspond to identifiers, literals, or operators. All the operators defined in ALGOL60 395 10.5 Subroutines and ALGOL Procedures Let it now be assumed that the execution of a scanned program element is delayed until the follow­ To realize additional important advantages from ing syllable has been interpreted. Operators can be this program format , we extend these notions to defined which force the preceding syllable to be a handle n-ary operators or n-place functions that are call-by-name. Each word in the stack has a control defined by sub - programs. The important case of bit that distinguishes between values and names. v call - by - name is deferred. Call-by-value only is The address referenced by the element preceding the discussed. Declarations of functions will cause call-by-name operator then is entered into the stack subroutines to be generated and extensions of the and the control bit for that cell set to indicate a operator set to be defined. Similarly, it is assumed name. If an operator is encountered, followed by that for each array one or more storage - mapping the call-by-name operator, the operator (or the lo­ functions have been defined and that, corresponding cation of the subroutine which effects execution of to each, a subroutine has been created from the ar­ an extended operator) goes into the stack and the ray declaration which will have access to informa - control bit is set. Within a subroutine, any refer­ tion on bounds of indices and the base address of ence to this stack cell that is not followed by a call- the array. Such subroutines will also be called by by-name operator will cause execution. If, other­ extensions of the operator set. The program corres­ wise, the reference to the cell is again followed by ponding to the array element or function call will a call-by-name operator, the cell contents are co­ then consist of an ordered set of expressions repre­ pied into the new stack level. A similar action re­ senting the indices or arguments. The values of sults whenever a parameter of one subroutine is used these are entered into the stack. When the opera­ in a lower level subroutine. tor corresponding to that subroutine is encountered, linkage automatically results. Other Consequences of the Design

Subroutine Control Using the Stack Some of the key aspects of the logical organiza­ tion of the machine have been introduced in a gradual It is now necessary to place the contents of . While not all of the consequences of the registers A and B (or B if A is empty) into the stack model which have been developed can be presented since the subroutine to be executed will generally in this paper, a few concluding remarks may be of require these registers. Furthermore, the contents value. of the control counter, C, must be saved to enable return from the subroutine. This return can be saved Change of sequence is accomplished by one of in the stack and the position of this address recorded two means: jumps relative to C of conditional or in another address-length register designated F. To unconditional type, or via a switching table of en­ afford a link to the return for a possible higher level tries corresponding to labeled program segments. subroutine, the former contents of F are retained in The conditional jumps examine the truth value in the the cell with C. Finally, the subroutine entry ad­ stack produced by evaluation of a Boolean expres - dress specified by the extension operator is entered sion, and then cause it to be erased. Fbr ease of into C and linkage to the subroutine is complete. segmentation and effective use of a random-access secondary storage device, we make program invariant Within the subroutine, the parameters are ad­ with respect to its position in storage. Correspond­ dressed minus relative to F in reverse order. Tem­ ing to each declaration of array, switch, or proce­ porary storage is allocated for the subroutine by dure will be a " locator " word which is assigned in advancing S corresponding to the number of cells a table. Program references are then made to these needed. These cells can then be addressed plus words to obtain the location of the corresponding pro­ relative to F. It will al'so be useful to store con­ gram. These words contain other information which stants used by the subroutine ahead of its entry and isitilizedin multi-programming and automatic seg­ address them minus relative to C. mentation control.

Upon exit, the resulting value is left in B, the "Locator" words also correspond to labeled pro­ contents of S are replaced by F, and for the cell then gram segments and input-output control information. addressed by S , the C-part will go to C and the F- The latter are grouped for scanning by a universal part to F. Finally, S is reduced by n - 1. This auto­ input-output control program which assigns I/O chan­ matic linkage construct enables the use of subrou­ nels . The main program and I/O control program tines in depth and a subroutine may call itself. communicate via a status bit in these words.

Denoting the F and C parts of S* by S*p and Character and bit manipulation constructs for S*Q , respectively, the location of the subroutine by the machine are also departures from familiar prac­ P, and other notation as previously defined, the ac­ tice , but arise from different considerations and will tion upon entry and exit is displayed in Table II. not be discussed here. 396 10.5 Conclusion References

It is hoped that a case has been made for a way 1. Naur, P. (Editor): Report on the Algorithmic to introduce some new ideas into a field where enor­ Language ALGOL 60, Comm. Assn. Comp. Mach. 3, mous amounts of technical talent are spent in de­ No. 5 (1960), 299-314. signing the hardware and programs for a large number of very similar machines. Most of these are "general 2. Burks,A.W.,Warren, D.W., Wright, J. B.: purpose." Much of the effort in developing these An Analysis of a Logical Machine Using Parentheses- machines could better be spent in designing some Free Notation, Math. Tables Aids Comp. 9 (1954) , useful "special purpose" computers. An ALGOL ma­ 53-57. chine would fit into the latter category. With auto­ mated logical design and fabrication in the imme­ 3. Bauer, F. L.: The Formula-Controlled Logi­ diate future, any number of these useful special cal Computer "Stanislaus," Math. Comp. 14, No. 69 purpose machines can be envisaged. (1960), 64-67.

4. Samelson, K. and Bauer, F. L.: Sequential Formula Translation, Comm. Assn. Comp. Mach. 3, This paper is based on work sponsored by the No. 2 (I960), 76-83. Burroughs Corporation,

OPERAND UNARY OPERATOR BINARY OPERATOR

1. X—»A, TA= 1 1. S*-»B, TB = 1 1. S*-»B, TB = 1 2. A—»B, TB = 1, TA= 0 2. S-l—»S 2. S-1->S TA=TB = 0 3. B9-*B 3. B-*A, TB = 0, TA= 1 4. S*-*B, TB = 1 5. S-1-»S 6. AB©—»B, TA= 0

1. X—»A, TA= 1 1. B0—»B 3. B—»A, TB = 0, 1A= 1 TA = 0 4. S*—*B, TB= 1

TB = 1 5. S-1-*S 6. AB@—»B, %= 0

1. S + l—>S 1. AS—»A 6. AB©—>B, TA = 0 B—*S* T « T = 1 2. A B 3. A-*B 4. X—>A

TABLE I

ENTRY EXIT

6. S + I—>S (Normal for procedure 7. F-»3*p, C-*S*C without value) TA = TB - 0 8. S-*F 9. P-»C 1. F—»S

2. S*F-*F, S*C-*C 3. S-n-I—»S

4. S+I—»S (Normal for procedure TA-0 5. B—»S*,TB = 0 with value)

TB = 1 Steps 6 through 9 (Same as above)

1. S+1-*S (Improper) 2. B—>S* TA = TB = 1 3. A—>-B, TA= 0 4. S + I—»S

5. B—>.S*,TB = 0

Steps 6 through 9

TABLE II