109
4
4 Instructions 4.4.1 Four Arithmetic Operations
The zero ag M8020 is set if the result of the calculation is 0.
The carry ag M8022 is set if the absolute value of the calculation result is greater than the maximum
oating-point value.
The borrow ag M8021 is set if the absolute value of the calculation result is less than the minimum
oating-point value.
Example:
〔DESUB D2 D4 D10〕
X10
DS1 S2
〔DESUBP D10 K123 D10〕
X11
When X10 = ON, the difference between two binary oating-point numbers in (D3, D2) and (D5, D4) is
stored in (D11, D10).
When X11 switches from OFF to ON, the oating-point number in (D11, D10) is decremented by 123. The
constant K123 is changed to a binary oating-point number before the subtraction operation.
If the unit that stores the difference is the same as the subtrahend or minuend storage unit, use the
DESUBP instruction of the pulse execution type. If the continuous execution type is used, calculation is
performed upon every program scan.
EMUL: Binary oating point multiplication
◆
Overview
The EMUL instruction multiplies two binary oating-point numbers together.
EMUL S1 S2 D
Binary
oating point
multiplication
Applicable model:
H3U
S1 Multiplicand Multiplicand of a binary oating point multiplication 32-bit instruction
(13 steps)
DEMUL: Continuous
execution
DEMULP: Pulse
execution
S2 Multiplier Multiplier of a binary oating point multiplication
D Product
Unit that stores the product of a binary oating point
multiplication
◆
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.