4.8 VHDL OPERATORS

VHDL provides predefined operators which are used as hardware modeling units. These include logical (or Boolean), arithmetic, and relational operators. The logical operators are listed in Figure 4.17. The NOT operator has one input and one output, whereas the remaining operators are binary operators, which have two input ports and one output port. VHDL relational operators are listed in Figure 4.18. Relational operators are a set of binary logical operators that generate a result of Boolean type: either “true” or “false.” The relational operands are of either bit type or Boolean type, but not of mixed type.

VHDL arithmetic operators are listed in Figure 4.19. Arithmetic operators accept operands of integer type or floating-point type (real type). VHDL does not accept implicit type conversion between integer and floating-point numbers. The operators REM and MOD are defined only for integer numbers. The exponential operator accepts both integer and floating-point numbers with exceptions. The data type of the left operand of the exponential operator defines the data type of the result, and can be integer or floating point. The right operand (exponent) must be of integer type.

images

Figure 4.17 VHDL Logical (Boolean) Operators

images

Figure 4.18 VHDL Relational Operators

Figure ...

Get Introduction to Digital Systems: Modeling, Synthesis, and Simulation Using VHDL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.