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

Programmable Duty Cycle Generator

HardLogic CircuitBuild

Pulse width modulation forms the backbone of digital motor control and Class-D audio amplifiers. The programmable duty cycle generator produces a periodic signal whose high time is dynamically controlled by a digital input value.

The circuit operates on a continuous 16-cycle period driven by the system clock. For a given 4-bit input duty, the output pwm_out must remain high for the first duty cycles of the 16-cycle period and low for the remaining cycles. If duty is 0, the output remains continuously low. If duty is 15, the output is high for 15 cycles and low for 1 cycle. The internal cycle counter must reset to 0 when rst is asserted high, and pwm_out must be driven to 0 during reset.

Constraints

  • Implement a synchronous active-high reset.
  • The counter period must be exactly 16 clock cycles.
  • pwm_out must evaluate to 0 when rst is 1.

Topics

sequentialcounterpwm

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