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 />

43 D SUM P Sum of Active bits<br />

Controllers<br />

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

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

Type Bit Devices Word devices Program Steps<br />

OP X Y M S K H KnX KnY KnM KnS T C D E F SUM, DSUMP: 5 steps<br />

S * * * * * * * * * * * DSUM, DSUMP: 9 steps<br />

D * * * * *<br />

PULSE 16-bit 32-bit<br />

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

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

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

<strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <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<br />

SE<br />

SE<br />

Operands:<br />

S: Source device D: Destination device for storing counted value<br />

Explanation:<br />

1. This instruction counts the total active bits in S and store the value in D.<br />

2. D will occupy two registers when using in 32-bit instruction.<br />

3. If operand S, D use index F, only a 16-bit instruction is available.<br />

4. If there is no active bits, zero flag M1020 =ON.<br />

Program Example:<br />

When X20 = ON, all active bits in D0 will be counted and the result will be stored in D2.<br />

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

X20<br />

SUM D0 D2<br />

0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 3<br />

D0<br />

D2<br />

3-108

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

Saved successfully!

Ooh no, something went wrong!