Force S and R to be opposites and gate them with an Enable:
S=D⋅E,R=D⋅E
When E=1: S=D,R=D → Q=D (transparent).
When E=0: S=R=0 → hold. The forbidden state can never occur because S,R are complementary. But it is still level-triggered.
What distinguishes edge-triggered from level-triggered storage?
Edge-triggered (flip-flop) updates output only at a clock edge; level-triggered (latch) is transparent for a whole clock level.
Characteristic equation of a D flip-flop
Qn+1=D (next state = sampled input, independent of Qn).
Why chain two latches with opposite enables (master–slave)?
So exactly one is open at a time; the value is frozen at the edge, giving edge-triggered (non-transparent) behaviour.
Define setup time.
Minimum time D must be stable before the active clock edge to be captured reliably.
Define hold time.
Minimum time D must remain stable after the edge.
What is metastability?
An unstable state where Q hovers between 0 and 1, caused by violating setup/hold; resolves after unpredictable delay.
Formula for max clock frequency of a FF→logic→FF path
fmax=1/(tcq+tcomb+tsu).
How to make a D flip-flop toggle (÷2)?
Connect Q back to D; each edge inverts Q.
Why does edge-triggering enable safe shift registers?
The edge closes the input almost instantly, so data hops exactly one stage per clock instead of racing through.
What clock event triggers a positive-edge FF?
The rising (0→1) transition of the clock.
Recall Feynman: explain to a 12-year-old
Imagine a mailbox with a flap that snaps shut. A postman (the clock) walks past once every tick. At the exact moment he passes, whatever letter (D) is in your hand goes into the box — and the flap slams. For the rest of the time the box is locked: you can wave any letter around, nothing changes. When the postman comes again, the box swaps to your new letter. That "snap at the passing moment" is the edge. That's why the whole computer stays neat: everyone's mailbox updates together, once per tick.
Dekho, D flip-flop ek chhota sa 1-bit memory cell hai. Iska kaam simple hai: jab clock ka edge aata hai (positive-edge device me rising edge, yaani 0 se 1), tab wo input D ki value ko copy karke Q me daal deta hai — Qn+1=D. Baaki poore time, chahe clock high rahe ya low, D bhale hi hilta rahe, output freeze rehta hai. Isiliye ise "edge-triggered" bolte hain — sirf edge ke instant pe photo click hoti hai, bas.
Ab confusion yahin hoti hai: latch aur flip-flop same nahi hain. Latch level-triggered hota hai — jab tak enable high hai, Q transparently D ko follow karta rehta hai. Flip-flop edge pe lock kar deta hai. Yeh farak bahut important hai, kyunki agar shift register me sab latch transparent ho jayein toh data ek hi clock phase me saare stages ko cross kar jayega (race condition). Edge-triggering "ek tick me ek hop" guarantee karta hai. Isliye pura synchronous computer ek hi heartbeat pe chalta hai.
Banane ka tareeka: pehle SR latch (feedback = memory), phir gated D latch (forbidden state hata do, S=D,R=D), phir do latch ulta enable ke saath jodo — master-slave. Master CLK pe khulta, slave CLK pe. Edge ke waqt master freeze, slave open — bas edge behaviour mil gaya. Yaad rakho "master sote hai jab slave kaam karta hai".
Timing bhi dhyaan rakho: D ko edge se pehle setup time aur baad me hold time tak stable rehna chahiye, warna FF metastable ho jayega (0 aur 1 ke beech latak jayega). Aur max frequency nikalti hai fmax=1/(tcq+tcomb+tsu) se — kyunki ek clock period me data ko ek FF se nikalna, logic paar karna, aur agle FF ka setup satisfy karna, sab hona chahiye.