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>FUN110 D PQUEUEQUEUEFUN110 D PQUEUEExecution controlENLadder symbol110DP.QUEUEIW :QU :In/Out control I/O L :OperandRangePr :OW :EPTFULERRQueue emptyQueuePointer errorIW : Data pushed into queue, can be a constantor a registerQU : Starting register of queueL : Size of queuePr : Pointer registerOW : Register accepting data popped outfrom queueQU may combine with V, Z, P0~P9 to serveindirect address applicationWX WY WM WS TMR CTR HR IR OR SR ROR DR K XRWX0∣WX240WY0∣WY240WM0∣WM1896WS0∣WS984T0∣T255C0∣C255R0∣R3839R3840∣R3903R3904∣R3967R3968∣R4167R5000∣R8071D0∣D409516/32-bit+/- numberIW ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○QU ○ ○ ○ ○ ○ ○ ○ ○ ○* ○ ○L ○ ○* ○ 2~256Pr ○ ○ ○ ○ ○ ○ ○ ○* ○* ○OW ○ ○ ○ ○ ○ ○ ○ ○* ○* ○V、ZP0~P9• Queue is also a kind of table. It is different from ordinary table in that its queue register numbers go from 1 to Land not from 0 to L-1. In other words QU 1~QU L respectively correspond to pointers Pr = 1 to L, and Pr = 0 isused to show that the queue is empty.• Queue is a first in first out (FIFO) device, i.e. - the data that first pushed into the queue will be the first to popout from the queue. A queue is comprised of L consecutive 16 or 32 bit registers ( D instruction) starting fromthe QU register, as in the diagram below:IW5555push(I/O=1)1.IW always push intoQU12.Pr+1→Pr ~ is the sequence number ofoperation QULPr4QUQU1 4444QU2 3333 PushQU3 2222 downQU4 1111OWQU5 ××××… …Pop out(I/O=0)2. QUpr →OW3. Pr-1→Pr• When execution control "EN" = 1 or "EN↑" ( P instruction) has a transition from 0 to 1, the status of in/outcontrol "I/O" determines whether the IW data will be pushed into the queue (when "I/O" = 1) or be popped outand transferred to OW (when "I/O" = 0). As shown in the diagram above, the IW data will always be pushedinto the first (QU1) register of the queue. After it has been pushed in, Pr will immediately be increased by 1, sothat the pointer can always point to the first data that was pushed into the queue. When it is popped out, thedata pointed by Pr will be transferred directly to OW. Pr will be reduced by 1, so that it still point to the first dataremained in the queue.7-94

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

Saved successfully!

Ooh no, something went wrong!