Reference Manual

Turbo PMAC/PMAC2 Software Reference
Turbo PMAC Mathematical Features 489
^
Function: Bit-by-bit exclusive or
The ^ sign implements the bit-by-bit logical exclusive or (xor) of the numerical value preceding it and the
numerical value following it. A given bit of the result is equal to 1 if and only if the matching bits of the
two operands are different from each other. 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.
Execution time, 80 MHz CPU: 3.1 µsec interpreted, 1.4 µsec compiled floating-point, 0.10 µsec compiled
fixed-point
Examples:
Operation
Result
2^1
3
2^2
0
5^7
2
$AA^$55
$FF
3^-3
-2
0.5^0.875
0.375
Mathematical Functions
ABS
Function: Absolute value
Syntax: ABS({expression})
Domain: All real numbers
Domain units: User-determined
Range: Non-negative real numbers
Range units: User-determined
ABS implements the absolute value, or magnitude, function, of the mathematical expression contained
inside the following parentheses.
Execution time, 80 MHz CPU: 3.1 µsec interpreted, 0.6 µsec compiled
Examples:
P8=ABS(P7) ; Computes magnitude of P7
IF(Q200!=0) ; Divide by 0 check
Q240=ABS(Q200)/Q200 ; Computes sign (-1 or 1) of Q200
ELSE
Q240=0 ; Sign value is 0
ENDIF
ACOS
Function: Trigonometric arc-cosine
Syntax: ACOS({expression})
Domain: -1.0 to +1.0
Domain units: none
Range: 0 to Pi radians (0 to 180 degrees)
Range units: Radians/degrees