349
Floating-point Math Instructions
Section 5-24
Numbers Expressed as Floating-point Values
The following types of floating-point numbers can be used.
Note
A non-normal number is one whose absolute value is too small to be
expressed as a normal number. Non-normal numbers have fewer significant
digits. If the result of calculations is a non-normal number (including interme-
diate results), the number of significant digits will be reduced.
Normal Numbers
Normal numbers express real numbers. The sign bit will be 0 for a positive
number and 1 for a negative number.
The exponent (e) will be expressed from 1 to 254, and the real exponent will
be 127 less, i.e., –126 to 127.
The mantissa (f) will be expressed from 0 to 2
33
– 1, and it is assume that, in
the real mantissa, bit 2
33
is 1 and the binary point follows immediately after it.
Normal numbers are expressed as follows:
(–1)
(sign s)
x 2
(exponent e)–127
x (1 + mantissa x 2
–23
)
Example
Sign:
–
Exponent:
128 – 127 = 1
Mantissa:
1 + (2
22
+ 2
21
) x 2
–23
= 1 + (2
–1
+ 2
–2
) = 1 + 0.75 = 1.75
Value:
–1.75 x 2
1
= –3.5
Non-normal Numbers
Non-normal numbers express real numbers with very small absolute values.
The sign bit will be 0 for a positive number and 1 for a negative number.
The exponent (e) will be 0, and the real exponent will be –126.
The mantissa (f) will be expressed from 1 to 2
33
– 1, and it is assume that, in
the real mantissa, bit 2
33
is 0 and the binary point follows immediately after it.
Non-normal numbers are expressed as follows:
(–1)
(sign s)
x 2
–126
x (mantissa x 2
–23
)
Example
Sign:
–
Exponent:
–126
Mantissa:
0 + (2
22
+ 2
21
) x 2
–23
= 0 + (2
–1
+ 2
–2
) = 0 + 0.75 = 0.75
Value:
–0.75 x 2
–126
Zero
Values of +0.0 and –0.0 can be expressed by setting the sign to 0 for positive
or 1 for negative. The exponent and mantissa will both be 0. Both +0.0 and –
0.0 are equivalent to 0.0. Refer to
Floating-point Arithmetic Results
, below, for
differences produced by the sign of 0.0.
Infinity
Values of +
∞
and –
∞
can be expressed by setting the sign to 0 for positive or 1
for negative. The exponent will be 255 (2
8
– 1) and the mantissa will be 0.
Mantissa (f)
Exponent (e)
0
Not 0 and
not all 1’s
All 1’s (255)
0
0
Normal number
Infinity
Not 0
Non-normal
number
NaN
1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
31 30
23 22
0
0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
3130
23 22
0
Содержание SYSMAC CQM1H Series
Страница 3: ...iv...
Страница 5: ...vi...
Страница 9: ......
Страница 11: ......
Страница 15: ...xvi...
Страница 87: ...62 Calculating with Signed Binary Data Section 1 7...
Страница 169: ...144 Serial Communications Board Section 2 6...
Страница 537: ......
Страница 565: ......
Страница 569: ......
Страница 573: ......
Страница 577: ......