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

Parameters

shift

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

long

mask

Bit mask (applied after bit shift)   0  4294970000 4294967295

large

Output

n

Resulting integer value

large

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