Transcript for:
Understanding Synchronizers and Failure Probabilities

We build synchronizers based on this waiting time of getting out meta stability. So we're going to have asynchronous inputs. Every user interface has a user pressing buttons, you know, even on your smartphone or on your computer, pressing the keypad at times that, you know, are varying depending on the clock edge. so the synchronizer's goal is to make the probability of failure low a synchronizer can never make the probability of failure zero so here's our d and we have some synchronizer here and then our output q that we're sending into the system so a synchronizer is built with two back-to-back flip-flops and basically the first one is the sampling flip-flop so this is sampling this metastable or this asynchronous input D and now we're going to allow it to regenerate using the feedback from the flip flop regenerate for some amount of time Tc minus T setup between those two flip flops allow it to do that regeneration again not either you know moving up to the rail or moving down to the rail during that cycle time really the cycle time minus the setup time and so now our time that we're waiting this t instead of just being a random t is our that waiting time that we're allowing it to regenerate is the cycle time minus the setup time over tau and then we still have so that we've just substituted um t or t waiting is tc minus t setup and so now we can calculate this probability of failure for our for our synchronizer and we also have two other measures which is the probability of failure per second so if every time we you know press a button we're going to get some probability failure if we're pressing that button n times per second we multiply that probability of failure times n per second and get the probability of failure per second so for example if we have you know dartboard there's uh you know the block anyway there's some probability that I'm going to hit some some some region in the dartboard maybe some you know block region then um let's say that that probability is 0.1 but there's just that probability and the probability of failure per second if I um if I throw that dart you know five times per second would have that times five and we get 0.5 is the probability of failure per second failures per second per second and so how many seconds would it take what's the mean time between failures well if i have half of a probability of 0.5 failures per second then one over that it would on average would take me two seconds to get a failure that's the mean time between between failures is one over the probability of failure per second or another example is if we toss a coin and we have right i want to see the probability of getting a heads on the coin um so that probability is you know half right half tails half you know 50 chance of getting heads 50 chance of getting tails and let's say that I toss that just once per second, then I have a probability failure per second of 0.5 failures per second. So clearly 1 over that, 1 over 0.5 failures per second is equal to 2 seconds of failure. So the mean time between failures for this example is two seconds. Here's an example synchronizer where we have two flip-flops. This is the sampling flip-flop and this flip-flop is allowing it to regenerate between samples, either the high rail or the low rail, because of the feedback in the flip-flop. And we have the parameters here, the cycle time, two nanoseconds, 500 megahertz frequency. T naught, tau. t setup and the number of events per second. So we can calculate the probability failure and the probability failure per second and the mean time between failures. We have our equations here and mean time between failures just went over that. We put our numbers in and we end up getting 5.6 times 10 to the minus 6 probability failure and multiply that by n to get the probability of failure per second and went over this to get our mean time between between failures and it ends up being mean time between failures is five hours so on average the system will fail every five hours could be sooner right it could fail in one second it could be later could fail you know after a year but on average the um the system will fail every five hours so You might ask the question, well, is that okay? If it's my computer and it's failing every five hours, I am probably going to return it. If it's some toy that I give to my kid who fails every five hours and they turn on and off, no safety hazard there. Maybe some frustration, but no safety hazard or some issue there. it does depend on the application so how would we drive this down even further well we could put another flip-flop so right this q is what's sending out to the system we put another flip-flop there flip-flop three well now instead of waiting you know 1.9 nanoseconds we're going to wait twice that we'll let it regenerate once and then whatever it got to it's going to keep regenerating there and so that doubles that but you can do the numbers on your own the the effect is exponential and so we can add flip-flops to increase that time we allow it to regenerate to either the high rail or the low rail and then here's our system sent out to the system only after it's after its high probability of being stable being a one or a zero