Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

range must be bounded by constant expression in verilog?

Status
Not open for further replies.

gvm0072002

Newbie level 2
Joined
Jan 20, 2007
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,291
range must be bounded by constant expressions

for(i=0;i<56;i=i+8)
begin

if (string[i+7:i]<="G")
y[i+7:i]<="C";

ijust want to know what is wrong in the above statement, it is showing an error of
range must be bounded by constant expression(verilog).
 

verilog range

Here you must have declared
string as reg [56*8:1] string;
And verilog standard says that you can not assign variable part select of a vector;
that means string[i+7:i] is not allowed if i is not a constant.
parameter i = 10; string [i+7:i] = 'A'; is allowed and valid.
In ur case what you can do is declare string as array of chracters
Code:
reg [8:1] y_array [0:55];
reg [8:1] string_array [0:55]; //56 character array 
wire [56*8:1] string, y;
for (i=0; i<56; i=i+1) begin
    if (string_array[i] <= 'G')   
      y_array[i] <= 'C'; 
end
assign string = {string_array[55], ........, string_array[0]};
assign y = {y_array[55], ......., y_array[0]};

Hope this helps!

Hope this helps!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top