Altera_Forum
Honored Contributor
17 years agoerror: i is not constant
Basically i would like to divide the total no. of bits entered by user into several block of 8 bits.
e.g 12 bits entered by user. Then it will divide it to out0[7:0] and out1[3:0]. In this case i use memory. module .... input [63:0] out_pin_in; reg [7:0] out_reg [7:0]; ... always (*) for (i=0; i<8; i= i+1) begin if (ocount_e >= 8) begin out_reg[i] <= out_pin_in[((i*8)+7):i*8)]; end end ... However, i faced a error "i is not constant". I can pretty sure that the font i bold have problem. But i have no clue to solve it. Can somebody help on it? Thanks