BITOP – Bitwise operation

Block SymbolLicensing group: STANDARD
PIC

Function Description
The BITOP block performs bitwise operation i1i2 on the signals i1 and i2, resulting in an integer output n. The type of operation is selected by the iop parameter described below. In case of logical negation or 2’s complements the input i2 is ignored (i.e. the operation is unary).

Inputs

i1

First integer input of the block

Long (I32)

i2

Second integer input of the block

Long (I32)

Output

n

Result of the bitwise operation iop

Long (I32)

Parameter

iop

Bitwise operation  1

Long (I32)

1 ....

Bitwise negation (Bit NOT)

2 ....

Bitwise logical sum (Bit OR)

3 ....

Bitwise logical product (Bit AND)

4 ....

Bitwise logical exclusive sum (Bit XOR)

5 ....

Shift of the i1 signal by i2 bits to the left (Shift Left)

6 ....

Shift of the i1 signal by i2 bits to the right (Shift Right)

7 ....

2’s complement of the i1 signal on 8 bits (2’s Complement - Byte)

8 ....

2’s complement of the i1 signal on 16 bits (2’s Complement - Word)

9 ....

2’s complement of the i1 signal on 32 bits (2’s Complement - Long)

vtype

Input and output numeric type  4

Long (I32)

–- ...

2 ....

Byte (U8)

3 ....

Short (I16)

4 ....

Long (I32)

5 ....

Word (U16)

6 ....

DWord (U32)

–- ...

–- ...

–- ...

10 ...

Large (I64)

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