Medium · Sequential logic03. Count accepted samples
Count accepted conversions while allowing the acquisition stream to pause. Reset must take priority over enable.
Specification
- Inputs clk, reset, enable; output q is a 4-bit register.
- On each rising clock edge: reset clears q; otherwise enable increments q modulo 16.
- Hold q when enable is low. Reset is synchronous and active high.
64 supplied checksRun uses the testbench in tb.sv. Submit checks your design with the original supplied testbench, even if you edit tb.sv.
Practice results stay in this browser. They do not count as server-verified scores.
Language and tools
Choose Verilog 2005 or SystemVerilog 2012. Icarus supports a subset of SystemVerilog; classes, UVM and full SVA are outside this runtime. Download the project to continue in OSS CAD Suite with Icarus, Yosys and GTKWave.
Open-source credits and runtime provenance
Drag the dividers to resize. Focus a divider and use its arrow keys for precise adjustments.