Reference Manual

PMAC 2 Software Reference
362 PMAC Mathematical Features
&
Function
Bit-by-bit "and"
Remarks
The & sign implements the bit-by-bit logical “and” of the numerical value preceding it
and the numerical value following it. A given bit of the result is equal to 1 if the
matching bits of both operands are equal to 1. The operation is done both on integer
bits and fractional bits (if any).
Multiplication, division, modulo (remainder), and bit-by-bit “and” operations have
higher priority than addition, subtraction, bit-by-bit “or”, and bit-by-bit “exclusive-or”
operations. Operations of the same priority are implemented from left to right.
This bit-by-bit “and” operator that logically combines the bits of numerical values is
not to be confused with the AND command, which logically combines conditions.
Example
Operation Result
3&1
1
3&2
2
3&3
3
3&4
0
3&-3
1
0.875&1.75
0.75
0.875&-1.75
0.25
|
Function
Bit-by-bit "or"
Remarks
The | sign implements the bit-by-bit logical “or” of the numerical value preceding it
and the numerical value following it. A given bit of the result is equal to 1 if the
matching bit of either operand is equal to 1. The operation is done both on integer bits
and fractional bits (if any).
Multiplication, division, modulo (remainder), and bit-by-bit “and” operations have
higher priority than addition, subtraction, bit-by-bit “or”, and bit-by-bit “exclusive-or”
operations. Operations of the same priority are implemented from left to right.
This bit-by-bit “or” operator that logically combines the bits of numerical values is not
to be confused with the OR command, which logically combines conditions.
Example
Operation Result
4|3
7
3|2
3
3|3
3
$F0|$4
$F4
3|-3
-1
0.5|0.375
0.875
0.875|-1.75
-0.375