INTSM – Integer number bit shift and mask

Block SymbolLicensing group: STANDARD
PIC

Function Description
The INTSM block performs bit shift of input value i by shift bits right (if shift is positive) or left (if shift is negative). Free space resulting from shifting is filled with zeros.

Output value n is calculated as bitwise AND of shifted input i and bit mask mask.

Typical application of this block is extraction of one or more adjacent bits from a given position in integer register which was read from some external system.

Input

i

Integer value to shift and mask   -9.22337E+18  9.22337E+18

Large (I64)

Parameters

shift

Bit shift (negative=left, positive=right)   -63  63

Long (I32)

mask

Bit mask (applied after bit shift)   0  4294970000 4294967295

Large (I64)

Output

n

Resulting integer value

Large (I64)

2020 © REX Controls s.r.o., www.rexygen.com