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

Symmetric Shift Register Debouncer

MediumLogic CircuitBuild

Mechanical switches and buttons exhibit physical bounce upon both actuation and release, requiring robust digital filtering before interfacing with synchronous logic. A symmetric debouncer ensures clean transitions by waiting for the line to settle completely in either direction.

The circuit samples din on every rising clock edge into a 4-bit history sequence. The output dout must transition to 1 only after observing four consecutive 1s on din. It must transition to 0 only after observing four consecutive 0s on din. For any mixed sequence of inputs indicating ongoing bounce, dout must hold its previous state.

| din_3 | din_2 | din_1 | din_0 | dout_next | |---------|---------|---------|---------|-------------| | 0 | 0 | 0 | 0 | 0 | | 1 | 1 | 1 | 1 | 1 | | 1 | 0 | 1 | 1 | dout | | 0 | 0 | 1 | 0 | dout |

Constraints

  • Implement a 4-bit shift register to capture the history of din.
  • Use a synchronous reset rst to clear all shift register bits and dout to 0.
  • Update dout only when the shift register contains exactly 1111 or 0000.

Topics

Shift RegisterInterfaceDebouncer

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