LD Input_Var
SHR_RBIT_DINT Shift_Num, Shifted_Var, Shifted_Bits
SHR_RBIT_DINT(Input_Var, Shift_Num, Shifted_Var, Shifted_Bits);
Parameter
|
Type
|
Comment
|
---|---|---|
Input_Var
|
Variable on which the shift is to be performed.
Example: Input_Var = 2#10000000111100010000000011001111.
|
|
Shift_Num
|
Value of the shift to be performed.
Example: Shift_Num = 6.
|
Parameter
|
Type
|
Comment
|
---|---|---|
Shifted_Var
|
Shifted_Var contains the value of Input_Var shifted by the number of bits given by Shift_Num. With conservation of the sign and propagation of the sign bit in the bits liberated by the shift.
Example: with the data examples of the previous table, the result is the following Shifted_Var = 2#1 1111110000000111100010000000011
|
|
Shifted_Bits
|
Shifted_Bits contains the shifted bits.
Example: with the data examples of the previous table, the result is the following Shifted_Bits = 2#00000000000000000000000000001111
|