Easy · Arithmetic02. Add without wrapping
A digital gain stage adds two unsigned samples. Saturate at full scale instead of wrapping back to zero.
Specification
- Inputs a and b and output y are 8-bit unsigned words.
- y=min(a+b,255). Keep the carry bit when computing the sum.
- All 65,536 input combinations are checked.
65,536 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.