F
Frank Buss
I'm using this function for calculating the number of bits needed to encode
a natural number:
function num_bits(n: natural) return natural is
begin
if n > 0 then
return 1 + num_bits(n / 2);
else
return 1;
end if;
end num_bits;
I wonder if there is already such a function in the IEEE.* libraries or
some special VHDL operator.
a natural number:
function num_bits(n: natural) return natural is
begin
if n > 0 then
return 1 + num_bits(n / 2);
else
return 1;
end if;
end num_bits;
I wonder if there is already such a function in the IEEE.* libraries or
some special VHDL operator.