always@(negedge clk or negedge reset_b)
if(reset_b==0)state<=S_0;
else state<=next_state;
always@(state or B_in)begin
B_out=0;
case(state)
S_0:if(B_in==0)next_state=S_1;
else if(B_in==1)begin next_state=S_2;B_out=1;end
S_1:begin next_state=S_0;B_out=1;end
S_2:begin next_state=S_0;end
default:begin next_state=dont_care_state;B_out=dont_care_out;end
endcase
end
endmodule
为什么报错:
ERROR:HDLCompilers:44 - "nrz.v" line 42 Illegal left hand side of blocking assignment
ERROR:HDLCompilers:247 - "nrz.v" line 44 Reference to scalar wire 'B_out' is not a legal reg or variable lvalue
ERROR:HDLCompilers:44 - "nrz.v" line 44 Illegal left hand side of blocking assignment
always@(negedge clk or negedge reset_b)
if(reset_b==0)state <=S_0;
else state <=next_state;
always@(state or B_in)begin
B_out=0;
case(state)
S_0:if(B_in==0)next_state=S_1;
? ? else if(B_in==1)begin next_state=S_2;B_out=1;end
S_1:begin next_state=S_0;B_out=1;end
S_2:begin next_state=S_0;end
default:begin next_state=dont_care_state;B_out=dont_care_out;end
endcase
end
endmodule
为什么报错:
ERROR:HDLCompilers:44 - "nrz.v" line 42 Illegal left hand side of blocking assignment
ERROR:HDLCompilers:247 - "nrz.v" line 44 Reference to scalar wire 'B_out' is not a legal reg or variable lvalue
ERROR:HDLCompilers:44 - "nrz.v" line 44 Illegal left hand side of blocking assignment