17.03.2014 Views

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>DVP</strong>-<strong>ES2</strong>/<strong>EX2</strong>/<strong>SS2</strong>/<strong>SA2</strong>/<strong>SX2</strong>/SE <strong>Operation</strong> <strong>Manual</strong> - Programming<br />

API Mnemonic Operands Function<br />

123 D EDIV P Floating point division<br />

Controllers<br />

<strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SA2</strong><br />

SE<br />

<strong>SX2</strong><br />

Type<br />

Bit Devices Word devices Program Steps<br />

OP X Y M S K H KnX KnY KnM KnS T C D E F<br />

S 1 * * *<br />

S 2 * * *<br />

D *<br />

Operands:<br />

S 1 : Dividend S 2 : Divisor D: Quotient and Remainder<br />

Explanation:<br />

DEADD, DEADDP: 13<br />

steps<br />

PULSE 16-bit 32-bit<br />

<strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SA2</strong><br />

<strong>SA2</strong><br />

<strong>SA2</strong><br />

<strong>SX2</strong> <strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SX2</strong> <strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong><br />

SE SE SE <strong>SX2</strong><br />

1. S 1 ÷ S 2 = D. The floating point value in S 1 is divided by the floating point value in S 2 and the<br />

result is stored in D. The division is conducted in binary floating point format.<br />

2. If S 1 or S 2 is designated as constant K or H, the instruction will convert the constant into a<br />

binary floating point value before the operation.<br />

3. If S 2 = 0, operation error will occur, the instruction will not be executed<br />

4. Flags: M1020 (Zero flag), M1021 (Borrow flag) and M1022 (Carry flag)<br />

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

If absolute value of the result is less than min. floating point value, borrow flag M1021 = ON.<br />

If the conversion result is 0, zero flag M1020 = ON.<br />

Program Example 1:<br />

When X1 = ON, binary floating point value of (D1, D0) is divided by binary floating point (D11, D10)<br />

and the quotient and remainder is stored in (D21, D20).<br />

X1<br />

DEDIV D0 D10 D20<br />

Program Example 2:<br />

When X2 = ON, binary floating point value of (D1, D0) is divided by K1234 (automatically converted<br />

to binary floating point value) and the result is stored in (D11, D10).<br />

X2<br />

DEDIV D0 K1234 D10<br />

3-306

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!