Omron SYSMAC CP Series Instruction & Reference Manual page 266

Cpu unit
Hide thumbs Also See for SYSMAC CP Series:
Table of Contents

Advertisement

2 Instructions
Writing Floating-point Data
When floating-point is specified for the data format in the I/O memory edit display in the CX-Program-
mer, standard decimal numbers input in the display are automatically converted to the floating-point for-
mat shown above (IEEE754-format) and written to I/O Memory. Data written in the IEEE754-format is
automatically converted to standard decimal format when monitored on the display.
It is not necessary for the user to be aware of the IEEE754 data format when reading and writing float-
ing-point data. It is only necessary to remember that floating point values occupy two words each.
Numbers Expressed as Floating-point Values
The following types of floating-point numbers can be used.
Mantissa (f)
0
Not 0
Note A non-normalized number is one whose absolute value is too small to be expressed as a normalized num-
ber. Non-normalized numbers have fewer significant digits. If the result of calculations is a non-normalized
number (including intermediate results), the number of significant digits will be reduced.
(1) Normalized Numbers
Normalized numbers express real numbers. The sign bit will be 0 for a positive number and 1 for a neg-
ative 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
is 1 and the binary point follows immediately after it.
Normalized numbers are expressed as follows:
× 2
(–1)
(sign s)
(exponent e)–127
Example
Sign:
Exponent:
Mantissa:
Value:
2-230
15
n
n+1 s
e
0
0
Non-normalized number
× (1 + mantissa × 2
31 30
23 22
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
128 – 127 = 1
) × 2
1 + (2
22
+ 2
21
–23
= 1 + (2
–1.75 × 2
1
= –3.5
7
6
0
f
Exponent (e)
Not 0 and not all 1's
Normalized number
33
– 1, and it is assume that, in the real mantissa, bit 2
–23
)
1
+ 2
2
) = 1 + 0.75 = 1.75
CP1E CPU Unit Instructions Reference Manual(W483)
All 1's (255)
Infinity
NaN
0
33

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents