Synchronous vs asynchronous reset — explain with a D flip-flop
Synchronous vs asynchronous reset — explain with a D flip-flop
Model answer
- **Asynchronous reset:** the flop clears as soon as reset is asserted, independent of the clock. rst_n is in the sensitivity list. - **Synchronous reset:** the flop clears only at the active clock edge while reset is asserted. rst_n is **not** in the sensitivity list; it becomes extra logic (AND/mux) in front of D. {|l|l|l|}\hline Aspect & Asynchronous & Synchronous\\ \hline Sensitivity list & posedge clk or negedge rst\_n & posedge clk\\ \hline Reset takes effect & immediately & next clock edge\\ \hline Hardware & flop with CLR pin & plain flop + gate at D\\ \hline Concern & reset de-assertion (recovery/removal) & needs a running clock\\ \hline verilog // Asynchronous reset module dff_async (input clk, rst_n, d, output reg q); always @(posedge clk or negedge rst_n) if (!rst_n) q <= 1'b0; else q <= d; endmodule verilog // Synchronous reset module dff_sync (input clk, rst_n, d, output reg q); always @(posedge clk) if (!rst_n) q <= 1'b0; else q <= d; endmodule Diagram (TikZ):