![IDEC OpenNet series Скачать руководство пользователя страница 191](http://html.mh-extra.com/html/idec/opennet-series/opennet-series_user-manual_617384191.webp)
13: B
IT
S
HIFT
/ R
OTATE
I
NSTRUCTIONS
13-8
O
PEN
N
ET
C
ONTROLLER
U
SER
’
S
M
ANUAL
Examples: ROTR
• Data Type: Word
• Data Type: Double Word
Before rotation: D20 = 13
0
0
0
0
0
0
0
0 0
0
0
1
0
0
1
1
CY
M8003
MSB
LSB
D20
After first rotation: D20 = 16387
Bits to rotate = 2
After second rotation: D20 = 53248
0
0
0
0
0
0
1
0
0 0
0
1
0
0
0
0
1
CY
M8003
MSB
LSB
D20
1
1
0
0
0
1
1
0
0 0
0
0
0
0
0
0
0
CY
M8003
MSB
LSB
D20
M8120
REP
M8120 is the initialize pulse special internal relay.
When the CPU starts operation, the MOV (move) instruction sets 13 to
data register D20.
Each time input I1 is turned on, 16-bit data of data register D20 is
rotated to the right by 2 bits as designated by operand bits.
The last bit status rotated out is set to a carry (special internal relay
M8003).
SOTU
I1
S1 –
13
D1 –
D20
S1
D20
bits
2
ROTR(W)
MOV(W)
Each time input I1 is turned on, 32-bit data of data registers D20 and
D21 is rotated to the right by 1 bit as designated by operand bits.
The last bit status rotated out is set to a carry (special internal relay
M8003).
Bits to rotate = 1
SOTU
I1
S1
D20
bits
1
ROTR(D)
Before rotation: D20·D21 = 851,981
After rotation: D20·D21 = 2,147,909,638
0
0
0
0
0
0
0
0 0
0
0
1
0
0
1
1
CY
M8003
MSB
LSB
D20·D21
1
CY
M8003
MSB
LSB
D20·D21
Rotate to the right
0
0
0
0
0
0
0
0 0
0
0
1
0
0
1
1
0
0
0
0
1
0
0 0
0
1
0
0
0
0
1 0
0
0
0
0
1
0
0 0
0
1
0
0
0
0
1 0
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: [email protected]