Bit Operation Functions Shift Bits Right, Shift Bits Left - GE VersaMax PLC User Manual

Table of Contents

Advertisement

MSB
B2 ←
1
1
0
MSB
B1 →
1
1
0
128
GFK-1503E
For public disclosure
%I0001
CAT
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.
1
1
1
1
1
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.
1
1
1
1
1
A string length of 1 to 256 words can be selected for either function.
Enable
WORD
Word to be shifted in
IN B2
N
Number of bits
Bit shifted in
B1
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.
NOT_
WORD
I1 Q
TAC
1
1
0
0
1
1
0
0
Last bit shifted out
Q
Output
LSB
1
0
0
0
← B1
LSB
1
0
0
0
→ B2
VersaMax PLC User Manual

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents