107
4
4 Instructions 4.4.1 Four Arithmetic Operations
S1 S2
DD
ˇ1
/
=
Sign bit Sign bit Sign bit
b15b15
b15
b0
b0 b0
16-bit
division
b0
Dividend
Divider
Quotient Remainder
Sign bit
b15
S1
/
=
b31
b31b31
b0
b0
S1
+1
S2
S2
+1
D
D D D
+3
+2+1
b0
b0 b31
Sign bit Sign bit Sign bit
32-bit
division
Dividend
Divider
Quotient Remainder
Sign bit
Example:
Ladder chart
Instruction list
M8
ǒDIV D100 D110 D120Ǔ
LD M8
DIV D100 D110 D120
When M8 is set, D100 (dividend) is divided by D110 (divider). The quotient is stored in D120.
If D100 = K5 and D110 = K2, the remainder is stored in D121 (= K1).
EADD: Binary oating point addition
◆
Overview
The EADD instruction adds two binary oating-point numbers together.
EADD S1 S2 D
Binary floating
point addition
Applicable model:
H3U
S1 Augend Augend of a binary oating point addition 32-bit instruction
(13 steps)
DEADD: Continuous
execution
DEADDP: Pulse
execution
S2 Addend Addend of a binary oating point addition
D1 Sum Unit that stores the sum of S1 and S2
◆
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
D1 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
Two binary oating-point numbers are added together.
●
S1 and S2 are respectively the augend and addend in a binary oating point addition.
●
D is the unit that stores the sum of S1 and S2.
●
If the constant K or H is used as the operand S1 or S2, the value is converted to a binary oating-point
number before the addition operation.
The zero ag M8020 is set if the result of the calculation is 0.