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)

vtype

Output numeric type  4

Long (I32)

–- ...

2 ....

Byte (U8)

3 ....

Short (I16)

4 ....

Long (I32)

5 ....

Word (U16)

6 ....

DWord (U32)

–- ...

–- ...

–- ...

10 ...

Large (I64)

Output

n

Resulting integer value

Large (I64)

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