Crestron SIMPL+
Operators
Operators Overview
Arithmetic Operators
OPERATOR
-
Negation
*
Multiplication
/
Unsigned Division
S/
Signed Division
MOD
Signed Modulo
UMOD
Unsigned Modulo
+
Addition
-
Subtraction
Bitwise Operators
OPERATOR
<<
Shift Left
>>
Shift Right
{{
Rotate Left
}}
Rotate Right
NOT
1's Complement
&
Bitwise AND
|
Bitwise OR
^
Bitwise XOR
Language Reference Guide - DOC. 5797G
®
SIMPL+ operators perform functions between two or more variables. SIMPL+
operators consist of Arithmetic, Bitwise, and Rational Operators.
NAME
EXAMPLE
-X
X *Y
X / Y
X S/ Y
X MOD Y
X UMOD Y
X + Y
X - Y
NAME
EXAMPLE
X << Y
X >> Y
X {{ Y
X }} Y
NOT(X)
X & Y
X | Y
X ^ Y
NOTE: For the Shift and Rotate operators, only the lower 5-bits of Y are used, giving
values of Y ranging from 0 to 31. For example, if Y=600, the lower 5-bits equate to
24. Rotating a 16-bit number through 16 positions gives the original number back.
Therefore, for rotating 24, the result is equivalent to rotating through 8. Shifting
greater than 16 will always give a 0 as a result.
EXPLANATION
Negate the value of X (2's Complement of X).
Multiply X by Y (signed arithmetic).
Divide X by Y, truncates result (unsigned arithmetic).
Divide X by Y, truncates result (signed arithmetic).
Remainder after dividing X by Y (signed arithmetic).
Remainder after dividing X by Y (unsigned arithmetic).
Only 2-Series Systems.
Add the value of Y to X.
Subtract the value of Y from X.
EXPLANATION
Shift X to the left by Y bits; 0 is Shifted in.
Shift X to the right by Y bits; 0 is Shifted in.
Rotate X to the left by Y bits; full 16 bits used. Same as
RotateLeft().
Rotate X to the right by Y bits; full 16 bits used. Same as
RotateRight().
Change 0 bits to 1, 1 bits to 0.
AND the bits of X with the bits of Y.
OR the bits of X with the bits of Y.
XOR the bits of X with the bits of Y.
Software
®
SIMPL+
15
Need help?
Do you have a question about the SIMPL+ and is the answer not in the manual?
Questions and answers