13.07.2015 Views

[Instruction] Contents

[Instruction] Contents

[Instruction] Contents

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Basic Function <strong>Instruction</strong>FUN 6 D PBSHFSymbolBIT SHIFT(Shifts the data of the 16-bit or 32-bit register to left or to right by one bit)FUN 6 D PBSHFOperandD: The register number for shiftingOperandRangeWY WM WS TMR CTR HR OR SR ROR DRWY0∣WY240WM0∣WM1896WS0∣WS984T0∣T255C0∣C255R0∣R3839R3904∣R3967R3968∣R4167R5000∣R8071D0∣D4095D ○ ○ ○ ○ ○ ○ ○ ○* ○* ○Description● When the status of clear control "CLR" is at 1, then the data of register D and FO0 will all be cleared to 0.Other input signals are all in effect.●When the status of clear control is "CLR" at 0, then the shift operation is permissible. When the shift control"EN" = 1 or "EN↑" ( P instruction) from 0 to 1, the data of the register will be shifted to right (L/R=0) or toleft (L/R=1) by one bit. The shifted-out bit (MSB when shift to left and LSB when shift to right) for bothcases will be sent to FO0. The vacated bit space (LSB when shift to left and MSB when shift to right) due toshift operation will be filled in by the input status of fill-in bit "INB".ExampleShifts the 16-bit register dataLadder diagram Key Operations Mnemonic CodesORG ORG X 1X1X2ENINB6P.BSHFD : R 3OTBY0LDLDLDLD X 2LD X 3LD X 4X3X4L/RCLRFUNFUN 6PD: R 3FO 0OUTOUT Y 0B15 B0X3=1← ← ← ← ← ← ← ← ← ← ← ← ← ← ← ← ← ←(Left shift) Y0 Shifts the 16-bit data to left by one bit X2B15 B0X3=0→ → → → → → → → → → → → → → → → → →(Right shift) X2 Shifts the 16-bit data to right by one bit Y06-20

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

Saved successfully!

Ooh no, something went wrong!