If D changes inside the setup and hold window, the flip-flop may capture neither 0 nor 1: its loop is left near the middle. There each inverter amplifies the offset and charges its node capacitance, so the offset grows at a rate proportional to itself. That is exponential growth, with a regeneration time constant τs: less node capacitance, or more drive current per volt of offset, makes τs smaller. A signal from another clock domain (a group of flip-flops driven by an unrelated clock) can change at any instant, so this happens occasionally.
RESOLUTION TIME
V(t)=V0et/τs⇒tres=τslnV0VL
Holds while the loop acts as a linear amplifier, taken to last until the offset reaches VL, with 0<V0<VL. V0: offset from the middle when the loop closes (V). τs: regeneration time constant (ps). VL: offset read as a logic level (V). Set V(tres)=VL and take ln of both sides.
A two-flip-flop synchroniser puts a second flip-flop right after the first, both on the clock of the receiving domain, with no logic between. The first one is allowed to go metastable. The second samples it one full period later, so the first has almost a whole period to resolve.
TIME AVAILABLE TO RESOLVE
tr=Tclk−tclk-q−tlogic−tsetup
Holds for a flip-flop that may go metastable feeding the next flip-flop, with no skew. Its output must cross logic of delay tlogic and reach a valid level tsetup before the next edge; in a synchroniser tlogic=0. Tclk: the receiving clock's period. All in ps or ns.
A failure needs two things. First, a data change must land within a short window T0 of a clock edge, close enough to leave the offset below VL. Second, the loop must need longer than tr. Approximately, a metastable flip-flop's Q settles tres later than its usual tclk-q after the edge, so it fails if tres>tr, that is ln(VL/V0)>tr/τs, or V0<VLe−tr/τs. Take V0 as proportional to how far from the balance instant (the change time that leaves the loop exactly at the middle) the change fell, with change times spread evenly, so V0 is equally likely to be anywhere from 0 to VL. The chance of the second condition is then VLe−tr/τs/VL=e−tr/τs.
FAILURE RATE AND MEAN TIME BETWEEN FAILURES
RMTBF=T0fclkfdatae−tr/τs=R1=T0fclkfdataetr/τs
Holds under the two assumptions above (changes unrelated to the clock; V0 spread evenly from 0 to VL). fdata changes per second each land in a window with chance T0fclk (T0 in s, fclk edges per second), and a fraction e−tr/τs of those outlast tr. R: failures per second; MTBF in s.