J-K Master- Slave
Definition
A J-K master-slave flip-flop is a clocked sequential circuit made by connecting two level-sensitive J-K latches in series such that the first latch (master) samples the inputs when the clock is active, and the second latch (slave) updates the output when the clock becomes inactive. This arrangement prevents race-around and allows the output to change only once per clock pulse.
Main Content
1. J-K Flip-Flop Basics
- The J-K flip-flop is an improved version of the SR flip-flop.
- It has two inputs:
- J: behaves like the Set input
- K: behaves like the Reset input
- Unlike the SR flip-flop, the J-K flip-flop allows the input combination J = 1 and K = 1, which causes the output to toggle instead of producing an invalid condition.
The basic behavior is:
| J | K | Next Output |
|---|---|---|
| 0 | 0 | No change |
| 0 | 1 | Reset (Q = 0) |
| 1 | 0 | Set (Q = 1) |
| 1 | 1 | Toggle |
This makes the J-K flip-flop more versatile than SR flip-flops. It can be used in:
- counters
- frequency dividers
- shift registers
- control circuits
However, when the clock remains active for too long, a simple level-triggered J-K flip-flop may toggle repeatedly within the same clock pulse. This unwanted repeated toggling is called the race-around problem. The master-slave structure solves this issue.
2. Master-Slave Arrangement
- The circuit uses two latches:
- Master latch
- Slave latch
- These latches are controlled by opposite phases of the clock.
- When the clock is high, the master is active and the slave is inactive.
- When the clock is low, the slave becomes active and transfers the stored master state to the output.
A simplified structure:
J, K Inputs ---> [ Master J-K Latch ] ---> [ Slave J-K Latch ] ---> Q
Clock Inverted Clock
How it works:
- During the first half of the clock cycle, the master captures the input condition.
- During the second half, the slave copies the master's stored state to the final output.
- Since the slave does not respond while the master is active, feedback from the output cannot cause repeated toggling during the same clock pulse.
This division of operation into two phases is the key reason the master-slave flip-flop is so useful.
3. Race-Around Problem and Its Solution
- The race-around problem occurs in a level-triggered J-K flip-flop when:
- J = 1
- K = 1
- clock pulse width is long
- In that case, the output may keep toggling as long as the clock remains active.
Example:
- Suppose Q starts at 0.
- With J = K = 1, the flip-flop toggles to 1.
- If the clock is still active, it toggles again back to 0.
- This may continue multiple times during one clock pulse.
Why this is bad:
- Output becomes unpredictable.
- Timing is no longer stable.
- The circuit may behave incorrectly in sequential systems.
How master-slave removes it:
- The master changes state during one clock phase only.
- The slave updates output only after the master has finished.
- Since the two stages are not active simultaneously, feedback cannot trigger repeated toggles in the same pulse.
This makes the output change once per clock cycle, giving clean and controlled operation.
Working / Process
1. Input sampling by the master
- When the clock is in its active state, the master latch becomes enabled.
- It reads the J and K inputs and stores the corresponding internal state.
- The slave remains disabled at this time, so the external output does not change yet.
2. Transfer from master to slave
- When the clock switches to the opposite level, the master stops responding.
- The slave latch becomes enabled.
- The slave copies the master’s stored state and updates the output Q.
3. Output stabilization
- After the slave updates, the output remains stable until the next clock cycle.
- Even if J and K inputs change immediately after, they do not affect the output until the next active master phase.
- This ensures one output transition per clock cycle and eliminates race-around.
A timing-style view:
Clock: ___----___----___----
Master: active off active
Slave: off active off
Q out: changes only when slave is enabled
Example operation:
- If J = 1, K = 0, the master stores a set condition.
- During the next phase, the slave sets Q = 1.
- If J = 0, K = 1, the master stores reset.
- The slave later forces Q = 0.
- If J = 1, K = 1, the master stores a toggle request, and the slave toggles the output once on the proper phase.
Advantages / Applications
- Eliminates the race-around problem, making the circuit more reliable than a simple level-triggered J-K flip-flop.
- Provides controlled and stable output transitions, with output changes synchronized to the clock cycle.
- Used in counters, registers, and other sequential circuits where precise storage and timing are required.
Additional practical uses include:
- digital clocks
- frequency division circuits
- toggle-based control logic
- memory and timing elements in synchronous systems
Why it matters in design:
- It demonstrates the principle of edge-like behavior using two level-sensitive latches.
- It helps students understand how sequential circuits store state over time.
- It forms the basis for understanding more modern edge-triggered flip-flops.
Summary
- The J-K master-slave flip-flop stores one bit of data using two latches controlled by opposite clock phases.
- It solves the race-around problem by ensuring only one stage is active at a time.
- It is an important sequential logic circuit used in timing and storage applications.
- Important terms to remember: J input, K input, master latch, slave latch, clock, race-around, toggle