HDLBites 第84题 异步复位D 触发器
https://hdlbits.01xz.net/wiki/Dff8ar
报错Error (10200): Verilog HDL Conditional Statement error at top_module
原代码如下
module top_module (
input clk,
input areset, // active high asynchronous reset
input [7:0] d,
output [7:0] q
);
always@(posedge clk or posedge areset )
begin
if(!areset)
q<=d;
else
q<='0;
end
endmodule
纠正:
复位信号areset在敏感事件表中 高(低)电平触发时,always语句块中必须对应高(低)电平
always@(posedge clk or posedge areset )
begin
if(areset)
q<='0;
else
q<=d;
end