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

SR Flip-Flop from JK Flip-Flop

HardLogic CircuitBuild

Legacy control systems often require strict set/reset semantics where simultaneous assertion is a critical fault. Adapting a universal JK flip-flop to behave as a strict SR flip-flop requires direct input mapping and actively trapping the forbidden state.

The circuit must implement an SR flip-flop using a JK flip-flop as the core state element. The inputs S and R drive the state transitions. Because the SR protocol forbids simultaneous assertion, the condition S=1 and R=1 must be flagged as a violation. The underlying JK flip-flop will naturally toggle in this state, but the overall circuit must output an active-low error flag Err_n to indicate the forbidden configuration.

| S | R | Q_next | Err_n | |-----|-----|----------|---------| | 0 | 0 | Q | 1 | | 0 | 1 | 0 | 1 | | 1 | 0 | 1 | 1 | | 1 | 1 | ~Q | 0 |

Constraints

  • Use exactly one JK flip-flop for state retention.
  • Drive the S and R inputs directly into the JK flip-flop without additional combinational steering logic.
  • Use exactly one NAND gate to monitor the inputs and drive the Err_n violation flag.
  • Do not use any other logic gates.

Topics

Latches and Flip-FlopsState MappingConstraints

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