Simple Pulse Width Counter
Measuring the duration of physical events requires converting continuous signals into discrete clock intervals. A pulse width counter measures the active duration of an incoming signal and provides a digital value representing the time the signal remained asserted.
Implement a synchronous pulse width counter. The system operates on the rising edge of clk. The output count is an 8-bit unsigned integer.
- When the synchronous
rstis 1,countbecomes 0. - When
pulsetransitions from 0 to 1,countclears to 0 on that clock edge. - When
pulseis 1 and was 1 on the previous clock edge,countincrements by 1. - When
pulseis 0,countholds its previous value.
Constraints
- Use only synchronous logic triggered on the rising edge of
clk. - Do not use asynchronous resets.
- Implement the edge detection for
pulseinternally using a register.
Topics
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.