So I was checking out sequential logic and I found two different circuits for flip flops (or latches, or both). Let's take D flip flop for my quesiton.
There's one circuit here, showing a D flip flop:
I found an issue here. Flip flops are meant to be edge triggered by clock. But here, suppose the clock is high, and the input changes during positive half cycle (let's say halfway). If Data changes, won't that reflect in the output immediately? There's really nothing stopping the output from changing.
One more important thing is that there's many places where this is called Gated D latch.
Another circuit:
This one is called Master Slave D Flip flop. What it basically does is:
- During negative cycle, master is enabled by clock, storing data.
- At the positive edge (transition), slave takes the input and propagates it to Q.
- Even if any changes in D occur during the positive half, nothing is reflected in Q.
Technically, isn't this what a flip flop is supposed to be? Edge triggered? Admittedly, it is a bigger circuit and is more cumbersome wrt design, area and number of gates & transistors. But the operation is as it should be (edge triggered)
Why do so many textbooks and online resources call the upper circuit a Flip Flop, when it basically works as a latch? Is there something that I am missing here?