Siemens 500 NIM Benutzerhandbuch

Seite von 138
 
Floating Point Numbers
B-3
SIMATIC TIWAY I Series 500 NIM User Manual
B.2
IBM Format
Floating point numbers are stored in memory in two 16-bit words as
illustrated in Figure B-1.  Before being stored in memory, however, the
number is converted to a normalized hexadecimal fraction, a corresponding
hexadecimal exponent, and a sign bit.
The fraction portion of the IBM number is normalized; that is, it is shifted
to the left to eliminate leading zeros between the radix point and the first
signficant bit. Each bit position shift in the normalization process produces
a corresponding change in the exponent portion of the number which
maintains the correct magnitude of the number.  When the number is
completely normalized, the IBM hexadecimal fraction is stored in bits 8
through 15 of the first memory word, and in all 16 bits of the second
memory word. The radix point for the fraction is assumed to be positioned
between bits 7 and 8 of the first memory word (at the start of the
hexadecimal fraction).
The exponent portion of the number is biased by 40
  (excess 64 notation),
so that the exponent for 16
  is represented in memory by 40.  Positive
exponents are represented by numbers greater than 40
, and negative
exponents are represented by numbers less than 40
.  For example, 16  is
represented in the exponent field by the value 41
.  The exponents may be
any value from 00
  to 7F; including the 40  bias value, these
numbers represent exponent values from –40
  to +3F  (16   to 16 ).
The seven exponent bits are stored in bits 1 through 7 of the first memory
word.
Bit 0 of the first memory word is used for a sign bit.  When this bit is zero,
the number is positive. When this bit is one, the number is negative.