Source
Adapted from my own handwritten and hand-typed notes from Year 1 to Year 3 of my EEE degree
Timing Parameters of a Flip-Flop
In a clocked sequential circuit the next state is and the clock decides when the state registers update. Besides gate delays, the timing of the inputs relative to the clock edge matters. A flip-flop datasheet gives:
- maximum and minimum propagation delay, clock to output (, )
- setup time : input must be stable before the clock edge
- hold time : input must stay stable after the clock edge

Meaning
Definitions:
- setup time is the minimum time the data must settle before the triggering edge, otherwise data can be missed or actions ignored
- hold time is the minimum time the data must remain stable after the triggering edge
- inside the window the input must not change
If either rule is broken the flip-flop may read a 1, a 0, or get stuck at an in-between level for a while. This is metastability, and it is dangerous because the result is unpredictable.
Two Timing Constraints
Consider a launching flip-flop FF1 driving combinational logic with delay into a capturing flip-flop FF2.

Setup constraint (slowest path, must arrive before the next edge):
Hold constraint (fastest path, must not arrive too early after the same edge):
Both margins must be for correct operation.
Things to note:
- delays are not constant, they change with supply voltage, temperature and process (VTP)
- the setup constraint is hardest when delays are at their maximum
- the hold constraint is hardest when delays are at their minimum, and it does not depend on the clock period at all, so slowing the clock cannot fix a hold violation
The setup constraint sets the Maximum Clock Frequency.