G
goannae
Guest
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 bits. I have difficulty to
calculate log2 in verilog. I am wondering if log2 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 bits. I have difficulty to
calculate log2 in verilog. I am wondering if log2 can be done in
verilog as:
parameter InputLength = 8;
parameter CounterSize = log2(InputLength);
are not acceptable.
Thank you in advance,
Goanna