N
Nju Njoroge
Guest
Hi,
I'm using the Verilog-2001 exponential operator to do the following:
`define NUM_COUNTER_BITS 8;
parameter NUM_COUNTER_CYCLES = 2 ** (`NUM_COUNTER_BITS);
When I simulate this in ModelSim 6.0a, launched from Project Nav. (ISE
7.1 SP3), NUM_COUNTER_CYCLLES = 5. However, if I use a parameter for
NUM_COUNTER_BITS instead of `define, as shown below, NUM_COUNTER_CYCLES
= 256, which is the desired result.
parameter NUM_COUNTER_BITS = 8;
parameter NUM_COUNTER_CYCLES = 2 ** (`NUM_COUNTER_BITS);
What are the inherent differences between a parameter and `define
directive that could this problem to occur.
Thanks,
NN
I'm using the Verilog-2001 exponential operator to do the following:
`define NUM_COUNTER_BITS 8;
parameter NUM_COUNTER_CYCLES = 2 ** (`NUM_COUNTER_BITS);
When I simulate this in ModelSim 6.0a, launched from Project Nav. (ISE
7.1 SP3), NUM_COUNTER_CYCLLES = 5. However, if I use a parameter for
NUM_COUNTER_BITS instead of `define, as shown below, NUM_COUNTER_CYCLES
= 256, which is the desired result.
parameter NUM_COUNTER_BITS = 8;
parameter NUM_COUNTER_CYCLES = 2 ** (`NUM_COUNTER_BITS);
What are the inherent differences between a parameter and `define
directive that could this problem to occur.
Thanks,
NN