# User manual | ! I Burroughs

I

## Burroughs

!

BURROUGHS SCIENTIFIC PROCESSOR

## FLOATING POINT ARITHMETIC

(

BSP

~~~-~-

BURROU(;HS SCIENTIFIC PROCESSOR

CONTENTS

Section

1

2

INTRODUCTION

DATA REPRESENTATION IN MEMORY

3

4

5

Single Precision Floating Point Word Format

Integer Word Format

Double Precision Real Floating Point Word Format

DATA REPRESENTATION IN THE ARITHIVIETIC ELEl\1ENTS

Basic Data Representation

Representation of Zero

Complex Number (Single Precision)

HARDWARE ERROR CHECKING

ARITHMETIC ALGORITHMS

Implementation of Reciprocation and Square Root

Division

Square Root

6

ROUNDING AND NORMALIZATION

Rounding - Single Precision

Rounding - Double Precision

Normaliza tion

Appendix A - Arithmetic Operations

Appendix B - Error Estimates for Arithmetic Operations

Page

1

3

7

7

8

8

3

4

5

9

11

15

17

17

19

11

13

13

15

27 iii

~~p ~~~~~~~~~~~~~~~~~~~~~BURROUGHSSCIENTIFICPROCESSOR

BSP

1. INTRODUCTION

One of the most important features of any computer is its arithmetic. This document discusses the implementation of floating point arithmetic in the Burroughs

Scientific Processor (BSP). Data representation in both the BSP memory and arithmetic element is described, as are the arithmetic algorithms used in the

BSP. Of particular interest are the techniques used for error checking in the arithmetic element and for rounding in both the scalar processor and the parallel processor. The BSP arithmetic operations, including instructions and cycle operations, are described in detail in Appendix A, and the accuracy of arithmetic operations is discussed in Appendix B.

1

, I

1 i

BSP

; !

~

F

2. DATA REPRESENTATION IN MEMORY

The representation of data in the memory of the Burroughs Scientific Processor

(BSP) is as follows:

1.

Single precision floating point word format,

2. Integer word format,

3. Double precision real floating point word format.

SINGLE PRECISION FLOATING POINT WORD FORMAT

A single precision floating point number, X, is represented by an ordered pair of numbers, E (exponent) and m (mantissa)" such that:

X

=

2

E

* m where E is an integer and m satisfies the condition:

-1/2 .::. m

<-

1 or 1/2'::: m

<

1 or m

=

O.

In order to meet this condition, that is, 1/2 ':::Iml

<

1, the last step in every floating point operation is the normalization of the mantissa (removal of leading zeroes).

The layout of the floating point word in memory is indicated below. The bits are numbered from right to left. The least significant bit is numbered 0; the most significant bit of the mantissa is bit 35; the least significant of the exponent is bit

36. The most significant bit of the exponent is bit 45. Bit 46 is the sign bit of the mantissa; bit 47 is the sign bit of the exponent. Every group of consecutive bits is

3

4 called a field. and is denoted by W [x:y]; W is the name of the data unit x is the address of the left-most bit. and y is the length of the field. Thus. a data word of the data unit. A. is defined as A [ 47:48]. and its null indicator is defined as

A[48:1].

Using field notation X [leading bit:numbers of bits]. the mantissa is represented by X [35:36J. the exponent by X [45:10J. the sign bit of the mantissa by X[46:1].

47 46 45

Exponent

36

35

Mantissa o

Sign of Exponent

The range of representable numbers in single precision is as follows:

1. For positive X:

2-

1023

*

1/2 2. X 2.21023

*

(1_2-

36

>. where

2- 1023

*

1/2 ;' 10- 308 . 25

2. For negative X:

_ 2-

1023

*

1/2

X

## ~

_2

1023

*

(1_2-

36

>. where

INTEGER WORD FORMAT

An inte~er.

I. is defined by its absolute value m

(1) and by its sign bit S

(1).

Field

I [35:36J contains the magnitude, and the sign bit is in field [46:1]. The unused bits of the data word are set to O. The range of integer values is symmetric about zero.

_2

36

+

1

< 1<

2

36

_1

46 35

~ ~

Sign of Integer

0

I

(

\

I

BSP----------~~

----------~-------------

BU R ROUGHS SCI ENTI F! C PROCESSO

R

DOUBLE PRECISION REAL FLOATING POINT WORD FORMAT

A double precision floating pOint number X is represented by two single precision numbers FIRST (X) and SECOND (X). Both of these numbers are normalized. The mantissa sign bits must be the same. Due to normalization, the relationship between exponents is:

EXPONENT (SECOND (X»

<

EXPONENT (FIRST (X» -36

SECOND (X)

=

0 is a valid word.

Thus, a double precision floating point word is the sum D(X)

=

FIRST (X)

+

SECOND (X). The BSP double precision format is different from the B 7800 double precision format. In the B 7800" the exponents and the mantissas of the two single precision words are concatenated" and the two words form one entity.

The range of a double precision number X is given as follows:

1. For positive X:

2. For negative X:

The double precision format of the BSP, specifically the fact that the exponent of the second word is less than or equal to the exponent of the first word minus 36, can lead to an underflow condition in the second word" while there is no underflow in the first word. For example:

The multiplication of the number in brackets by 1/2 will lead to underflow in the second word. However .. the underflow condition can be disabled.

5

~~p ~~~~~~~~~~~~~~~~~~~~~BURROUGHSSCIENTIFICPROCESSOR

---- BURROUGHS SCIENTI FIr: PR.JCi:SSOR

3. DATA REPRESENTATION IN THE

ARITHMETIC ELEMENTS

BASIC DATA REPRESENTATION

The basic BSP data word consists of 48 binary digits (bits). To this word are appended 12 other bits to form a data unit: a one-bit null indicator, three error condition bits (underflow

1 overflow, and undefined), four guard bits, two modulo

3 residue code bits for the mantissa, and two modulo 3 residue code bits for the exponent. For input and output purposes l only 49 bits are used: the 48-bit data word l and the null indicator. The positions or addresses of binary digits within the data unit are designated by the decimal numbers 0 to !l9. Within the data word, the bits are numbered

0 to 47. The data format in the arithmetic unit is given in the following diagram:

Exponent Sign

X:

Sign of Ma ntissa

4'74645 . . • 3635 •. 0 4 9 5 0 5 1 5 2 5 3 5 4 5 5 4 8 5 6 5 7 5 8 5 9

I I I

T

T

1'1'

I

1'1'

I

I'

I

I I

'1' " I' "

I'

I

"I'

I I

'"

'"

I

Exponent

Mantissa

Guard Bit s

Underflow

Overflow'

I

Undefined

Null ------------------------------------------------------------~

Mantissa Res idue

-------------------------------------------------------J

Exponent

Residue---------------------------------------------------------~

7

8

~~p ~~~~~~~~~~~~~~~~~~~~~BURROUGHSSCIENTIFICPROCESSOR

REPRESENT A TION OF ZERO

Integer, single precision, and double precision zero are represented with all bits set to zero. So called dirty zeroes are eliminated by hardware action. Operations which may result in dirty zeroes, for example: (0)

*

(-5) or N -N are tested. When a zero mantissa is found, sign bits and exponent are also set to zero.

COMPLEX NUMBER SINGLE PRECISION)

Complex numbers are implemented implicitly. Two contiguous, single precision floating point numbers represent a complex number Z, where the first number is the real part of Z and the second number is the imaginary part of Z. No double precision complex numbers are provided. Single precision complex operations are implemented by software using real arithmetic hardware operators.

BSP

--------~~~-------------~-------

BURROUGHS SCI ENT! F Ie PROCESSOR

4. HARDWARE ERROR CHECKING

Error checking in the arithmetic element is done in three ways:

1.

Errors which result in overflow, underflow, or undefined opera tions within arithmetic elements.

2. Errors within the arithmetic elements are checked by a modulo 3 residue code. Exponent and mantissa are checked separately (two bits each). A modulo 3 residue code is limited; it cannot detect errors which are multiples of three.

A modulo 3 error results in an interrupt. Errors are reported for logging and to the parallel memory control to disable parallel memory write.

3. Errors in data transmission. A Hamming Code generator computes seven parity bits of a Hamming Code over the 48 bits of data. This code is a single error correction/ double error detection code (SEC /DED), which protects the parallel memory and the data transmission of the alignment networks.

Input data from the arithmetic elements are encoded by the alignment networks; input data from the control processor and from file memory are already encoded.

9

10

Detected errors are logged in the maintenance log. The Hamming Code will report bit error, arithmetic element numbers and error type. There are three classes of errors:

1.

Tolerable error (e. g., Hamming Code single bit error),

2. Fatal error (e. g., memory address error during write cycle)

3. Retryable error (e. g., double bit Hamming Code error, that is, conditional, overflow, underflow, undefined).

These three errors are reported as interrupts to the Master Control Program

(MCP). It is up to the MCP to determine the appropriate action.

Fatal and retryable errors will inhibit a write cycle. Depending on error type, a retry or a system shutdown as initiated.

I · \

BSP - - - - - - - - -

~-----~-----~--~--~-~ BUR ROUGHS SCI ENTI F IC PROCESSOR

5. ARITHMETIC ALGORITHMS

IMPLEMENTATION OF RECIPROCATION AND SQUARE ROOT

The ESP implements reciprocation and the square root by iterative procedures. Both algorithms are applications of the Newton-Raphson method that utilize multiplications and additions only. Both algorithms are partially hardware-implemented.

The Newton-Raphson procedure has quadratic convergence l and the accuracy which can be achieved depends on the choice of the starting value and on the number of iterations.

In order to obtain the machine accuracy of 36 bits in reciprocation and in the square root l it was required that the necessary accuracy is to be obtained in three iterations.

HECIPROCA TION

To obtain the reciprocal of a floating point number A, Newton's method is used to solve the equation:

F (X)

=

1/X - A

=

0

The first step is to find the initial approximation X o-

This is done via a table lookup from a ROM. Recall that the internal representation of A is as (E . m)1 where E is the exponent (base 2) and m is the normalized mantissa 1/2 .:: m

<

1.

11

12

Thus"

1/A

=

2-E

*

11m and reciprocation is reduced to the computation of 11m in the interval (1/2" 1). The function 11m in the interval (112" 1) is shown below:

11m

I

## ---,--

I

### I

I

I

- - - 1 - - -

I

I

I

I

I

I

I

I

~O~-------1~/-2------~--m l/25 m< 1

2

~

The range of the function of 11m in the interval (1/2" 1) is (2" 1). Since it is required that division and the square root operations be accurate to 36 bits within three iterations, the starting value for the Newton-Raphson iteration has to be at least five bits" assuming quadratic convergence. However" since the slope of the curve is not constant" one has also to consider the maximum slope of the curve.

The maximum slope of 11m is - 11m2 . At m

=

1/2" the slope is -4. Therefore" an additional two bits are required to achieve the required accuracy in the neighborhood of m

=

1/2. For practical reasons" a ROM of eight bits is used" which corresponds to a table of 256 entries.

When

Xo has been determined from ROM"

Xl and

X

2 are formed using the recursion:

X

=

X

>:<

(2 -A n+1 n

*

X ). n

To get the iteration started" seven bits are taken from ROM. The first iteration is accurate to 13(14) bits" the second iteration yields 25(26) bits. These 25 bits are truncated to 19 bits; the last iteration results in 38 bits. The last two bits are used as guard bits. In the present application" the algorithm approaches the true value always from below" and hence" the rounding is not unbiased. The rounding error is less or equal to 2- 36 . If A

=

0" the result is undefined; if A

<

2-

1023

" the overflow flag is set.

Double precision reciprocation requires an additional Newton-Raphson iteration.

All operations are executed in double precision. The double precision reciprocation is accurate to 70 bits. f1

!

1

BSP

-------~~------~-----~~-

- -BURROUGHS SCIENTI Fie PROCESSOR

DIVISION

If A and B are single precision floating point numbers~

AlB is found in two steps:

1.

liB

is found by reciprocation

2. R

=

A

*

(liB).

The maximum error in floating point division is: where:

IE11.:: 2-

36 and

IE1 + El ,

<

2

*

2-

36

.

If A and B are double precision floating point numbers~

AlB is found in two steps:

1.

## liB

is found by reciprocation

2. R

=

A

*

## (liB).

Double precision division is accurate to 70 bits.

SQUARE ROOT

If

A is a single precision floating point number~ the reciprocal square root

## 1/JA

is found by solving the equation:

F(X)

=

1

Ix -

A

= o.

The representation of A is 2E

If the

* m.

=

* m

=

*

## l/~

E.t is

### odd~

2E is multiplied by two to make it even. The mantissa is multiplied by 1/2. The range of the mantissa is thus changed to 1/4 .:: m

<

1.

As in

### division~

the first iteration for XO.t iterations are obtained by solving:

## 1/rm,

is read from a ROM. Subsequent

:::

X n

*

(3-X

2

* ...

Ll ..

),'2 •

13

14

~~p ~~~~~~~~~~~~~~~~~~~~~BURROUGHSSCIENTIFICPROCESSOR

Seven bits suffice to start the iteration. The first iteration yields 13(14) bits, the second iteration generates 25(26) bits which are truncated to 19.

In the last step, 38 bits are generated: 36 bits plus 2 bits for rounding. The rounding is biased, because the true value of 1/& is approached from below. The error in the reciprocal square root is estimated as E 1 ;: 2

*

2 - 36. The square root itself requires an additional multiplication. The total error in the square root is, therefore, E

### <

2

':<

2 - 36.

The double precision reciprocal square root requires an additional iteration. In the last iteration, all operations are executed in double precision.

The square root of a single precision number is found in two steps:

1.

Y;:

l/JA

2. R;: A

*

Y.

To compute the double precision square root, steps 1 and 2 above are done with a double precision reciprocal square root computed first, followed by a double precision multiplication.

{ \

SSP

BURROUGHS SCIENTIFIC PROCESSOR

6. ROUNDING AND NORMALIZATION

In the control processor" rounding is done after each binary floating point operation as well as after reciprocation and after reciprocal square root.

In the parallel processor" rounding is done at the conclusion of each binary floating point operation and after reciprocation and reciprocal square roots. This type of rounding applies also to the execution of templates such as triads" tetrads" etc.

The rounding operations correspond to the rounding operations

In a sequential machine although in some instances the sequence of operations may be changed.

ROUNDING - SINGLE PRECISION

The rounding rules in arithmetic operations -- addition" subtraction" multiplication" reciprocation and reciprocal square root are:

1.

If the discarded portion of the binary fraction is less than half of the least significant bit" leave the least significant bit unchanged.

2. If the discarded portion is greater than half of the least significant bit" add one to the least significant bit with full carry propagation.

3. If the discarded portion is exactly half of the least significant bit" set the least significant bit.

The number of bits used for rounding in different operations differs" depending upon the operation. Addition and subtraction use four rounding bits; multiplication uses 18 bits; reciprocation and reciprocal square root use two bits.

15

16

The following examples demonstrate the rounding rules for addition, using a mantissa of four bits and two guard bits. Rounding for the other rounding operations follows the same rules, except that the number of guard bits varies as stated previously.

Example 1a: 1. 0

+

15/16

=

31/16

+

2

1

0

2

* (.

*

1000)

(.1111) after rounding

2

1

*(.1000)

+

21

*

(.0111) 1

21

*

(.1111) 1

21

*

(.1111)

Example 1b: 9/8

+

11/16

=

29/16

21

0

+

2

* (.

1001)}

* (.

1011)

= after rounding

21

* (.

1001)

+

21

21

* (.

0101) 1

*

(.1110) 1

21

*

(.1111)

Example 2: 3/16

+

15/16

=

45/16

2 1

+

2

0

* (.

*

1111)}

(.1111) after rounding

21 * (.1111)

+

21

* (.

0111) 1

21

*(1.

0110) 1

22 * (.1011) 01

22

*

(.1011)

Example 3: 40/16

+

15/16

=

55/16

22

+

2

0

* (.

*

1010)

(.1111)

= after rounding

2

2

+

22

* (.

1010)

*

(.0011) 11

22

22

*

(.1101) 11

*

(.1110)

I I

B S P - -

----~----------------~-~------

BUR ROUGHS SCI ENTI F Ie PROCESSOR

ROUNDING - DOUBLE PRECISION

Double precision operations are not rounded: there are no guard bits.

NORMALIZA TION

All real numbers are stored in normalized form, that is, the leading bit of the mantissa is always a one.

1/2

~ mantissa

<

1

In double precision, both words are normalized.

17

BSP

BURROUGHS SCIENTIFIC PROCESSOR

APPENDIX A

ARITHMETIC OPERATIONS

Instruction

Single Precision, Floating Point Family

Subtract

Multiply

Reciprocate

Divide

Reciprocal Square Root

Square Root

Square

Extract Exponent

Ins ert Exponent

Binary Scale to Left

Binary Scale to Right

Normalize

Truncated Subtract

Truncated Multiply

Maximum

Minimum

Absolute Maximum

Absolute Minimum

Mnemonic

SUB

MUL

RECIP

DIV

SQRTR

SQRT

SQR

EXTX

INSX

BSCL

BSCR

NORM

TSUB

TMUL

MAX

MIN

AMAX

AMIN

Time in Clocks

10

12

2

2

6

8

2

2

2

2

2*

2*

2*

2

2

2

2

2

2*

2*

*These operations can be preformed in one clock if they are incorporated in the appropriate template.

19

~~p ~~~~~~~~~~~~~~~~~~~~BURROUGHSSCIENTIFICPROCESSOR

20

Instruction

Extended Precision Family

Mnemonic

(Single Precision Operand, Double Precision

Resul~)

Extended Subtract

Extended Multiply

ESUB

EMUL

Double Precision Family

Double Precision Subtract

DPSUB

Double Precision Multiply

DPMUL

Double Precision Reciprocate

DPREC

Double Precision Divide

DPDIV

Double Precision Reciprocal Square Root

DPSQRR

Double Precision Square Root

DPSQR

Double Precision Round to Single Precision

SNGL

Time in Clocks

5

5

4

8

8

11

16

27

21

32

2

Integer Family

Float Integer

Integer Subtract

Integer Multiply

Integer Divide

ISUB

IMUL

IDIV

3

15

2*

2*

2*

Type Transfer Operations

Integer with Truncation

Integer with Rounding

Integer with Floor

Integer with Ceiling

Integer to Floating Point

Normalize

Double Precision to Single Precision

FIXT

FIXR

FIXF

FIXC

FLOAT

NORM

SNGL

2*

2*

2

2

2*

2*

2

*These operations can be performed in one clock if they are incorporated in the appropriate template.

B

## S

p----.--~---~---------~--------------------------------

BUR R 0 U G HS SC I F NT I F I CPR OCESSO R

Cycle Operations

1.

2.

A ±B-R

G

NORM (RG)-Z

Single Precision

(Round)

MULTIPLY

1. A

*

LSH(B) - P P

2. A

*

MSH(B)

+

P P - Z

Single Precision

LSH(B) = Least Significant Half (B)

MSH(B)

=

Most Significant Half (A)

RECIP (A)

1.

2 - (A

*

PROM (A) ) P 1

2.

3.

4.

5.

6.

P

1

*

PROM (A)-R

1

2- (A

*

R ) - P

1 2

P 2

*

R1 - R

2

2-

(A *R-)-P

~'

- 3

P

3

*

R - Z

2

Single Precision

Table look-up (7 bits)

(Round)

DIV

1-6. RECIP (B)-C

7-8.

A MULT B -

Z

Single Precision

(Round)

(Round)

SQRTR (A)

1.

2.

3.

4.

A shift if expo odd A 1

A

1

*

PROM (A

1

) P 1

3-P

1

*

PROM (A 1) _ P

2

P 2

*

PROM (A 1) R1

Single Precision

21

22

5.

6.

A

1

*

R 1 -

P 3

3-P

3

*

R

1

- P

4

7.

8.

P 4

*

R1 - - R 2

A

1

*

R 2

P

5

9.

10.

3-P 5

*

R2 -

P

6

P 6

*

R2

-

Z

DPSQRR

1-10.

11.

Double Precision Reciprocal Square Root

SQRTR(A

1

) B1

&

A1 shift if exp odd

## -A~

A1 + A2 - A

1 1

2

(A

2 has A1 exponent)

12.

A1_A1

2 2

13.

14-16.

A1

2 shift if exp odd - A ; 1

B1

*

(A~

+ A;l)

17.

18-20.

- C

1

+ C

2

3-B

1

*

(C + C )

1 2

21.

22 -24.

25.

B1

*

(D

1

+ D

2

)

-

Zl + E2

26.

- D +D

1 2

Zl -output

27.

NORM (E

2

) - Z

2 n

I

BSP

DPMUL Double Precision MULT

2. - D +D

1 2

3. A * B

1 2

4.

- E

1G

5. A

*B

2 1

6.

- F

1G

7.

F 1G + E 1GG 1G

8.

G

1G

+ D

2

_ H

1G

9.

H

1G

+ D

1

- Z

1

+ F 2

10.

H

1G

+ D1 - Z 1 + C

2

11.

NORM(C

2

) Z2

BURROUGHS SCIENTIFIC PROCESSOR

23

24

~~p ~~~~~~~~~~~~~~~~~~~~BURROUGHSSCIENTIFICPROCESSOR

DPREC Double Precision Reciprocation

(No Rounding)

7.

A2

*

B1

8.

9.

10.

11.

12.

13.

14.

15.

2-A

1

*

B

1

- C

1G

- D

1

+D

2

-C

1G

+ D

2

- E

1G

E

1G

*

B1

- F

1G

B1

+

F

1G

- Z

1

+

B2

B1

+

F

1G

- Z

1

+

B2

16. NORM(B

2

) - Z 2

SQRT (A)

Single Precision

1-10. SQRTR(A)-C

11-12. C MULT A-Z

I

1

BSP

-------~-

BURROUGHS SCIENTI FIC PROCESSOR

1. A ± B - P

1

+R

1

2. NORM(P

1

) - P

3

3.

P

3

+R

1

- Z

1

+P

4

4. P

3

+R

1

- Z

1

+P

4

5.

NORM(P 4)-Z2

EMUL Extended Multiply

1.

A

*

LSH(B)-PP

2.

A

*

MSH(B) + PP-Z1 + P

2

3.

Z 1 - Z 1

4. NORM(P

2

)-Z2

2.

A1 ± B

1

- D

1

+ D2

2.

± B2 + D

2

- E

1G

3. E

1G

+A

2

_ F

1G

4.

F 1G + D

1

_G

1

+ G

2

5.

NORM(G

1

) - P

1

6. P

1

J.

+ G...,-C

G

1

J.

+ C...,

G

7.

NORM(C

1

)-Z1

8. NORM(C

2

)_Z2

25

BSP - - - - - - - - - -

BURROUGHS SCIENTIFIC PROCESSOR

APPENDIX B

ERROR ESTIMATES FOR ARITHMETIC OPERATIONS

Mul tiplication

Reciprocation

Division

Reciprocal Square Root

Square Root

Floating Point

Operation Single Precision Double Precision

A±B

A*B l/A

B/A

A/A

(A

B) (1

+

E 1 )

(A ± B) (1

+

4E

2

)

(A

*

B)

(1

+

E 1 )

(A

*

B) (1

+

4E

2

) l/A

(1

+

E

1

)

l/A

(1

+

4E

2

)

B/A

(1

+

E

1

) ( 1

+

E

1

) l/A (1

+

4E

2

) (1

+

4E

2

)

1

/./A

(1

+

E 1 )

### 1/.,fA

(1

+

4E

2

)

A/vA. (1

+

E 1)

(1

+

E 1 )

A

/JA

(1

+

4E

2

)

(1

+

4E

2

) where:

I

E

1

1\

~ or sing e preCiSion instructions,

I

E21.::

2 -72 f bl . . .

27

I i

I