Arithmetic & Math
8x8 Multiply-Accumulate (16-bit Acc) — L2 Upgrade
8x8 Multiply-Accumulate unit with 16-bit accumulator, sticky saturation flag, and clear input.
About this block
Simulate it in the Verilog IDE
8x8 Multiply-Accumulate (16-bit Acc) — L2 Upgrade is a Verilog reference block in the Arithmetic & Math catalog. Adders, multipliers, dividers, ALUs, and arithmetic datapaths. Marked Medium: more state or a wider datapath, still one workspace in the IDE.
This IP provides a robust, saturated 8x8 MAC unit with a 16-bit accumulator and sticky flagging.
It is suitable for DSP pipelines where overflow handling is critical.
The design is synchronous, easy to integrate, and fully verified via a self-checking testbench.
- Arithmetic: Computes
a * b(8-bit unsigned) and accumulates the result into a 16-bit register. - Saturation Logic: Clamps the accumulator to
16'hFFFFon unsigned overflow. - Sticky Saturation Flag: The
sat_flagoutput goes high on any saturation event and remains high until explicitly cleared. - Control Signals:
- Choose Open in IDE. RTL Studio loads the packaged workspace for 8x8 Multiply-Accumulate (16-bit Acc) — L2 Upgrade.
- Read the Verilog module in the editor. The catalog line for this block: 8x8 Multiply-Accumulate unit with 16-bit accumulator, sticky saturation flag, and clear input.
- Run the packaged testbench with the in-browser Verilator simulator, then open the VCD in the waveform viewer.
- 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.
Verification
The provided testbench (tb_mac_8x8_accumulate_16_sticky_sat_flag.v) is self-checking and verifies the following scenarios:
| Test Case | Description | Expected Result |
|---|---|---|
| TC1 | Reset and Load | TC1 PASS Load |
| TC2 | Basic Accumulation | TC2 PASS Accumulation |
| TC3 | Saturation on Overflow | TC3 PASS Saturation |
| TC4 | Sticky Sat Flag Clear | TC4 PASS Clear Sat Flag |
| TC5 | Normal Accumulation after Clear | TC5 PASS Accumulation after clear |
### Running Simulation
- Compile the RTL and Testbench.
- Run the simulation.
- Check the log output for:
Integration
- Timing: The design is fully synchronous. Ensure setup and hold times are met for
load,clear_sat, andenrelative toclk. - Reset:
rst_nis active-low and synchronous. The design assumes a stable reset duration. - Overflow Behavior: Only unsigned overflow is detected. Signed overflow is not handled.
More in Arithmetic & Math
- 1-Bit Full Adder
- 1-Bit Full Adder — L1 Upgrade — L2 Upgrade
- 1-Bit Half Adder
- 16-Bit Carry-Select Adder
- 16-Bit Signed Adder with Overflow
- 2-Bit Saturating Up/Down Counter — L2 Upgrade
- 32-Bit Count Leading Zeros
- 32-Bit Equality Comparator — L1 Upgrade — L2 Upgrade
- 32-Bit Population Count — L1 Upgrade — L2 Upgrade
- 4-bit Adder-Subtractor with Overflow
- 4-Digit BCD Adder with Carry Propagation — L2 Upgrade
- 4-Input 8-Bit Adder Tree — L2 Upgrade
- 8-Bit Absolute Value — L1 Upgrade
- 8-Bit ALU Slice with Add/Sub and Logic Ops — L2 Upgrade
- 8-Bit Carry-Save Adder (3:2) — L2 Upgrade
- 8-Bit Count Trailing Zeros — L1 Upgrade — L2 Upgrade