RTL Studio Open IDE

Arithmetic & Math

8-Bit Saturating Adder

An 8-bit unsigned adder with configurable saturation and overflow detection.

About this block

Simulate it in the Verilog IDE

Easyverilogsimsyn

8-Bit Saturating Adder is a Verilog reference block in the Arithmetic & Math catalog. Adders, multipliers, dividers, ALUs, and arithmetic datapaths. Marked Easy: a small block you can read, simulate, and synthesize in one sitting.

This IP implements an 8-bit saturating adder with configurable saturation behavior. It supports both wrap-around arithmetic and clamping to the maximum unsigned value (255). The module includes an overflow flag to indicate when the result exceeds the 8-bit range.

This IP provides a robust solution for 8-bit arithmetic with saturation control. It is suitable for DSP applications where overflow handling is critical. The design is fully verified and ready for integration.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for 8-Bit Saturating Adder.
  2. Read the Verilog module in the editor. The catalog line for this block: An 8-bit unsigned adder with configurable saturation and overflow detection.
  3. Run the packaged testbench with the in-browser Verilator simulator, then open the VCD in the waveform viewer.
  4. Run Yosys in the same IDE for a generic netlist. Sky130 liberty mapping is a separate Pro library option.

RTL Studio is the Verilog simulator and IDE around this block: Slang lint, Verilator, VCD waveforms, and Yosys, in the browser. Simulation guide · Yosys guide.

Features

  • 8-bit unsigned addition.
  • Configurable saturation via saturate_en signal.
  • Overflow detection output.
  • Simple combinational logic implementation.
  • Comprehensive testbench with edge cases and random stress tests.

Ports

Port NameDirectionWidthDescription
aInput[7:0]First 8-bit operand
bInput[7:0]Second 8-bit operand
saturate_enInput1Enable saturation clamping
sumOutput[7:0]Resulting sum
overflowOutput1High if result > 255

Verification

The testbench covers the following scenarios:

Test CaseDescriptionExpected Result
TC1Normal addition (10 + 20)sum=30, overflow=0
TC2Saturating overflow (200 + 100)sum=255, overflow=1
TC3Wrap-around overflow (200 + 100)sum=44, overflow=1
TC4Max value saturation (255 + 255)sum=255, overflow=1
TC5Zero addition (0 + 0)sum=0, overflow=0
TC6Random stress testsConsistent results

All tests passed successfully in the simulation log.

More in Arithmetic & Math

All Arithmetic & Math blocks