EasyManua.ls Logo

Omron CP - PROGRAMMING MANUAL 05-2007 - Page 507

Omron CP - PROGRAMMING MANUAL 05-2007
1175 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
474
Floating-point Math Instructions Section 3-14
Writing Floating-point
Data
When floating-point is specified for the data format in the I/O memory edit dis-
play in the CX-Programmer, standard decimal numbers input in the display
are automatically converted to the floating-point format shown above
(IEEE754-format) and written to I/O Memory. Data written in the IEEE754-for-
mat 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 floating-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.
Note A non-normalized number is one whose absolute value is too small to be
expressed as a normalized number. Non-normalized numbers have fewer sig-
nificant digits. If the result of calculations is a non-normalized number (includ-
ing intermediate results), the number of significant digits will be reduced.
Normalized Numbers Normalized 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.
Normalized 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-normalized Numbers Non-normalized numbers express real numbers with very small absolute val-
ues. 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-normalized numbers are expressed as follows:
(–1)
(sign s)
x 2
–126
x (mantissa x 2
–23
)
15
n+1
n
7
f
se
60
Mantissa (f) Exponent (e)
0 Not 0 and
not all 1’s
All 1’s (255)
0 0 Normalized number Infinity
Not 0 Non-normalized
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

Table of Contents

Related product manuals