![background image](http://html.mh-extra.com/html/ge/versamax-plc/versamax-plc_user-manual_123354128.webp)
%I0001
CAT
NOT_
WORD
I1 Q
TAC
10.1.6
Bit Operation Functions Shift Bits Right, Shift
Bits Left
The Shift Left function shifts all the bits in a word or group of words to the left by a
specified number of places. When the shift occurs, the specified number of bits is shifted
out of the output string to the left. As bits are shifted out of the high end of the string, the
same number of bits is shifted in at the low end.
MSB
LSB
B2 ←
1
1
0
1
1
1
1
1
1
1
0
0
1
0
0
0
← B1
The Shift Right function is used to shift all the bits in a word or group of words a
specified number of places to the right. When the shift occurs, the specified number of
bits is shifted out of the output string to the right. As bits are shifted out of the low end of
the string, the same number of bits is shifted in at the high end.
MSB
LSB
B1 →
1
1
0
1
1
1
1
1
1
1
0
0
1
0
0
0
→ B2
A string length of 1 to 256 words can be selected for either function.
Word to be shifted in
Number of bits
Last bit shifted out
Enable
SHIFTL
WORD
IN B2
N
Bit shifted in
B1
Output
Q
If the number of bits to be shifted (N) is greater than the number of bits in the array * 16,
the array (Q) is filled with copies of the input bit (B1), and the input bit is copied to the
output power flow (B2). If the number of bits to be shifted is zero, then no shifting is
performed; the input array is copied into the output array; and input bit (B1) is copied into
the power flow.
The bits being shifted into the beginning of the string are specified via input parameter
B1. If a length greater than 1 has been specified as the number of bits to be shifted, each
of the bits is filled with the same value (0 or 1). This can be:
•
The boolean output of another program function.
•
All 1s. To do this, use the special reference nickname ALW_ON as a permissive to
input B1.
•
All 0s. To do this, use the special reference nickname ALW_OFF as a permissive to
input B1.
128
GFK-1503E
VersaMax PLC User Manual
For public disclosure
Summary of Contents for VersaMax PLC
Page 16: ...Notes 16 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 38: ...Notes 38 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 50: ...Notes 50 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 92: ...Notes 92 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 112: ...Notes 112 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 224: ...Notes 224 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 292: ...Notes 292 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 316: ...Notes 316 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 317: ......