1
0
SEm-Labos/Libs/AhbLite/hdl/ahbLite_pkg_body.vhd

16 lines
343 B
VHDL
Raw Permalink Normal View History

2024-02-23 13:01:05 +00:00
PACKAGE BODY ahbLite IS
function addressBitNb (addressNb : natural) return natural is
variable powerOfTwo, bitNb : natural;
begin
powerOfTwo := 1;
bitNb := 0;
while powerOfTwo <= addressNb loop
powerOfTwo := 2 * powerOfTwo;
bitNb := bitNb + 1;
end loop;
return bitNb;
end addressBitNb;
END ahbLite;