4.1 Floating-point numbers

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.

4.2 The Accumulator

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
ais the contents of A
mis the contents of M, etc.

Also we use x to indicate the numerical part, and y to indicate the exponent, so that
Axis the numerical part of A
Ayis 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.

4.3 Rounding

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).

4.4 Fixed Point Arithmetic

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.

4.5 Overflow

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).

4.6 Simple floating-point instructions

Echecks exponent overflow
320am'=am + sQRE
321am'=am - sQRE
322am'=-am + sQRE
374am'=am/sQRE DO

(DO means division overflow - a monitor if the divisor is zero or non-standard.)

4.7 Simple "fixed-point" instructions

Notation:AOchecks accumulator overflow
330a'=am + sAO
331a'=am - sAO
332a'=-am + sAO

The above instructions leave an unrounded, unstandardised result in A. Am can be stored by the 356 order.
334am' = s)no standardisation
335am' = -sAO)
364ax' = 8ax, ay' = ayNB Overflow not checked
365ax' = ⅛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
36400J4ax' = 8ax,ya' = ya
36500J4ax' = ⅛ax,ya' = ya

4.8 Further "fixed-point" instructions

Fixed-point multiplication can be done by the following orders:
372a'=am.sEO, AO
373a'=-am.sEO, AO

These orders leave the double length product in a, and set Ls (the sign digit of L) to zero.
352a'=am.sEO, AO
353a'=-am.sEO, AO

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:
354am' = aR + AO
Round by adding 1 in the least significant position of M if the most significant digit of ℓ is a one
341a' = aEOThis order is not likely to be useful
361am' = aR 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.

4.9 Unrounded floating-point working

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).
340a' = aQ EO
Standardizes the accumulator. Address should be J4
366a' = |am|Q EO(Address J4)
367a' = |s|

The following group of orders leave a double-length standardized result in a.
300a'=am + sQ EO
301a'=am - sQ EO
302a'=-am + sQ EO
342a'=am.sQ EO
343a'=-am.sQ EO

4.10 Pseudo double-length working

310a'=a + sQ EO)L not cleared initially
311a'=a - sQ 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:
355Copy 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

4.11 Load and store instructions

Various instructions which load and store the accumulator have already been introduced. The following is a complete list.
356s' = am
357s' = aℓ
346s' = am, a' = 0
347a' = aℓ, ℓ' = 0
324am' = sQ
325am' = -sQ EO
334a' = s
335a' = -sAO
314am' = s)L not cleared
315am' = -sAO)
344ℓ' = sx
345ℓ' = sxall digits of m = sign digit of s

4.12 "Fixed-point" division

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|
m' = remainder

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:
1211240J015(exponent 13)
35600-store remainder
35700-store quotient

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
m" = m' if m' ≥ 0
m" = m' + 1.0 if m' < 0
(i.e. if m' < 0 the sign digit must be changed to a zero to give the correct remainder)
0 ≤ m" < |sx|

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

Contact: CUCPS Committee (
This HTML version last updated: $Date: 2001/07/02 21:08:56 $