Specifications
10. Additional Special Devices and Instructions
10-5
Only the positive value of the content of
S
is valid. Be sure to use
32-bit data format to assign the
D
register. Because using the
floating point format to perform the LN operation is necessary,
S
has to be converted to the floating point value.
e
D
=S => content value of D operand= lnS ; S is the assigned source
data.
(Zero flag, Carry flag, Overflow flag are valid and Error flag M1067,
M1068 read D1067, D1068)
Program example:
M0
RST M1081
M1
DLN D10 D20
M2
DEBCD D20 D30
DFLT D0 D10
Ϩʳ When M0 is ON, the data of (D0, D1) is converted to decimal of binary
number system and the result is stored in the (D10, D11) register.
Ϩʳ When M1 is ON, use (D10, D11) as real number to perform the LN
operation. The result is decimal of binary number system and will be
stored in the (D20, D21) register.
Ϩʳ When M2 is ON, the data of (D20, D21) is converted from binary to
decimal and the result is stored in (D30, D31) register. (At that time, the
result=D30 x 10
D31
)
D
126 LOG
S1 S2 D
Convert decimal of
binary number system
to perform logarithm
operation
Bit device Word device
Device
Operand
X Y M S K H KnX KnY KnM KnS T C D E F
S1
Ϩ
S2
Ϩ
D
Ϩ
S1
: the base device for operation
S2
: the source device for operation
D
: operation result device
Use the content of
S1
and
S2
as operand to perform the LOG
operation and store the operation result in
D
device.
Only the positive value of the content of
S2
is valid (The positive and
negative values of cont ent of
S1
are all valid). Be sure to use 32-bit
data format to assign the
D
register. Because using the floating
point format to perform the LOG operation is necessary,
S1
and
S2
have to be converted to the floating point value.
S1
D
=S2, obtain the value of D=>Log
S1
S2
=D
When knowing S1=5,S2=125, obtain D=log
5
125
=?
S1
D
=S2=>5
D
=125=>D=log
5
125
=3
(Zero flag, Carry flag, Overflow flag are valid and Error flag M1067,
M1068 read D1067, D1068)