3.4.1 · HinglishSequential Circuits

SR latch operation

1,965 words9 min readRead in English

3.4.1 · Hardware › Sequential Circuits


WHY ek latch exist karta hai?

Set–Reset latch do control inputs ke saath sabse simple aisa loop hai:

  • S (Set) → output force karo.
  • R (Reset) → output force karo.

WHAT hai structure? (NOR version)

Figure — SR latch operation

Wiring (NOR version):

Ise aise padho: ", aur dusre output ka NOR hai; , aur ka NOR hai."


HOW behave karta hai? — truth table scratch se derive karna

Hum har row NOR rule se derive karte hain: NOR output 1 tabhi hota hai jab DONO inputs 0 hon.

Case 1: Hold ()

Maano abhi hai.

  • ✓ (1 rehta hai)
  • ✓ (0 rehta hai)

Yeh step kyun? Dono equations wahi values reproduce karti hain jo humne assume ki thi → state self-consistent hai = stable. Yeh ke liye bhi utna hi valid hai. Toh keep previous value (yeh hai memory).

Case 2: Set ()

  • .
  • Phir .

Yeh step kyun? Kisi bhi NOR input par 1 us gate ke output ko 0 force karta hai. Toh , force karta hai, jo phir dusre gate ko output karne deta hai. Result: ==== (Set).

Case 3: Reset ()

  • .
  • Phir .

Yeh step kyun? Set ke symmetric: , force karta hai. Result: ==== (Reset).

Case 4: Forbidden ()

  • aur .

Yeh step kyun? Dono outputs ek saath 0 ban jaate hain, toh aur ab complementary nahi hain — naming violate ho gayi. Isse bhi bura: agar aur phir ek hi waqt par drop kar jaayein, toh dono gates high jaane ki koshish karte hain, aur final state chhoti timing/gate-delay differences par depend karti hai → unpredictable / metastable. Isliye forbidden / invalid.

Characteristic equation derive karna

Hum ko ke function ke roop mein teen legal rows ke liye chahte hain:

"Set hone par 1 force karo; purani value rakho agar Reset nahi ho raha" se milta hai: Constraint sirf woh promise hai ki Set aur Reset ek saath press nahi karoge.


NAND version (active-LOW )

NAND rule: output 0 tabhi hota hai jab DONO inputs 1 hon (matlab output 1 hota hai agar koi bhi input 0 ho).

Inverted kyun? NAND ke saath 0 input high force hota hai, toh 0 active value hai. Sab kuch NOR latch ka logical dual hai — same behavior, inputs par 0 aur 1 ke roles swap hain.


Worked example: timing sequence trace karna (NOR latch)

Time ke saath inputs (har step mein, phir ), unknown se start karke, power up karte hain aur drive karte hain:

step S R action Q
0 0 1 Reset 0
1 0 0 Hold 0
2 1 0 Set 1
3 0 0 Hold 1
4 0 1 Reset 0

Step 1 kyun? Reset ke baad, . ke saath, Hold rule reproduce karta hai → toh 0 rehta hai bhaale koi input active na ho. Woh "sticking" bilkul wahi memory hai. Step 3 kyun? Set ke baad, ; Hold use par rakhta hai. Latch ne us Set ko yaad rakkha jo ek step pehle hua tha — proof hai ki woh ek bit store karta hai.




Recall Feynman: 12 saal ke bacche ko samjhao

Socho do bacche ek rope pakde hain, har ek doosre ko khada rakhne ke liye peechhe jhuk raha hai. Woh balance left jhuk sakta hai (use 1 kaho) ya right (use 0 kaho), aur ek baar jhukne ke baad woh khud-ba-khud jhuka rehta hai — yeh yaad rakhna hai. S button use left jhukne ke liye dhakka deta hai (1). R button use right jhukne ke liye dhakka deta hai (0). Agar tum kuch nahi dabate, woh waisi hi side jhuka rehta hai jaise pehle tha. Agar tum dono buttons ek saath dabate ho, dono bacche gir jaate hain aur koi nahi jaanta pehle kaun uthega — yeh woh "forbidden" move hai jo tumhe karna hi nahi chahiye.


Active recall

An SR latch is built from which cross-coupled gates (two variants)?
Do cross-coupled NOR gates (active-HIGH) YA do cross-coupled NAND gates (active-LOW).
Why can a latch store a bit while a plain gate cannot?
Outputs inputs mein feed back hote hain (ek loop), toh ek stable state khud ko re-assert karta rehta hai inputs remove hone ke baad bhi — combinational gates mein koi feedback nahi hota.
NOR SR latch: what does S=0, R=0 do?
Hold — Q apni previous value rakhta hai (yeh memory state hai).
NOR SR latch: what does S=1, R=0 do?
Set — Q = 1.
NOR SR latch: what does S=0, R=1 do?
Reset — Q = 0.
NOR SR latch: why is S=1, R=1 forbidden?
Q aur Q̄ dono 0 ban jaate hain (complementary nahi), aur agar dono inputs ek saath 0 par drop karein toh final state unpredictable/metastable hoti hai.
State the characteristic equation of an SR latch.
Q_next = S + (R̄)·Q_prev, valid constraint S·R = 0 ke under.
For a NAND (active-LOW) SR latch, which input combination is Hold?
S̄=1, R̄=1 (dono inputs HIGH) → Hold.
For a NAND SR latch, which combination is forbidden?
S̄=0, R̄=0 (dono inputs LOW) → dono outputs ko 1 force karta hai, invalid.
In the NOR latch, what does a logic 1 on any NOR input do?
Us gate ke output ko 0 force karta hai (NOR tabhi 1 output karta hai jab dono inputs 0 hon).
What is metastability in an SR latch?
Forbidden condition chhodne ke baad ek unstable in-between state, jahan output unpredictably settle hoti hai gate delays par depend karte hue.

Connections

  • Cross-coupled gates — woh general feedback trick jo saare latches ke peeche hai.
  • Gated SR latch — ek enable add karta hai taaki inputs tabhi matter karein jab gate high ho.
  • D latch — forbidden state hataata hai tie karke.
  • JK flip-flop — SR ke forbidden ko fix karta hai use toggle banaakar.
  • Flip-flop vs latch — level-triggered (latch) vs edge-triggered (flip-flop).
  • Metastability — deeper reason kyun dangerous hai.
  • NOR gate / NAND gate — primitive building blocks.

Concept Map

creates

wired as

produces

forces

forces

self-consistent stable

both HIGH

both HIGH

breaks

causes

Cross-coupled feedback loop

One-bit memory

Two NOR gates

Outputs Q and Q-bar

S Set input

Q=1 Set

R Reset input

Q=0 Reset

S=0 R=0

S=1 R=1 Forbidden

Q and Q-bar not complementary

Unpredictable metastable state