Each of the operators takes an array of BIT or BOOLEAN as the left operand and an integer value as theright operand and performs the specified operation. The sll operator ( shift left logical) and srl operator (shift right logical) fill the vacated bits with left operandtype LEFT. The sla operator (shift left arithmetic) fills the vacated bits with rightmost bit of the left operand, whilethe sra operator (shift right arithmetic) fills the vacated bits with the left most of the left operand. Theoperator causes the vacated bits to be filled with the displaced bits in a circular fashion.
These are “1001010” sll 2 is “0101000” -- filled with BIT LEFT, which is ‘0’. “1001010” srl 3 is “0001001” – filled with ‘0’.
“1001010” sla 2 is “0101000” – filled with rightmost bit which is ‘0’.
“1001010” sra 3 is “1111001” –filled with ‘1’which is the leftmost bit.
“1001010” rol 2 is “0101010” –rotate left
“1001010” ror3 is “0101001” –rotate right
Logical Operators: The logical operators and, or, nand, nor, xor, xnor and not are defined for BIT and BOOLEAN types, as well as for one-dimensional arrays containing the elements of BIT and BOOLEAN. All these operators have the lowest priority, except for the operator not, which has the highest priority. The BIT type is represented by the values 0 and 1 while the Boolean type by True and False.