Useful IEEE Functions
Practical VHDL functions from std_logic_1164, numeric_std, std.env, textio and math_real.
Why this chapter
IEEE libraries do more than declare std_logic or unsigned. They also provide functions that make VHDL safer, clearer and easier to test.
The goal is not to memorize everything. The goal is to know which function to use in common situations.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;Keep this simple rule: for arithmetic, use numeric_std. Avoid old non-standard packages such as std_logic_arith, std_logic_unsigned or std_logic_signed.
std_logic_1164
The std_logic_1164 package defines std_logic, std_logic_vector and functions related to 9-state logic values.