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)

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