2.3. Mathematical Functions

Mathematical functions, such as adder, subtractor, multiplier, and divider, are performed using arithmetic operators; see Table 2-1. The arithmetic operators can be used in concurrent and/or sequential statements; it depends on the circuit. To keep things simple, this example uses only a concurrent statement, and a sequential statement is demonstrated in later examples.

Table 2-1. Mathematical functions
Symbol Data Types Package
Accepts Returns
+Addition std_logic, integer, std_logic_vector std_logic_vector std_logic_unsigned
signed, unsigned, natural, integer signed, unsigned numeric_std
–Subtraction std_logic, integer, std_logic_vector, std_logic_vector std_logic_unsigned
signed, unsigned, natural, integer signed, ...

Get FPGAs 101 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.