Implement S-R, T, and D Flip-Flops Using a JK Flip-Flop (and State-Table Implementations)
A JK flip-flop is a universal sequential element whose next-state behavior is governed by its characteristic equation:
2
We will use this equation (and the JK “operation modes”: hold/set/reset/toggle) to implement three other flip-flop behaviors by driving the JK inputs and with combinational logic built from the target inputs and the present state . 2
Key terms: JK flip-flop Characteristic equation Excitation/transition design.
Footnotes
-
electronicforu: JK Flip Flop Circuit, Truth Table, Limitations, and Uses - Provides the characteristic equation . ↩ ↩2
-
CS UCR PDF: Latches and Flip-Flops (Flip-Flop notes) - States JK characteristic equation derivation and . ↩ ↩2
JK Flip-Flop characteristic equation (and excitation-style reasoning)
We’ll proceed in layers:
- Define desired behavior for S-R, T, and D.
- Substitute into the JK characteristic equation to derive and .
- Validate with state tables (present-state vs next-state ).
We also use the practical mapping that the JK inputs correspond functionally to SR-style set/reset when exactly one of them is asserted, while causes toggle.
Footnotes
-
Electronics-Tutorials.ws: JK Flip Flop and Master-Slave JK Flip Flop Tutorial - Explains JK vs SR and toggle when both inputs are asserted. ↩
Target behaviors (state tables)
S-R (Set/Reset) flip-flop behavior
For a standard clocked SR flip-flop (no “invalid” simultaneous S and R):
- If then (set)
- If then (reset)
- If then (hold)
- If the behavior depends on the specific SR convention; in SR latches it is invalid, while JK resolves this via toggle. For our implementation, we will explicitly choose a safe mapping that avoids ambiguity by embedding the desired logic into JK. 2
T flip-flop behavior
A T flip-flop toggles when and holds when , i.e.:
D flip-flop behavior
A D flip-flop has next state equal to the input:
Key terms: Set Reset Toggle.
Footnotes
-
CS120b flipflops.pdf (same source section) - Notes SR undefined vs JK toggling when both inputs asserted. ↩
-
Electronics-Tutorials.ws: JK Flip Flop and Master-Slave JK Flip Flop Tutorial - Explains JK vs SR and toggle when both inputs are asserted. ↩
-
GeeksforGeeks: T Flip Flop - Gives T flip-flop behavior and characteristic equation . ↩
-
GeeksforGeeks: D Flip Flop - States D flip-flop characteristic equation . ↩
Derive J and K for each target flip-flop using the JK characteristic equation
- 1Step 1
Use as the constraint on desired next-state.
- 2Step 2
Express in terms of the target inputs (S,R or T or D) and optionally .
- 3Step 3
Choose so the term produces the required behavior when , and choose so the term produces the required behavior when .
- 4Step 4
For each present state , substitute and confirm the resulting matches the target truth/state table.
1) Implement an S-R flip-flop using a JK flip-flop
A common functional conversion is to drive the JK inputs with the SR signals:
Then the JK characteristic equation yields the correct SR-style behavior:
- With :
- With : which equals 1 only when .
This produces: set/hold/reset behavior when takes on the SR-valid combinations. 2
State table validation (S-R implementation)
Assume , .
| S | R | Qn | Qn+1 from JK (J=S, K=R) | Operation |
|---|---|---|---|---|
| 0 | 0 | 0 | Hold (0→0) | |
| 0 | 0 | 1 | Hold (1→1) | |
| 1 | 0 | 0 | Set (0→1) | |
| 1 | 0 | 1 | Set (1→1) | |
| 0 | 1 | 0 | Reset (0→0) | |
| 0 | 1 | 1 | Reset (1→0) |
For the remaining combination , a JK flip-flop will toggle when both inputs are asserted ().
So, if you must emulate a strictly “no-invalid-condition” SR device, avoid applying or add external gating to force it into a safe condition.
JK-to-SR mapping.
Footnotes
-
Electronics-Tutorials.ws: JK Flip Flop and Master-Slave JK Flip Flop Tutorial - Describes functional relationship of J like S and K like R (supports SR-style mapping). ↩ ↩2
-
electronicforu: JK Flip Flop Circuit, Truth Table, Limitations, and Uses - Provides the characteristic equation . ↩
-
CS120b flipflops.pdf (same source section) - Notes SR undefined vs JK toggling when both inputs asserted. ↩
About the SR invalid condition
"In SR latches, is typically invalid, but JK eliminates the undefined case by toggling when . If your design requires SR invalid-state avoidance, gate and so ." 2
Footnotes
-
Electronics-Tutorials.ws: JK Flip Flop and Master-Slave JK Flip Flop Tutorial - Explains JK vs SR and toggle when both inputs are asserted. ↩
-
CS120b flipflops.pdf (same source section) - Notes SR undefined vs JK toggling when both inputs asserted. ↩
2) Implement a T flip-flop using a JK flip-flop
A T flip-flop is equivalent to a JK flip-flop with both inputs tied together:
Then when , ⇒ hold; when , ⇒ toggle. 2
State table validation (T implementation)
Assume .
| T | Qn | Qn+1 (JK with J=K=T) | Operation |
|---|---|---|---|
| 0 | 0 | 0 | Hold |
| 0 | 1 | 1 | Hold |
| 1 | 0 | 1 | Toggle (0→1) |
| 1 | 1 | 0 | Toggle (1→0) |
Toggle (T).
Footnotes
-
GeeksforGeeks: T Flip Flop - Gives T flip-flop behavior and characteristic equation . ↩ ↩2
-
Rohini College of Engineering PDF (T flip-flop section) - Provides T flip-flop next-state rules ( hold, toggle). ↩
-
CS120b flipflops.pdf (same source section) - Notes SR undefined vs JK toggling when both inputs asserted. ↩
Fast design shortcut
"To build a T flip-flop from JK, just wire and together to the T input: , . The JK 'toggle when J=K=1' property guarantees correct behavior." 2
Footnotes
-
CS120b flipflops.pdf (same source section) - Notes SR undefined vs JK toggling when both inputs asserted. ↩
-
GeeksforGeeks: T Flip Flop - Gives T flip-flop behavior and characteristic equation . ↩
3) Implement a D flip-flop using a JK flip-flop
A D flip-flop requires:
One standard JK-to-D conversion is:
Verification via the JK characteristic equation:
- If :
- If : because .
So in all cases , independent of . 3
State table validation (D implementation)
| D | Qn | Choose J=D, K=D’ | Qn+1 from JK | Operation |
|---|---|---|---|---|
| 0 | 0 | J=0, K=1 | Set to 0 | |
| 0 | 1 | J=0, K=1 | Reset to 0 | |
| 1 | 0 | J=1, K=0 | Set to 1 | |
| 1 | 1 | J=1, K=0 | Set to 1 |
[D storage]{def="Next-state equals input, , independent of present state"}.
Footnotes
-
GeeksforGeeks: D Flip Flop - States D flip-flop characteristic equation . ↩ ↩2
-
electronicforu/conversion table excerpt (JK/D relations) - Shows JK-style conversion patterns including JK-to-D mapping logic (contextualized in conversion discussion). ↩ ↩2
-
electronicforu: JK Flip Flop Circuit, Truth Table, Limitations, and Uses - Provides the characteristic equation . ↩
Summary: J and K wiring for each target flip-flop
| Target flip-flop | Desired next-state rule | JK input wiring |
|---|---|---|
| SR | Set/Reset/Hold based on S,R | , |
| T | Toggle when else hold | , 2 |
| D | always | , |
Key terms: Next-state State table Combinational driving.
Footnotes
-
Electronics-Tutorials.ws: JK Flip Flop and Master-Slave JK Flip Flop Tutorial - Describes functional relationship of J like S and K like R (supports SR-style mapping). ↩
-
GeeksforGeeks: T Flip Flop - Gives T flip-flop behavior and characteristic equation . ↩
-
Rohini College of Engineering PDF (T flip-flop section) - Provides T flip-flop next-state rules ( hold, toggle). ↩
-
electronicforu/conversion table excerpt (JK/D relations) - Shows JK-style conversion patterns including JK-to-D mapping logic (contextualized in conversion discussion). ↩
Implementation nuances and edge cases
Knowledge Check
For a JK flip-flop with characteristic equation , which wiring implements a D flip-flop (so that )?