郝鑫 发表于 2011-5-4 20:01:51

新手急求!!!!!望高手给与解答

module count10a(outa,couta,en,clk,rst);
output outa;
output couta;
regcountb;
reg couta;
assign outa=countb;
input clk,rst,en;
always@(*)
if(!rst)        begin
                countb<=4'b0;
                couta<=1'b0;
        end
else
        if(en)
                begin
                        if(countb==9)
                                begin
                                        countb<=4'b0;
                                        couta<=~couta;
                                end
                        else
                                begin
                                        countb<=countb+1;
                                end
                end
        else
                begin
                        countb<=4'b0;
                        couta<=1'b0;
                end
endmodule
在用quartus编译的时候出现这个警告:Warning: Verilog HDL Always Construct warning at count10a.v(9): variable "couta" may not be assigned a new value in every possible path through the Always Construct.Variable "couta" holds its previous value in every path with no new value assignment, which may create a combinational loop in the current design.希望高手给与解决的方案,警告出现在红字上面
页: [1]
查看完整版本: 新手急求!!!!!望高手给与解答