Skip to content
BetterDL

Flip-flop conversion

Also called: converting flip-flops, flip-flop type conversion, JK to T conversion, D to T conversion, JK to D conversion

Making one type of flip-flop behave like another by driving its inputs with logic, e.g. D = T ⊕ Q turns a D flip-flop into a T flip-flop.

Flip-flop conversion means adding logic in front of one type of flip-flop so that, from outside, it behaves exactly like another type.

The general recipe:

  1. Write the target's next state as a characteristic equation, or as a table of Q⁺ for each input and Q.
  2. For each row, use the excitation table of the flip-flop you actually have to find the inputs that produce that Q⁺.
  3. Simplify each input as a function of the target's inputs and Q.

With a D flip-flop step 2 is trivial, since D = Q⁺. So to make a D flip-flop act like anything, drive D with that thing's Q⁺.

Common conversions:

  • D → T: D = .
  • D → JK: D = .
  • JK → T: tie J = K = T.
  • JK → D: J = D, K = .
  • T → JK: T = (change when J sets a 0 or K resets a 1).
  • D → register bit with load L and data N: D = .

Why it matters: real chips and FPGAs provide mostly D flip-flops, so designs that are easiest to think about with JK or T flip-flops are built this way. The same idea, "put the next-state logic in front of D", is how every register and state machine is built.

T
000
011
101
110

Worked examples

Example

Making a T flip-flop act like a D

You have a T flip-flop and want it to load a data input D at each edge. The table above gives the T input needed. Derive it.

  1. 1.

    The target is Q⁺ = D.

  2. 2.

    T must be 1 exactly when Q has to change, that is, when D differs from Q.

  3. 3.

    Rows: D = 0, Q = 0 → T = 0. D = 0, Q = 1 → T = 1. D = 1, Q = 0 → T = 1. D = 1, Q = 1 → T = 0.

  4. 4.

    That is XOR: T = .

Example

Making a D flip-flop act like an SR flip-flop

Drive D so the flip-flop sets when S = 1, resets when R = 1 and holds when both are 0. S and R are never both 1.

  1. 1.

    With a D flip-flop, D is just the wanted next state.

  2. 2.

    The SR next state is Q⁺ = .

  3. 3.

    So D = : an OR gate, an AND gate and an inverter in front of D, with Q fed back.

  4. 4.

    Check: S = 0, R = 1, Q = 1 gives D = 0 + 0 = 0, a reset. ✓

Common mistakes

  • Using the characteristic table of the flip-flop you have instead of its excitation table when working out the inputs.

  • Driving D with the target's input instead of its next state. D = T does not make a T flip-flop; the D input must be the target's Q⁺.

  • Forgetting to feed Q back. Most conversions need the present state as an input to the logic.

Practice Flip-flop conversion

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Flip-flop conversion is taught in Latches and Flip-Flops.