goannae
2006-07-05 13:07:49 UTC
Hi,
I would like to parameterize a counter to count an n bit binary input. Thus
the size of the count is at lease log2(n) bits. I have difficulty to
calculate log2(n) in verilog. I am wondering if log2(n) can be done in
verilog as:
parameter InputLength = 8;
parameter CounterSize = log2(InputLength);
are not acceptable.
Thank you in advance,
Goanna
I would like to parameterize a counter to count an n bit binary input. Thus
the size of the count is at lease log2(n) bits. I have difficulty to
calculate log2(n) in verilog. I am wondering if log2(n) can be done in
verilog as:
parameter InputLength = 8;
parameter CounterSize = log2(InputLength);
are not acceptable.
Thank you in advance,
Goanna