147
4
4 Instructions 4.4.5 Exponent Operations
Example:
X2
ǒSQR D0 D12 Ǔ
D0
D12
If D0 = K100, then D12 = K10 when X2 = ON.
If D0 = K110, then D12 = K10 when X2 = ON and the fractional part is discarded.
POW: Floating-point weight instruction
◆
Overview
The POW instruction performs a mathematical operation where the binary oating-point number in [S1+1,
S1] is raised to the exponent in [S2+1, S2]. The result is stored in [D+1, D].
POW S1 S2 D
Floating-
point weight
instruction
Applicable model:
H3U
S1 Base
Head address of elements that store the base, which
must be a non-zero number
32-bit instruction
(13 steps)
DPOW: Continuous
execution
DPOWP: Pulse
execution
S2 Exponent Head address of elements that store the exponent
D Result
Head address of elements that store the operation
result
◆
Operands
Operand
Bit Element Word Element
System·User System·User Bit Designation Indexed Address Constant
Real
Number
S1 X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
S2 X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
D X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
Note: The elements in gray background are supported.
◆
Function
As the POW instruction uses only the oating-point number format, the values in [S1] and [S2] must be
converted to oating-point numbers.
For example, assume that [S1] = 2 and [S2] = 3, then [D] = 2
3
= 8.
1. The carry ag M8022 is set to ON if the absolute value of the operation result is greater than the
maximum oating-point value.
2. The borrow ag M8021 is set to ON if the absolute value of the operation result is less than the minimum
oating-point value.
3. The zero ag M8020 is set to ON if the operation result is 0.
◆
Application