Operators
Operators can be chained to form complex expressions, e.g. :
- Can use parentheses for readability and to control the association of operators and operands
Defined precedence levels in decreasing order :
- Miscellaneous operators -- **, abs, not
- Multiplication operators -- *, /, mod, rem
- Sign operator -- +, -
- Addition operators -- +, -, &
- Shift operators -- sll, srl, sla, sra, rol, ror
- Relational operators -- =, /=, <, <=, >, >=
- Logical operators -- AND, OR, NAND, NOR, XOR, XNOR
res <= a AND NOT(B) OR NOT(a) AND b;
Notes:
The list of predefined operators in VHDL is shown above. The logical and relational operators are similar to those in other languages. The addition operators are also familiar except for the concatenation operator which will be discussed in the next slide. The multiplication operators are also typical (e.g. the mod operator returns the modulus of the division and the rem operator returns the remainder). Finally, the miscellaneous operators provides some useful frequently used functions.