logari84
Newbie level 6
Hi,
I am quite new to SystemVerilog. I want to assign a value to a signal that has a width set by a parameter (CODE_WIDTH). When trying to compile in ModelSim I get the error:
near "'b": syntax error, unexpected BASE, expecting ';' or ','
The line is:
assign memory_code[02] = CODE_WIDTH'b00000011;
where CODE_WIDTH = 8
The code compiles if I change the line to:
assign memory_code[02] = 8'b00000011;
The thing is that I want to have the width of the signal as a parameter.
Thank you in advance.
I am quite new to SystemVerilog. I want to assign a value to a signal that has a width set by a parameter (CODE_WIDTH). When trying to compile in ModelSim I get the error:
near "'b": syntax error, unexpected BASE, expecting ';' or ','
The line is:
assign memory_code[02] = CODE_WIDTH'b00000011;
where CODE_WIDTH = 8
The code compiles if I change the line to:
assign memory_code[02] = 8'b00000011;
The thing is that I want to have the width of the signal as a parameter.
Thank you in advance.