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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3. Instruction Set<br />

API Mnemonic Operands Function<br />

190 MBC P Matrix bit status count<br />

Controllers<br />

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

SE<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 * * * * * * *<br />

n * * *<br />

D * * * * * * * *<br />

MBC, MBCP: 7 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 />

Operands:<br />

S: Matrix source device n: Matrix length (K1~K256) D: <strong>Operation</strong> result<br />

Explanations:<br />

1. MBC instruction counts the number of bit 1 or bit 0 in the matrix with matrix length n and<br />

stores the counted number in D.<br />

2. If operands S or D use KnX, KnY, KnM, KnS format, only n = 4 is applicable.<br />

3. When M1098 = ON, MBC instruction counts the number of bit 1. M1098 = OFF, MBC counts<br />

the number of bit 0. If bits counting result is 0, M1099 = ON<br />

4. Associated flags:<br />

M1098: Counting the number of bits which are “1” or “0”<br />

M1099: ON when the bits counting result is “0”..<br />

Program Example:<br />

When X0 = ON with M1098 = ON, MBC instruction counts the number of bit 1 in D0~D2 and store<br />

the counted number in D10. When X0 = ON with M1098 = OFF, the instruction counts the number<br />

of bit 0 in D0~D2 and store the counted number in D10.<br />

X0<br />

MBC D0 K3 D10<br />

D0<br />

D1<br />

D2<br />

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

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

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

D10<br />

12<br />

M1098=0<br />

D10<br />

36 M1098=1<br />

3-423

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

Saved successfully!

Ooh no, something went wrong!