IEEE TRANSACTIONS ON COMPUTERS, VOL. C-26, NO. 7, JULY 1977 A Unified Numeric Representation Arithmetic Unit and Its Language Support PETER KORNERUP AND BRUCE D. SHRIVER Abstract-This paper describes a combined arithmetic unit and language support system which allows user specifications of the arithmetic. Limited extensions to a high-level language, in con- nection with a generalized underlying arithmetic unit, allow a single skeletal unified numeric operand type to be refined into a variety of data types. The interpretation of operands by the oper- ators is based on type descriptors, allowing one set of polymorphic arithmetic operators to be defined across all combinations of user-defined operand types. The arithmetic unit is realized in mi- crocode to achieve efficiency. Index Terms-Arithmetic unit, computer arithmetic, language design, microprogramming, numerical computations. I. INTRODUCTION TO THE PASCAL-UNRAU SYSTEM r HE PURPOSE of this paper is twofold: first it is to demonstrate that it is possible to provide an anomaly-free flexible arithmetic unit that supports the needs of many scientific computations and, second, it is to give the user, through high-level language facilities, control of the behavior of the number representations and the arithmetic, a control which is not even possible at the machine instruction level of contemporary computer systems [11]. The underlying methodology of this effort has been to consider both the design of a micropro- grammed arithmetic unit, together with the design of the high-level language support, as one integrated effort to support user needs [3], [12]. The interpretations of bit strings which represent arithmetic operands are usually restricted to integers and normalized floating-point numbers. A few high-level lan- guage systems exist where some nonstandard interpreta- tions have been included [2]. Normally, such systems have been realized by preprocessing and/or compiling extended high-level languages into the fixed host-machine language. The interpretation of nonstandard number representa- tions is then performed by operators as in-line code or subroutines. Such systems have been characterized by the fact that only a single new number representation has been added (say, interval arithmetic, rational arithmetic, or the like). The interpretation of the added number represen- tation is then implemented in a straightforward way in the Manuscript received January 10, 1976; revised January 5, 1977. This work was supported in part by NATO Grant 755 and in part by The Danish Natural Science Research Council Grant 511-5524. P. Kornerup was with the Department of Computer Science, University of Southwestern Louisiana, Lafayette, LA 70504. He is now with the University of Aarhus, Aarhus, Denmark. B. D. Shriver is with the Department of Computer Science, University of Southwestern Louisiana, Lafayette, LA 70504. machine language code of the host machine. A few systems have been reported where nonstandard operand repre- sentations have been realized directly in hardware [1], and other experimental systems have been reported that rely on an extensive software interpretation in standard ma- chine language which has made their use in practical ap- plications prohibitive [8]. Some high-level language systems provide the user with a certain control of the underlying arithmetic in the form of a precision specification. This facility, however, is re- stricted to the selection between available single- and double-precision representations. Even the PL/I precision specification (in bits or decimals) is in practice reduced to a selection among such available representations. An ideal computer system would provide the user with facilities for defining the number representations as well as the arith- metic operators as syntactic and semantic extensions to a suitable base language. However, the total generality, as provided in extensible languages like Algol 68, is mostly only of academic interest. This is due to the fact that the extensions have to be expressed in the base language and compiled to or interpreted in the host-machine language. The realization of an arithmetic, which is not readily im- plementable by means of number representations or op- erations available on the host machine more often then requires a good deal of effort, and such realizations are frequently hopelessly inefficient. This paper describes a compromise to the previously mentioned generality. It is based on a quite limited lan- guage extensibility, which is supported by a generalized arithmetic unit realized in microcode to achieve efficiency. Basically, the standard data-type REAL of a language has been substituted by a skeletal type called NUMERIC. The numeric data type allows a variety of interpretations as well as a variety of formats of representations. The user is given constructs in the extended language to specify a particular interpretation and representation as a new data type to be used in that program. Such user.-defined data types are treated syntactically in the program as being of one unified type, the numeric type. That is, the basic arithmetic operations are defined on all combinations of user defined variants of the one unified type. An arithmetic unit (called UNRAU-Unified Numeric Representation Arithmetic Unit) is presented whose operations are de- fined on operands of the numeric type, but where the in- terpretation of operands depends on the user specification of the type of the particular operands. The interpretations of operands that have been made 651