618
Floating-point Math Instructions Section 3-15
Operand Specifications
Description COSQ(476) calculates the cosine of the angle (in radians) expressed as a 32-
bit floating-point value in S+1 and S and places the result in R+1 and R.
(The floating point source data must be in IEEE754 format.)
Specify the desired angle (–65,535 to 65,535) in radians in S+1 and S. If the
angle is outside of the range –65,535 to 65,535, an unpredictable value will be
output, but the Error Flag will not be turned ON. For information on converting
between degrees and radians, see
3-15-9 DEGREES TO RADIANS:
RAD(458)
and 3-15-10 RADIANS TO DEGREES: DEG(459).
The following diagram shows the relationship between the angle and result.
Area S R
CIO Area CIO 0000 to CIO 6142
Work Area W000 to W510
Holding Bit Area H000 to H510
Auxiliary Bit Area A000 to A958 A448 to A958
Timer Area T0000 to T4094
Counter Area C0000 to C4094
DM Area D00000 to D32766
EM Area without bank E00000 to E32766
EM Area with bank En_00000 to En_32766
(n = 0 to C)
Indirect DM/EM
addresses in binary
@ D00000 to @ D32767
@ E00000 to @ E32767
@ En_00000 to @ En_32767
(n = 0 to C)
Indirect DM/EM
addresses in BCD
*D00000 to *D32767
*E00000 to *E32767
*En_00000 to *En_32767
(n = 0 to C)
Constants Can be specified. ---
Data Registers ---
Index Registers ---
Indirect addressing
using Index Registers
,IR0 to ,IR15
–2048 to +2047 ,IR0 to –2048 to +2047 ,IR15
DR0 to DR15, IR0 to IR15
,IR0+(++) to ,IR15+(++)
,–(– –)IR0 to, –(– –)IR15
R+1 R
S
S+1
COS
Source (32-bit floating-point data)
Result (32-bit floating-point data)
3
2
Ï€
2
Ï€
2
3
2
ππ
−2 π
−π
0
−1
1
π 2 π
S
D
S: Angle (radian) data
R: Result (cosine)
−
−