B.3 ieee format – Siemens 500 NIM User Manual

Page 127

Advertising
background image

Floating Point Numbers

B-5

SIMATIC TIWAY I Series 500 NIM User Manual

B.3

IEEE Format

The exponent portion of the IEEE format is similar to the IBM format
except that it is 8 bits in length and is biased by 7F

16. It is also different in

that it represents a power of 2 instead of 16. The exponent for 2

) is

represented in memory by 7F

16. Negative exponents are represented by

numbers less than 7F

16. For example, a 2–! is represented in the

exponent field by by a value of 7E

16. The exponents may be any value from

–7E

16 to +7F16 (2–!@^ to 2!@&). The eight exponent bits are stored in

bits 1 – 8 of the first memory word. See Figure B-2.

The fraction portion of the IEEE format is similar to the IBM format. It is a
hexadecimal fraction which is interpreted in one of many ways, depending
on the value of the exponent. Table B-1 describes the different types of
conversions for the IEEE format.

Table B-1

IEEE Conversions

Case

A

B

C

D

E

Exponent

FF

FF

00 < e < FF

00

00

16
16

16
16

16

16

Fraction

non-zero

0

any value

non-zero

0

v (IEEE) = decimal value
NaN (regardless of sign bit)

+/-

(-1) * 2 *(1.f)

(-1) * 2 *(0.f)

+/-0 (depending on sign bit)

s
s

(e-127)

-126

Note: s = sign bit; f = fraction; e = exponent

1

Case A is an illegal value. A Not-a-Number (NaN) will never be returned
from the Series 500 NIM. If this example is written to the NIM, an
exception will be returned.

Case B, +/– infinity, is used to represent numbers too large in magnitude to
be represented with the IEEE format.

Case C represents a normalized IEEE floating point value. (There is a one,
not included in f, to the left of the radix point.)

Case D represents a denormalized IEEE floating point (contains a zero to
the left of the radix point).

Case E represents a value of zero. Numbers too small to be represented in
the IEEE format will be reported as a positive or a negative 0.

Advertising