Codiode

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.

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.

Part of Clocking and Synchronization

Problem 17 of 85 in the Clocking and Synchronization track.

Related problems

Browse all problems · Digital logic design practice problems · Learning tracks

Solve this on a laptopSend yourself the link and continue there.