Name :Shift right

Symbol :SHR

Illustrate:

        Shift input parameter 1 "IN" to the right and input parameter 2 "N" bit, and assign the result to the output parameter OUT. After the unsigned number is shifted to the right, the high position is filled with "0". If the value of the signed number is less than zero, the high is "1", and if its value is greater than zero, the high is "0".

Image:

Parameter:

Parameter | Statement | Type | Description
--- | --- | --- | ---
IN | Input | BOOL/BYTE/WORD/DWORD |
    First input value (operand)
N | Input | UINT |
    Second input value (number of right shifts)
OUT | Output | BOOL/BYTE/WORD/DWORD |
    Output value

Example:

LD:

ST:

TagOut := SHR(IN := TagIn1, N := TagIn2);

Interpretation:

parameter | operand | value
--- | --- | ---
IN | TagIn1 | 8
N | TagIn2 | 2
OUT | TagOut | 2

    	IN and N input the corresponding type of data, and SHR outputs the right-shift operation result.