The accumulator operates on floating octal numbers of the form x.8y. x lies in the range -1 ≤ x ≤ 1 - 2-39 and y lies in the range -128 ≤ y < 128. Two's complements are used for negative numbers; negative exponents also have a two's-complement representation.
The standardized representation is such that
⅛ ≤ x < 1
or -1 ≤ x < - ⅛
The standard representation of zero is 0.8-128; note that this is not a string of binary zeros.
The accumulator has an 8-bit signed exponent and a numerical part of 78 bits + sign bit. The numerical part of the accumulator is divided into two parts, M and L. M consists of the sign bit and the more significant 39 bits, L consists of the less significant 39 bits. Associated with L is a sign digit called Ls; most arithmetic in the accumulator proceeds as if Ls were not present, and except where it is specifically mentioned in what follows, it is irrelevant.
The full accumulator is referred to as A; the single-length floating point content of the accumulator is called Am. We use the convention that lower-case letters indicate "the contents of", so that
|a||is the contents of A|
|m||is the contents of M, etc.|
Also we use x to indicate the numerical part, and y to indicate the exponent, so that
|Ax||is the numerical part of A|
|Ay||is the exponent of A, etc.|
Similarly, for a floating point number in the store, Sx and Sy denote the numerical part and exponent respectively.
We have thus:
It is sometimes convenient to refer to the floating point number made up of Ls and L as numerical part, and Ay as exponent. This is called Aℓ;
aℓ = ℓ.8ay
The exponent can be addressed as B124. This B-register consists of 9 bits at the more significant end, bits 23-15, the remaining bits being zero. The exponent proper is held in bits 22-15; bit 23 is a guard digit used to detect exponent overflow. If ever a number is written to B124 it should have bit 23 the same as bit 22.
Accumulator orders (A-codes) can all be doubly modified i.e. the effective address is S + ba + bm.
The simple floating point orders produce a result which is standardized and rounded. Rounding is achieved by forcing a 1 into the least significant digit position of M if ℓ is non-zero. This type of rounding is unbiased, and with it integer operations are exact provided that the numbers never extend into L.
An instruction is provided to round by adding a one in the least significant digit position of M if the most significant digit of L is a 1. (This is the type of rounding used on EDSAC 2).
No fixed point orders are provided as such. However, it is possible to do unstandardized floating-point operations, and by using these orders, and numbers with exponent zero, 40-bit fixed-point arithmetic is possible.
If after a standardized floating-point operation the exponent exceeds 128, exponent overflow is said to have occurred. This causes an immediate monitor (or entry to a trap routine). If after an unstandardised operation the numerical part is not in the range -1 ≤ ax < 1, accumulator overflow is said to have occurred. This does not lead to a monitor; however, the overflow warning is set, and this can be tested by extracode (see Chapter 5).
|E||checks exponent overflow|
|320||am'||=||am + s||QRE|
|321||am'||=||am - s||QRE|
|322||am'||=||-am + s||QRE|
(DO means division overflow - a monitor if the divisor is zero or non-standard.)
|Notation:||AO||checks accumulator overflow|
|330||a'||=||am + s||AO|
|331||a'||=||am - s||AO|
|332||a'||=||-am + s||AO|
The above instructions leave an unrounded, unstandardised result in A. Am can be stored by the 356 order.
|334||am' = s||)||no standardisation|
|335||am' = -s||AO||)|
|364||ax' = 8ax, ay' = ay||NB Overflow not checked|
|365||ax' = ⅛ax, ay' = ay|
The 364 and 365 orders do not involve an operand from the store. The construction of the machine is such that all A-codes must have an operand address, whether or not they use an operand. For orders such as 364 and 365, it is conventional to use J4 as a dummy address, thus the specification should be written
|364||0||0||J4||ax' = 8ax,||ya' = ya|
|365||0||0||J4||ax' = ⅛ax,||ya' = ya|
Fixed-point multiplication can be done by the following orders:
These orders leave the double length product in a, and set Ls (the sign digit of L) to zero.
As 372, 373 except that Ls is set equal to the sign of the product. Thus they are particularly suitable for integer multiplication: provided the product does not exceed single length, it is correctly stored in L. Note that AO is only set if the product exceeds double length, not when it overflows into M. The product can be stored by the order
In fixed point working it is often convenient to use exponent zero for the numbers. However, if integers are being manipulated, particularly if fixed and floating operations are being intermingled, it is sometimes useful to use exponent 13, since the integer is then correctly represented as an unstandardized floating-point number. Note that if numbers with exponent 13 are multiplied by the orders given above, the exponent of the product will be 26, and this must be corrected before using a 357 order to store the product.
Other fixed-point orders are:
|354||am' = a||R + AO|
|Round by adding 1 in the least significant position of M if the most significant digit of ℓ is a one|
|341||a' = a||EO||This order is not likely to be useful|
|361||am' = a||R EO|
|This order rounds off the accumulator, but does not standardize it.|
The above three orders do not refer to the store for an operand. However, the construction of the machine is such that all A-codes must have an operand address: it is conventional to use J4 as a dummy address for A-codes such as these.
It is sometimes convenient to do floating-point arithmetic where the answer is standardized but not rounded. The orders available are as follows (see also Section 4.10 below).
|340||a' = a||Q EO|
|Standardizes the accumulator. Address should be J4|
|366||a' = |am|||Q EO||(Address J4)|
|367||a' = |s||
The following group of orders leave a double-length standardized result in a.
|300||a'||=||am + s||Q EO|
|301||a'||=||am - s||Q EO|
|302||a'||=||-am + s||Q EO|
|310||a'||=||a + s||Q EO||)||L not cleared initially|
|311||a'||=||a - s||Q EO||)|
If ay ≤ sy, the number in the accumulator is shifted down, and its exponent increased until ay = sy. Since L is not cleared before shifting, the result will be a correct double-length sum or difference. However, if ay > sy, then the operand has to be shifted, and this destroys the original contents of L. In this case 310 and 311 will form a correct single length product and leave rubbish in L.
Extracodes will be provided for true double-length working, but they are not available at present.
If the accumulator is regarded as holding a double-length number, then we can write
a = am + aℓ.8-13
since aℓ has an exponent ay which is 13 more than its true value. Function 355 can be used to position aℓ correctly:
|355||Copy Ls into all digits of M and standardize, i.e.|
| a' = aℓ.8-13 Q|
(Address must be J4)
Note that if Ls is zero, a' = a - am
Various instructions which load and store the accumulator have already been introduced. The following is a complete list.
|356||s' = am|
|357||s' = aℓ|
|346||s' = am, a' = 0|
|347||a' = aℓ, ℓ' = 0|
|324||am' = s||Q|
|325||am' = -s||Q EO|
|334||a' = s|
|335||a' = -s||AO|
|314||am' = s||)||L not cleared|
|315||am' = -s||AO||)|
|344||ℓ' = sx|
|345||ℓ' = sx||all digits of m = sign digit of s|
There are three division orders which leave a quotient in L and a remainder in M. However, they only operate correctly for numbers which satisfy certain conditions, and must be used with great care. The most useful of these orders is 375. A simplified definition is:
ℓ' = a/|s|
a is divided by the modulus of s, the quotient is placed in ℓ, and ay' = ay - sy
a and s must satisfy the condition
0 ≤ ax < |sx| < ½
The remainder lies in the range
0 ≤ m' < |sx|
375 can be used for division of positive integers as follows. The integer c is represented as a non-standard floating-point number with numerical part c.8-13 and exponent 13. The dividend is placed in L with M clear, thus the dividend is now in Ax with an additional scale factor of 8-13. After the division the exponent of the accumulator will be zero (assuming that both divisor and divident had exponent 13), and must therefore be set to 13 if aℓ is to represent correctly the integer quotient, and am the integer remainder. Thus to divide the integer in register 1 by the integer in register 2, we proceed as follows:
If the quotient is required in M, we can set the exponent to 26 and then use the 355 order.
The full definition of the 375 order is:
Conditions: 0 ≤ ax < |sx| < |
True remainder m" is given by
ay' is the exponent of the quotient. The exponent of the remainder is ay - 13 (NB. ay - 13 NOT ay' - 13.)
Further details of the 375 order, and the 376 and 377 orders, will be found in the Atlas 1 programming manual (Chapter 6).
Copyright © 1965-1969 University of Cambridge Computer Laboratory. Distributed by permission. Thanks to Barry Landy, Roger Needham and David Hartley for giving permission to distribute these documents. Thanks to Barry Landy for lending me the paper document from which this was scanned. Any typographical errors probably arose in the course of OCR.
Previous chapter: Chapter 3: B orders and Test Orders
Next chapter: Chapter 5: Extracode Instructions
Return to TITAN Machine-Code Programming Manual
Return to CUCPS TITAN page
Return to CUCPS home page
Return to University of Cambridge home page