Most of the library items in math category are making use of
use ieee.std_logic_arith.all; use ieee.std_logic_signed.all;
packages that are most than obsolete.
Please update to make use of the standardized ones: ieee.numeric_std.all
You should consider too to use type signed unsigned type in the entities versus std_logic_vector.