Operator

LRM §7.2.

Operators are means for constructing expressions.

Syntax:

-- expression operator expression
+   -   *   /   mod   rem   **
=   /=   <   <=   >   >=
and   or   xor   nand   nor   xnor
sll   srl   sla   sra   rol   ror
&

-- operator expression
+   -   abs   not

Description:

An operator is a logical or mathemetical function which takes one or two values and produces a single result. Operators can be redefined (see Operator overloading) for any types by writing new functions.

Table 1. Operator priority

miscellaneous operators

** | abs | not

multiplying operators

* | / | mod | rem

sign operators

+ | -

adding operators

+ | - | &

shift operators

sll | srl | sla | sra | rol | ror

relational operators

= | \= | < | <= | > | >=

logical operators

and | or | nand | nor | xor | xnor

The expressions are evaluated form left to right, operations with higher precedence are evaluated first. If the order should be different from the one resulting from this rule, parentheses can be used.

The operators + - = /= < <= > >= are synthesizable as adders, substractors and comparators

The operators / mod rem ** are not synthesizable in general.

Example:

V := A + B * C;
W := W1 and W2 xnor W3 nor W4; 
X sll 3      
Y := A / (not B) 
Z:= B mod 2 

Notes:

See also:

Expression, Function, Operator overloading, Standard Package