2-223

2 Instructions
CP1E CPU Unit Instructions Reference Manual(W483)

Special Math Instructions

2

APR

Sample program
Sine Function (C: #0000)

The following example shows APR(069) used to calculate the sine of 30°.

(SIN(30) = 0.5000)

Cosine Function (C: #0001)

The following example shows APR(069) used to calculate the cosine of 30°.

(COS(30) = 0.8660)

Floating-point DataLinear Extrapolation (C: Word Address)

Using 16-bit Unsigned BCD or Binary Data

APR(069) processes the input data speci-

fied in S based on the control data in C and

the line-segment data specified in the table

beginning at C+1. The result is output to D.

NoteIf the “Floating-point specification” in bit 09 of C is set to 1, a constant
cannot be input for S.
Setting name Bit in C Setting
Input data (S) format 15 0
Output data (D) format 14 0
Source data form 13 0
Signed data specification for S
and D 11 0
Data length specification for S
and D 10 0
Floating-point specification 09 1: Floating-point data
S: D0 R: D100
0 ×101×100×10–1 ×10–1 ×10–2 ×10–3 ×10–4
0300 5000
APR
#0000
D000
D100
0.00 Source data Result
Set the source data in ×10–1
degrees.
(0000 to 0900, BCD)
Result data has four significant digits,
fifth and higher digits are ignored.
(0000 to 9999, BCD)
Source data Result
Set the source data in ×10–1 degrees.
(0000 to 0900, BCD)
Result data has four significant digits,
fifth and higher digits are ignored.
(0000 to 9999, BCD)
APR
#0001
D010
D200
0.00 S: D10 R: D100
0 ×101×100×10–1 ×10–1 ×10–2 ×10–3 ×10–4
0300 8660
Ym
Y4
Y3
Y1
Y2
Y0
X0 X1 X2 X3 X4 Xm
X
Y