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

Master-Slave vs. Edge-Triggered DFF: Glitch Rejection Comparison

MediumLogic CircuitTiming Diagram

Legacy master-slave flip-flops suffer from "1s-catching" where glitches during the high clock phase corrupt the captured state, a flaw solved by modern edge-triggered designs. Four signals are shown: CLK (clock, period 2), D (input data), Q_MS (legacy pulse-triggered output, initially 0), and Q_EDGE (modern edge-triggered output, initially 0). Q_MS captures a 1 if D is 1 at any point while CLK is 1, and updates its output on the step CLK transitions LOW. Q_EDGE samples D from the step immediately prior to CLK transitioning HIGH, and updates its output on the step CLK transitions HIGH. Trace both Q_MS and Q_EDGE across all 12 time steps.

Constraints

  • Q_MS updates its output only on the step CLK transitions from 1 to 0.
  • Q_EDGE updates its output only on the step CLK transitions from 0 to 1.
  • If D is 1 during any step where CLK is 1, the master stage of Q_MS catches it and will output 1 on the subsequent falling edge.

Topics

latchessequential-logicflip-flopsclocking

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