verilog中的for循环问题

module mult_for(outcome,a,b);
parameter SIZE=8;
input[SIZE:1] a,b;
output reg[2*SIZE:1] outcome;
integer i;
always @(a or b)
        begin outcome<=0;
        for(i=0,i<=SIZE;i++)
        if(b[i]) outcome<=outcome+(a<<(i-1));
        end
endmodule

为何总出现如下错误;

Error (10170): Verilog HDL syntax error at mult_for.v(8) near text "<=";  expecting "="
Error (10170): Verilog HDL syntax error at mult_for.v(8) near text "+";  expecting "<=", or "="

 

 

最好用 i=i+1

 

posted on 2015-01-01 17:02  s010101  阅读(3247)  评论(0编辑  收藏  举报

导航