Clocked SR Flip-Flop Using a Master–Slave Flip-Flop: Explanation, Timing, and Truth-Table Reasoning
A SR flip-flop is the basic memory element controlled by S and R. An SR latch is typically level-sensitive, meaning it can change output whenever its enable/clock level permits, which can create the race problem when a clock is used directly.
A clocked SR flip-flop is designed so that the outputs update at a safer time (often modeled as edge-triggered). One classic construction to achieve this is the master–slave flip-flop: a master latch captures inputs during one clock phase, and a slave latch transfers the captured value to the output during the opposite phase, preventing “simultaneous” feedback from causing indeterminate race outcomes.
Mermaid overview of the idea:
Key terms:
- race condition
- edge-triggering
- level-sensitive latch
⚠️ Note: Many textbooks describe master–slave as producing behavior equivalent to edge-triggering, even though internally it uses level-sensitive latches with phased enables.
Master–Slave Flip-Flop (Conceptual Explanation)
Why an SR latch can race under clocking
An SR latch has two cross-coupled elements, so feedback is immediate. If you build a “clocked SR latch” by simply gating the SR inputs with the clock (or enable) and letting the same latch both (a) accept S/R changes and (b) resolve feedback during the same clock level, then S/R may change while Q is also changing, producing ambiguity in the intermediate time.
The master–slave architecture avoids that by ensuring:
- During one clock phase, only the master responds to S/R; the slave output is effectively isolated.
- During the other clock phase, the master is isolated, and only the slave responds—now using the stable master state.
Master–slave SR flip-flop: structure and phased operation
A typical master–slave SR flip-flop uses two SR latches:
- Master latch enabled when the clock is in one state (e.g., ).
- Slave latch enabled when the clock is in the opposite state (e.g., ), often via inverted clock or complementary enable signals.
Let:
- Master outputs be
- Final outputs be
During master-active phase:
- Slave is disabled → output holds (no transfer).
- Master updates based on .
During slave-active phase:
- Master is disabled → stay constant.
- Slave updates to match the stored master value → outputs change.
Key terms:
- transfer window
- enable gating
- complementary clock phases
Walkthrough: From SR inputs to clocked output using master–slave
- 1Step 1
When the clock is at the master’s active level, the master SR latch responds to and and updates . Because the slave is disabled, the external output holds its previous state.
- 2Step 2
When the clock switches to the slave’s active level, the master stops responding, freezing . The slave latch is now enabled and transfers that stored master value to the outputs .
- 3Step 3
If you view the moment the clock switches from one phase to the other as the “update edge,” the output effectively changes once per cycle, using the master’s captured value from the previous phase.
- 4Step 4
If and simultaneously, the SR latch is invalid/indeterminate. In a master–slave, this invalidity can still propagate when the slave is enabled, so system design must avoid .
- 5Step 5
If and , the master retains its state during its phase; then the slave transfers (or retains) that same state during its phase, yielding stable outputs.
Mapping SR latch behavior into a clocked SR flip-flop
For an SR latch, the usual behavior (conceptually) is:
- → set:
- → reset:
- → hold previous state
- → invalid (often leads to race/indeterminate state)
A clocked SR flip-flop using master–slave preserves the same logical outcomes for each valid input pattern, but the time when updates is governed by the transfer phase.
Mermaid timing intuition:
Clocked SR flip-flop behavior by (S,R) with master–slave transfer
Conceptual: Q updates only during the slave (transfer) phase; S/R validity is from SR latch rules.
Pro Tip: Think in two steps—capture then transfer
For any clocked SR flip-flop implemented as master–slave, first ask: “What does the master latch capture this phase?” Then ask: “When does the slave transfer it?” This mental model prevents most timing/race confusion.
Warning: $S=R=1$ must be avoided
In SR latch logic, and is typically invalid and can drive indeterminate behavior. Master–slave does not “fix” invalid SR combinations—it only shifts when they may affect outputs.
One clock cycle: capture (master) vs transfer (slave)
Master captures
Clock Phase AMaster enabled; outputs hold; determine . "
Roles swap
Clock TransitionMaster disables and slave enables (often modeled as an edge for system-level behavior)."
Slave transfers
Clock Phase BSlave enabled; outputs update to match . "
Common conceptual FAQs
Master–Slave Clocked SR Flip-Flop (Quick Check)
Knowledge Check
In a master–slave SR flip-flop, when does the external output Q update?