2 use ieee.std_logic_1164.all;
3 use ieee.numeric_std.all;
6 type alu_ops is (NOP, SUB, ADD, MUL, DIV, DONE);
7 constant CBITS : integer := 32;
8 subtype csigned is signed((CBITS-1) downto 0);
9 --TODO: bei CBITS-1 gibts einen overflow :/
10 subtype cinteger is integer range -(2**(CBITS-2)) to ((2**(CBITS-2))-1);
11 function find_msb(a : csigned) return natural;
14 package body gen_pkg is
15 function find_msb(a : csigned) return natural is
16 variable r : natural := 0;
18 for i in (CBITS-1) downto 0 loop
23 end function find_msb;
24 end package body gen_pkg;