Mitsubishi Electronics FX2C Home Theater Server User Manual


 
FX Series Programmable Controllers Devices in Detail 4
4-48
4.15.2 Floating Point Format
Floatin
g
point format extends the abilities and ran
g
es provided b
y
Scientific Notation with the
abilit
y
to represent fractional portions of whole numbers, for example;
Performin
g
and displa
y
in
g
the calculation of 22 divided b
y
7 would
y
ield the followin
g
results:
a) Normal FX operation usin
g
decimal (inte
g
ers) numbers would equal 3 remainder 1
b) In floatin
g
point it would equal 3.14285 (approximatel
y
)
c) In Scientific format this calculation would be equal to 3142 10
-3
So it can be seen that a
g
reater de
g
ree of accurac
y
is provided b
y
floatin
g
point numbers, i.e.
throu
g
h the use of lar
g
er numerical ran
g
es and the availabilit
y
of more calculable di
g
its.
Hence, calculations usin
g
floatin
g
point data have some si
g
nificant advanta
g
es. Decimal data
can be converted in to floatin
g
point b
y
usin
g
the FLT, float instruction (FNC 49). When this
same instruction is used with the float fa
g
M8023 set ON, floatin
g
point numbers can be
converted back to decimal. see pa
g
e 5-49 for more details.
The followin
g
points should be remembered about the use of Floatin
g
Point within appropriate
FX units;
Floatin
g
point numbers, no matter what numerical value, will alwa
y
s occup
y
two consecu-
tive data re
g
isters (or 32 bits).
Floatin
g
point values cannot be directl
y
monitored, as the
y
are stored in a special format
recommended b
y
the I.E.E.E (Institute of Electrical and Electronic En
g
ineers) for personal
and micro computer applications.
Floatin
g
point numbers have both mantissa and exponents (see Scientific Notation for an
explanation of these terms). In the case of floatin
g
point exponents, onl
y
8 bits are used.
Additionall
y
there is a sin
g
le si
g
n bit
for the mantissa. The remainin
g
bits
of the 32 bit value, i.e. 23 bits, are
used to ‘describe’ the mantissa
value.
Valid ran
g
es for floatin
g
point numbers as used in FX Main Processin
g
Units:
Description Sign
Exponent
(bit pattern)
Mantissa
(bit pattern)
Remark
Normal Float
0 or 1
11111110
00000001
11111111111111111111111
11111111111111111111110
00000000000000000000001
00000000000000000000000
Lar
g
est number +/- 3.403 10
38
Accurac
y
: 7 si
g
nificant fi
g
ures
Smallest number +/- 1.175
10
-38
Zero
0 or 1
00000000 00000000000000000000000 All di
g
its are 0 (zero)
b15 b0
Data re
g
ister 'D+1'
(16 bits)
b15 b0
Data re
g
ister 'D'
(16 bits)
Si
g
n bit
Exponet
(8 bits)
Mantissa
(23 bits)
FX Data Re
g
ister Contruction
Floatin
g
Point Format