The definitions
A flip-flop samples its D input at the clock edge, but it needs the input to be steady for a short window around that edge:
- Setup time (t_su): how long D must be stable before the clock edge.
- Hold time (t_h): how long D must stay stable after the clock edge.
- Clock-to-Q delay (t_cq): how long after the edge the new value appears at Q.
If D changes inside the setup-hold window, the flip-flop may capture the wrong value or go metastable: its output hovers between 0 and 1 for an unpredictable time before settling. Timing analysis exists to make sure that never happens between flip-flops on the same clock.