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

BCD Counter: 7-Segment Decoder Integration

MediumLogic CircuitBuild

Digital clocks, multimeters, and industrial control panels rely on direct numeric readouts for human-machine interfaces. The BCD-to-7-segment subsystem translates a continuous clock pulse into a stable, base-10 visual output.

The circuit must increment its internal binary-coded decimal state from 0 to 9 on each rising edge of clk. Upon reaching 9, the next rising edge of clk must wrap the state back to 0. When the synchronous rst signal is high, the internal state must clear to 0 on the next rising clock edge.

The 7-bit output seg must continuously drive an active-high 7-segment display corresponding to the current state. The bit mapping for seg[6:0] is: bit 6 is g, bit 5 is f, bit 4 is e, bit 3 is d, bit 2 is c, bit 1 is b, and bit 0 is a.

The table below shows the required active-high segment encoding for the critical boundary values:

| Internal State | Active Segments | seg[6:0] (Binary) | seg (Decimal) | |----------------|-----------------|---------------------|-----------------| | 0 | a,b,c,d,e,f | 0111111 | 63 | | 1 | b,c | 0000110 | 6 | | 8 | a,b,c,d,e,f,g | 1111111 | 127 | | 9 | a,b,c,d,f,g | 1101111 | 111 |

Constraints

  • Implement a synchronous reset that clears the internal counter to 0.
  • The output must not glitch into hexadecimal values during the transition from 9 to 0.
  • Use active-high logic for the seg output.

Topics

decodercountersstate-machine

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