我在寫代碼來實現異步復位d flipfip,但[email protected]
線呈現出語法錯誤:異步復位d觸發器代碼語法錯誤
`timescale 1ns/1ps
module Dflipflop(
input D,
input reset,
input clk,
output Q
);
reg Q;
initial
begin
if(reset==1) //clear the output (Q=0)
begin
Q <= 0;
end
else if(reset==0)
begin
[email protected](posedge clk) //syntax error here...
begin
Q <= D;
end
end
end
endmodule
可能是什麼可能的錯誤,並有更好的邏輯來實現它嗎?