CodiodeCodiode
Home
Problem Solving
Skill Tracks
My Assignments
Contests
Leaderboard
Community
Settings
Codiode/Problems/Sequential Logic

Universal JK Flip-Flop Configuration

MediumLogic CircuitBuild

Configurable logic blocks in FPGAs rely on universal sequential elements that can adapt to different storage requirements. A single JK flip-flop acts as this universal base, capable of emulating D, T, and SR behaviors through specific input routing.

Construct a multi-mode sequential circuit using a single JK flip-flop. The 2-bit control signal mode_1 and mode_0 determines the active behavior by routing the appropriate external inputs D, T, S, or R to the flip-flop's internal J and K terminals. Output the flip-flop's state as Q.

| mode_1 | mode_0 | Active Mode | J Input | K Input | |----------|----------|-------------|-----------|-----------| | 0 | 0 | D Flip-Flop | D | ~D | | 0 | 1 | T Flip-Flop | T | T | | 1 | 0 | SR Latch/FF | S | R | | 1 | 1 | Hold State | 0 | 0 |

Note: In SR mode (mode_1 = 1, mode_0 = 0), the condition where S = 1 and R = 1 is forbidden and will not occur during testing.

Constraints

  • Use exactly one JK flip-flop.
  • Derive the J and K inputs using only basic combinational logic gates or multiplexers.
  • Do not instantiate any other flip-flops or latches.

Topics

Combinational LogicMultiplexersFlip-Flops

Solve this problem

Place the gates, wire them up and watch the signals settle. Every submission runs on the same simulation engine that grades it.

This problem is part of Codiode Pro. The statement above is free to read.

Sign in to solveSee what Pro unlocks

The circuit builder and code editor need a desktop screen. On a phone, read the problem here and open it on a laptop to solve.

Related problems

  • 3-bit Ripple Counter from Toggle Flip-FlopsEasy
  • D Latch from a 2:1 MUXEasy
  • 2-bit Ring CounterEasy
  • T Flip-Flop from a D Flip-FlopEasy
  • Handshake Deadlock Due to Early ResetHard
  • Reconvergence of Individually Synchronized BitsHard
  • Debug: Asynchronous Clear GlitchHard
  • Clock Gate Enable Crossing DomainsHard

Browse all problems · Learning tracks