Section 3.9

Group 9

The functions of group 9 are concerned with floating-point arithmetic.  Function-number 96 is unassigned and therefore illegal.  For the other functions, the operands must be in standard single-length floating-point form and the result is given in the same form (except for function-number 97).  Any attempt to obey floating-point instructions with operands not in the standard form causes suspension due to impermissible operand.  Floating-point operations may be rounded or unrounded at the programmer's discretion (see section 5.2.5).

In standard floating-point form, the m.s. 40 bits represent xa, the 'argument' or 'fixed-point part'.  This is a signed fraction which is either zero or lies within one of the ranges

xa < 1  or  -1 xa < -

Since the arithmetic unit can accept one bit of overflow, it is possible to, say, add two numbers to produce a sum exceeding +1 and still have the correct floating-point result. 

The l.s. 8 bits of the word represent the 'characteristic'  xk.  This is a non-negative integer in the range 0 to 255 and such that the exponent xe = xk -128.  Then the complete floating-point number xG has the value

xG = xa . where -128 xe < 127.

If a floating-point number would be in the range -2-129 xG < 2-129 then it is stored as zero (i.e. a clear word).  Production of such a result is termed 'floating-point underflow'.

If an instruction would produce a result greater than or equal to 2127 or less than -2127, floating-point overflow results and either the overflow indicator is set or monitoring action follows (see sections 5.2.3 and 5.3.23).  This happens if any of the functions 90 to 95 would produce a result outside the above limits.  If the program is not monitoring on floating point overflow the result of the instruction is zero.

Note that there is no 'copy' instruction, such as xG' = yG : the 04 function performs this operation.  Function-numbers 102 and 103 are also associated with floating-point operations.

Function-number 90  [1001 000]

3-address:  zG' = xG + yG            2-address:  xG' = xG + yG

Add the floating-point numbers in X and Y, writing the result into Z or X.

Function-number 91  [1001 001]

3-address:  zG' = xG - yG            2-address:  xG' = xG - yG

Subtract the floating-point number in Y from that in X, writing the result into Z or X.

Function-number 92  [1001 010]

3-address:  zG' = yG - xG            2-address:  xG' = yG - xG

Subtract the floating-point number in X from that in Y, writing the result into Z or X.

Function-number 93  [1001 011]

3-address:  zG' = - yG               2-address:  xG' = - yG

Negate the floating-point number in Y, writing the result into Z or X.  OVR will be set if yG = -2127.  If yG = 2-127 underflow will occur.

In 3-address form, X is irrelevant and it is recommended that this form should not be used.  If the 3-address is used, the X-address is not checked for lock-out or reservation violation unless replaced.  In 2-address form, xG is read from the store but is not used as an operand.

Function-number 94  [1001 100]

3-address:  zG' = xG.yG              2-address:  xG' = xG.yG

Form the product of the numbers in X and Y, writing the result into Z or X, all numbers being in single-length floating-point form.  OVR is set if the result exceeds capacity.

Function-number 95  [1001 101]

3-address:  zG' = xG/yG              2-address:  xG' = xG/yG

Divide the number in X by that in Y, writing the result into Z or X, all numbers being in single-length floating-point form.  OVR is set if the result exceeds capacity.  If y=0 the program is suspended as with other division instructions (see section 3.4).

Function-number 96  [1001 110]

3-address: Unassigned, illegal     2-address: Unassigned, illegal

Function-number 97  [1001 111]

3-address:  zI' = number of places through which (xG - yG) must be shifted up to produce a result in standard form.
2-address:  As 3-address, but with xI' = number of places.

Form (xG-yG) and count the number of places through which the result must be shifted up to bring the argument within one or the other of the standard ranges, then set this shift-number as an integer in Z or X.  Note that (xG-yG) is formed only within the arithmetical unit and is not stored.  OVR cannot be set.

The main purpose of this function is to measure the closeness to which the floating-point numbers agree, e.g. to decide when an iterative process has been taken to sufficient accuracy.

If xG and yG are exactly equal then  zI' or xI' = 47

In borderline cases the number produced may differ by one from that one would expect from the formula.  The details of this are too complicated to give here or to use in a programming trick.

If xG-yG would need to be shifted down to bring it within standard form, the result produced is -1.