APPENDICES
Appendix 5 Method of replacing High Performance model QCPU with Universal model QCPU
App
- 144
9
P
a
ra
met
e
rs
10
Device
Exp
la
n
at
ion
11
CP
U
M
odu
le
P
ro
cessi
ng
Ti
m
e
12
P
roc
e
d
ure
f
or W
rit
in
g
P
rog
ra
m t
o CP
U Mo
du
le
A
p
pe
nd
ic
e
s
In
de
x
(b) Replacing a part of floating-point operation instructions with double-
precision floating-point operation instructions
Only operations require high accuracy are replaced with double-precision floating-
point operation instructions. Using the ECON and EDCON instructions, convert
floating-point data mutually between single precision and double-precision. The
flow of a replacement program is as follows:
• Data required for operations are converted from single precision to double
precision using the ECON instruction.
• Operations are performed in double precision using the double-precision
floating-point operation instructions.
• Operation results are converted from double precision to single precision
using the EDCON instruction.
A program example that floating-point data are converted mutually between single
precision and double precision before and after operations is shown below.
Example) Replacing the floating-point operation [A B+C] (Using the
ECON and EDCON instructions)
1) Device assignment
2) Program before replacement
TableApp.76 Device assignment
Before replacement
After replacement
Application
Device
Data type
Application
Device
Data type
Data A
D0 to D1
Floating-point
data (single
precision)
Data A
D0 to D1
Floating-point
data (single
precision)
Data B
D2 to D3
Data B
D2 to D3
Data C
D4 to D5
Data C
D4 to D5
Operation
result
D6 to D7
Operation
result
D6 to D7
Data A (D)
D10 to D13
Floating-point
data (double
precision)
Data B (D)
D14 to D17
Data C (D)
D18 to D21
Operation
result (D)
D22 to D25
Figure App.22 Sample program
Содержание Q00CPU
Страница 1: ......
Страница 2: ......
Страница 972: ...Index 6 Memo ...
Страница 975: ......
Страница 976: ......