|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
向高手请教
input clock,reset,overheat_in,pushbutton_in;
output overheat_out;
reg overheat_out;
reg pushbutton_sync1,pushbutton_sync2;
reg overheat_in_sync1,overheat_sync2;
always @(posedge clock or posedge reset)
begin
if(reset)
begin
pushbutton_sync1<=1'b0;
pushbutton_sync2<=1'b0;
overheat_in_sync1<=1'b0;
overheat_in_sync2<=1'b0;
end
else begin
pushbutton_sync1<=pushbutton_in;
pushbutton_sync2<=pushbutton_sync1;
overheat_in_sync1<=overheat_in;
overheat_in_sync2<=overheat_sync1;
end
end
always @(posedge clock or posedge reset)
begin
if(reset)
overheat_out<=1'b0;
else if(overheat_in_sync2 && pushbutton_sysnc2)
overheat_out<=1'b1;
end
endmodule
这里面第一个always有什么作用,没有它也是正确的啊 |
|