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 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.