imbichie
Full Member level 6
- Joined
- Jul 30, 2010
- Messages
- 381
- Helped
- 55
- Reputation
- 110
- Reaction score
- 54
- Trophy points
- 1,308
- Activity points
- 3,580
Hi all,
How we can use the parameter as bit width in verilog for a CONSTANT value representation.
For example :
So here instead of 11'h5FF and 11'h1, how I can replace this with parameter VAL.
How we can use the parameter as bit width in verilog for a CONSTANT value representation.
For example :
Code:
parameter VAL = 11;
always @ ( posedge CLK or negedge RESETn )
begin
if ( !RESETn )
begin
count <= {VAL{1'b0}};
end
else
begin
if ( count == [B][COLOR="#FF0000"]11'h5FF[/COLOR][/B] )
begin
count <= {VAL{1'b0}};
end
else
begin
count <= count + [B][COLOR="#FF0000"]11'h1[/COLOR][/B];
end
end
end
So here instead of 11'h5FF and 11'h1, how I can replace this with parameter VAL.