Challenge - 5 Problems
Clock-to-Output Delay Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediateUnderstanding Clock-to-Output Delay in a Flip-Flop
Given the following Verilog code for a D flip-flop with a specified clock-to-output delay, what will be the output Q at time 15ns if the clock rises at 10ns and D is stable at 1 before the clock edge?
Verilog
module dff_with_delay(input clk, input d, output reg q); always @(posedge clk) begin #5 q <= d; // 5ns clock-to-output delay end endmodule
Attempts:
2 left
💡 Hint
Think about when the clock edge occurs and how the delay affects the output timing.
✗ Incorrect
The clock edge occurs at 10ns. The clock-to-output delay of 5ns means Q updates 5ns after the clock edge, so at 15ns Q changes to 1.
🧠 Conceptual
intermediateEffect of Clock-to-Output Delay on Timing
Which statement best describes the effect of clock-to-output delay in synchronous circuits?
Attempts:
2 left
💡 Hint
Consider when the output actually changes relative to the clock edge.
✗ Incorrect
Clock-to-output delay is the time from clock edge to output change, so it delays data availability to next logic.
🔧 Debug
advancedIdentify the Timing Issue in Flip-Flop Code
The following Verilog code models a flip-flop with a clock-to-output delay. However, simulation shows Q changes immediately at the clock edge, ignoring the delay. What is the cause?
Verilog
module dff(input clk, input d, output reg q); always @(posedge clk) begin q <= #5 d; // intended 5ns delay end endmodule
Attempts:
2 left
💡 Hint
Check how delays are interpreted in non-blocking assignments.
✗ Incorrect
In Verilog, delays after '<=' in non-blocking assignments are often ignored by simulators and synthesis tools, so the output updates immediately.
📝 Syntax
advancedWhich Verilog Code Correctly Models Clock-to-Output Delay?
Select the Verilog code snippet that correctly models a 3ns clock-to-output delay for a D flip-flop output Q.
Attempts:
2 left
💡 Hint
Consider the difference between blocking and non-blocking assignments and where delays are placed.
✗ Incorrect
Delay placed before non-blocking assignment '#3 q <= d;' delays the assignment by 3ns, correctly modeling clock-to-output delay.
🚀 Application
expertCalculate Total Data Path Delay Including Clock-to-Output Delay
A synchronous circuit has a flip-flop with a clock-to-output delay of 4ns feeding combinational logic with a delay of 6ns before the next flip-flop. The clock period is 20ns. What is the maximum allowable setup time for the next flip-flop to avoid timing violations?
Attempts:
2 left
💡 Hint
Use the formula: Clock period >= clock-to-output delay + combinational delay + setup time.
✗ Incorrect
Setup time = Clock period - (clock-to-output delay + combinational delay) = 20 - (4 + 6) = 10ns. But since the question asks for maximum allowable setup time, it is 10ns.
