Including reset in sensitivity list for sync reset
Using asynchronous sensitivity list for sync reset
Missing clock edge in always block
3. Given the following Verilog code, what will be the value of q after the asynchronous reset rst is deasserted?
reg q;
always @(posedge clk or posedge rst) begin
if (rst) q <= 1'b0;
else q <= d;
end
medium
A. q will immediately reset to 0 when rst is asserted, then follow d on clock edges.
B. q will reset to 0 only on the next clock edge after rst is asserted.
C. q will never reset because rst is asynchronous.
D. q will hold its previous value regardless of rst.
Solution
Step 1: Analyze asynchronous reset sensitivity
The always block triggers on posedge clk or posedge rst, so when rst is asserted, q resets immediately.
Step 2: Behavior after reset deassertion
After rst is deasserted, q updates on clock edges following the value of d.
Final Answer:
q will immediately reset to 0 when rst is asserted, then follow d on clock edges. -> Option A
Quick Check:
Async reset immediate, then sync update [OK]
Hint: Async reset triggers immediately, sync updates after [OK]
Common Mistakes:
Thinking async reset waits for clock edge
Assuming q holds value during reset
Confusing reset assertion and deassertion timing
4. Identify the error in this Verilog code snippet implementing a synchronous reset:
always @(posedge clk or posedge rst) begin
if (rst) q <= 0;
else q <= d;
end
medium
A. The assignment operator should be = instead of <=.
B. The reset condition should be checked outside the always block.
C. The clock edge should be negedge instead of posedge.
D. The reset should not be in the sensitivity list for synchronous reset.
Solution
Step 1: Check sensitivity list for synchronous reset
Synchronous reset should only be sensitive to the clock edge, not the reset signal.
Step 2: Identify the error
Including posedge rst makes the reset asynchronous, which contradicts the synchronous reset intent.
Final Answer:
The reset should not be in the sensitivity list for synchronous reset. -> Option D
Quick Check:
Sync reset sensitivity = clock only [OK]
Hint: Sync reset sensitivity list excludes reset signal [OK]
Common Mistakes:
Including reset in sensitivity list for sync reset
Misunderstanding sensitivity list purpose
Using blocking assignment instead of non-blocking
5. You need to design a flip-flop with a reset that must clear the output immediately when asserted, but also synchronize with the clock to avoid metastability issues. Which reset strategy is best and how should it be implemented?
hard
A. Use an asynchronous reset without synchronization.
B. Use a synchronous reset only, ignoring immediate reset requirement.
C. Use an asynchronous reset with a synchronizer circuit on the reset signal.
D. Use two separate resets: one async and one sync, both controlling the flip-flop.
Solution
Step 1: Understand immediate reset need
Immediate clearing requires asynchronous reset to react without waiting for clock.
Step 2: Avoid metastability by synchronizing reset
To prevent metastability, the asynchronous reset signal should be passed through synchronizer flip-flops before use.
Step 3: Combine both requirements
Using async reset with synchronizer achieves immediate reset and safe clock domain crossing.
Final Answer:
Use an asynchronous reset with a synchronizer circuit on the reset signal. -> Option C
Quick Check:
Async reset + synchronizer = immediate and safe reset [OK]
Hint: Async reset plus synchronizer avoids metastability [OK]
Common Mistakes:
Using only synchronous reset ignoring immediate reset
Using async reset without synchronization causing metastability
Trying to use two resets on same flip-flop incorrectly
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.