e.g. bw_NOT ('Expression')
|
bw_AND |
Bitwise AND |
|
bw_OR |
Bitwise OR |
|
bw_XOR |
Bitwise exclusive OR |
|
bw_NOT |
Bitwise NOT |
Description
These functions are used for the bitwise linking of two analog values based on Boolean algebra. The functions return a 32-bit integer. 32-bit integers are expected as arguments.
If the arguments are not integers, the decimal part will be dropped before the operation is executed. If the arguments are too big so that their absolute value does not fit in a 32-bit integer, the operation is executed only on the 32 low-order bits.
When linking two analog values with a bw function, the individual bits of both values are logically linked. The result then is an analog value of the same type with a bit pattern in accordance with the logical link.
Example
For 2 analog values V1 = 15 and V2 = 2, the results are as follows:
|
Dec. value |
Bits |
Hex |
Result value |
|
|---|---|---|---|---|
|
Output value V1 |
15 |
…1111 |
0x0000000F |
|
|
Output value V2 |
2 |
…0010 |
0x00000002 |
|
|
V1 bw_AND V2 |
…0010 |
0x00000002 |
2 |
|
|
V1 bw_OR V2 |
…1111 |
0x0000000F |
15 |
|
|
V1 bw_XOR V2 |
…1101 |
0x0000000D |
13 |
|
|
bw_NOT (V1) |
…0000 |
0xFFFFFFF0 |
-16 |