blob: 2f7b64d4dfdf0717255da8559f156b8762ff74ce (
plain) (
tree)
|
|
function integer clog2;
input integer value;
integer result;
begin
value = value - 1;
for (result = 0; value > 0; result = result + 1)
value = value >> 1;
clog2 = result;
end
endfunction
|