13.07.2015 Views

[Instruction] Contents

[Instruction] Contents

[Instruction] Contents

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.

Advanced Function <strong>Instruction</strong>FUN130 PMBCNTMATRIX BIT STATUS COUNTFUN130 PMBCNTMs : Starting register of matrixL : Matrix lengthD : Register storing count resultsMs may combine with V, Z, P0~P9 to serveindirect address applicationOperandRangeWX WY WM WS TMR CTR HR IR OR SR ROR DR K XRWX0∣WX240WY0∣WY240WM0∣WM1896WS0∣WS984T0∣T255C0∣C255R0∣R3839R3840∣R3903R3904∣R3967R3968∣R4167R5000∣R8071D0∣D4095Ms ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○L ○ ○* ○ ○D ○ ○ ○ ○ ○ ○ ○ ○* ○* ○2∣256V、ZP0~P9• When count control "EN" = 1 or "EN↑" ( P instruction) has a transition from 0 to 1, then among the 16L bitsof the Ms matrix, this instruction will count the total amount of bits with a status of 1 (when input "1/0" = 1)or the total amount of bits with a status of 0 (when input "1/0" = 0). The results of the counting will be storedinto the register specified by D. If the value of these amounts is 0, then the Result-is-0 flag "D = 0" will be setto 1.130P.MBCNTX0EN Ms : R 0X1 L : 51/0 D : R 0D=0• The program at left sets X1 first as 0 (to count bits withstatus of 0) and then as 1 (to count bits with status of 1)and let the signal X0 has a transition from 0→1 for bothcase, the execution results are shown at right in thediagram below .Ms15Ms0↓Ms↓R00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0R1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0R2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1R3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0DR20 64 R20 16R4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 X1=0 X1=1↑Ms79↑Ms64X0=DSource matrix Count of ‘0’ bit Count of ‘1’ bit7-113

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

Saved successfully!

Ooh no, something went wrong!