module buzz ( CLK,BUZZ);
input CLK;
output BUZZ;
reg buzzout_reg;
reg [31:0] counter;
always @ (posedge CLK)
begin
counter=counter+1;
end
always @ (counter[6])
begin
buzzout_reg=!(counter[21]& counter[23]& ~counter[26]);
end
assign BUZZ=buzzout_reg;
endmodule
上诉程序的第二个always语句不是只要后面的counter【6】改变了就执行的吗?那为什么在第二个always中会用到counter【21】,counter[23],counter【26】的值呢,按理说应该这些值还没改变啊。 |