2 use ieee.std_logic_1164.all;
3 use ieee.numeric_std.all;
7 function log2(i : natural) return integer;
8 function ispow2(i : integer) return boolean;
14 function log2(i : natural) return integer is
15 variable tmp : integer := i;
16 variable ret : integer := 0;
25 function ispow2(i : integer) return boolean is
27 if to_integer(to_unsigned(i, 32) and to_unsigned(i - 1, 32)) = 0 then