DVP - ES2/EX2/SS2/SA2/SX2/SE Operation Manual - Programming

API

Mnemonic

Operands

Function

Controllers

123

D

EDIV

P

 

 

Floating point division

 

ES2/EX2

SS2 SA2 SX2

 

 

 

 

 

SE

 

Type

Bit Devices

 

Word devices

 

 

 

 

 

Program Steps

 

OP

 

X

Y

M

S

K

H KnX KnY KnM KnS T

C

D

E

F

DEADD, DEADDP: 13

S1

 

 

 

 

 

*

*

 

*

 

 

steps

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S2

 

 

 

 

 

*

*

 

*

 

 

 

 

 

 

D

 

 

 

 

 

 

 

 

*

 

 

 

 

 

 

 

 

 

 

 

 

 

PULSE

 

 

16-bit

 

 

 

32-bit

 

 

 

 

 

 

 

 

SA2

 

 

 

SA2

 

SA2

 

 

 

 

 

 

 

 

ES2/EX2 SS2 SE SX2 ES2/EX2 SS2

SE

 

SX2 ES2/EX2 SS2 SE

SX2

Operands:

S1: Dividend S2: Divisor D: Quotient and Remainder

Explanation:

1.S1 S2 = D. The floating point value in S1 is divided by the floating point value in S2 and the result is stored in D. The division is conducted in binary floating point format.

2.If S1 or S2 is designated as constant K or H, the instruction will convert the constant into a binary floating point value before the operation.

3.If S2 = 0, operation error will occur, the instruction will not be executed

4.Flags: M1020 (Zero flag), M1021 (Borrow flag) and M1022 (Carry flag)

If absolute value of the result exceeds max. floating point value, carry flag M1022 = ON.

If absolute value of the result is less than min. floating point value, borrow flag M1021 = ON. If the conversion result is 0, zero flag M1020 = ON.

Program Example 1:

When X1 = ON, binary floating point value of (D1, D0) is divided by binary floating point (D11, D10) and the quotient and remainder is stored in (D21, D20).

X1

DEDIV D0 D10 D20

Program Example 2:

When X2 = ON, binary floating point value of (D1, D0) is divided by K1234 (automatically converted to binary floating point value) and the result is stored in (D11, D10).

X2

DEDIV D0 K1234 D10

3 - 306

Page 422
Image 422
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Ediv, DEADD, Deaddp