shaiko
Advanced Member level 5
- Joined
- Aug 20, 2011
- Messages
- 2,644
- Helped
- 303
- Reputation
- 608
- Reaction score
- 297
- Trophy points
- 1,363
- Activity points
- 18,302
Code:
function log2_unsigned ( x : natural ) return natural is
variable temp : natural := x ;
variable n : natural := 1 ;
begin
while temp > 1 loop
temp := temp / 2 ;
n := n + 1 ;
end loop ;
return n ;
end function log2_unsigned ;
Will simply changing "natural" with "string" work ?