519
3. Instructions
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Double-precision Floating-point Instructions
3
Double-precision Floating-point Instructions
îš„ Ladder Program for the Single-precision Calculation
1. This program section converts the BCD data to single-
precision floating-point data (32 bits, IEEE754-for-
mat).
• The BIN(023) instructions convert the BCD data to
binary and the FLT(452) instructions convert the
binary data to single-precision floating-point data.
• The floating-point data for the angle θ is output to
D200 and D201.
• RAD(458) converts the angle data in D200 and
D201 to radians.
• The floating-point data for the radius r is output to
D1200 and D1201.
2. This program section calculates the sin θ and the cos
θ as single-precision floating-point values.
• The value for cos θ is output to D300 and D301.
• The value for sin θ is output to D400 and D401.
3. This program section calculates x (r × cos θ) and y (r ×
sin θ).
• The value for x (r × cos θ) is output to D10000 and
D10001.
• The value for y (r × sin θ) is output to D20000 and
D20001.
0.00
1.
2.
3.
BIN
D0
D100
BIN
D1000
D1000
SIN
D200
D400
COS
D200
D300
END
*F
D1200
D300
D10000
*F
D1200
D400
D20000
FLT
D100
D200
FLT
D1000
D1200
RAD
D200
D200
Coordinate Floating-point number Real number
x 4116 59CF 3.4202015399933
y 405A E495 9.3969259262085