Electronic – Flip-flop feedback timing problem

digital-logicflipfloplatchsequential-logic

So this is my first question here.

I am reading this book, "Digital Electronics & Computer Design – By M.M. Mano". While I was reading the Sequential logic and flip-flops, I found this:

The feedback path between combinational circuit and memory elements(flip-flops) in a sequential circuit can produce instability if the outputs of memory elements are changing while the outputs of the combinational that go to flip-flop inputs are being sampled by the clock pulse.

I didn't understand this statement. So I googled and found a similar statement at circuitstoday.

If a clock pulse is given to the input of the flip flop at the same time when the output of the flip flop is changing, it may cause instability to the circuit.

I tried to get my head around this but didn't come up with any idea that gets me peace. I'm confused especially with this "the outputs of memory elements are changing or when the output of the flip flop is changing. What does it mean? Because the output of a flip-flop will only change if there's a change applied on input signal. It will not change by itself.

So I came up here. Please help me with this context. Any help would be appreciated.

Best Answer

It means that the input to flip flop must be stable for some amount of time before (setup time) and after (hold time) the clock edge. If the input is changing when there is a clock edge, it cannot sample it reliably as logic 1 or logic 0, and depending on what kind of paths the clock and data propagates inside the flip flop, there might be a short glitch on the output, or the inverting and non-inverting outputs could output same data while they should output complementary data.

The output of the flip flop will update to new state only after some propagation time, so if there is a feedback from flip flop output back to input, it means that the clock edges must not happen too rapidly, so that the output has been stable for enough time to satisfy the input setup time, and the flip flop output must not change too early to satisfy the input hold time as well.