
This project implements an 8-bit configurable exact and approximate multiplier with a 32-bit Multiply-Accumulate (MAC) unit, designed for the Tiny Tapeout SKY-26e shuttle using SKY130 130nm technology.
The design accepts two 8-bit input operands, A and B, and supports two multiplication modes: exact multiplication and approximate multiplication.
In exact multiplication mode, the two 8-bit operands are multiplied to generate a mathematically correct 16-bit product.
In approximate multiplication mode, the exact multiplication result is rounded to the nearest multiple of 16. This produces a reduced-precision result and demonstrates approximate multiplication.
The mode selection logic selects either the exact or approximate multiplication result and provides it to the output and MAC unit.
The MAC unit adds the selected 16-bit multiplication result to a 32-bit accumulator whenever the accumulation enable signal is activated.
The accumulator can be reset independently using a dedicated control input. The design also provides output selection logic to observe either the multiplication product or the accumulated result.
Since the Tiny Tapeout output interface is 8 bits wide, byte selection is used to access the different portions of the 16-bit product and 32-bit accumulator.
The main blocks are:
The approximate multiplication is implemented using the following rounding operation:
P = (A × B + 8) & 16'hFFF0
The design is intended for applications involving configurable multiplication and multiply-accumulate operations, where exact and approximate arithmetic modes can be selected.
| Signal | Function |
|---|---|
ui_in[7:0] |
8-bit operand input data |
uio_in[0] |
Operand selection: 0 = A, 1 = B |
uio_in[1] |
Operand load enable |
uio_in[2] |
Multiplication mode: 0 = Exact, 1 = Approximate |
uio_in[3] |
MAC accumulation enable |
uio_in[4] |
Accumulator reset |
uio_in[5] |
Output selection: 0 = Product, 1 = Accumulator |
uio_in[7:6] |
Output byte selection |
uo_out[7:0] |
Selected 8-bit output |
The operand load and accumulation controls are intended to be asserted for one clock cycle at a time.
The external reset signal rst_n resets the operand registers and accumulator. The dedicated accumulator reset input resets the accumulator independently without clearing the stored operands.
rst_n low.rst_n high.uio_in[0] = 0.ui_in.uio_in[1] for one clock cycle to load operand A.uio_in[0] = 1.ui_in.uio_in[1] for one clock cycle to load operand B.uio_in[2] = 0.uio_in[5] = 0.uio_in[2] = 1.uio_in[4].uio_in[3] for one clock cycle to accumulate the multiplication result.uio_in[5] = 1.uio_in[7:6] to observe the different bytes of the 32-bit accumulator.Example test case:
When A = 5 and B = 6:
The Cocotb testbench in test/test.py performs functional verification of the multiplier–MAC design, including exact multiplication, approximate multiplication, accumulation, output selection and accumulator reset.
The design has been verified through the Tiny Tapeout SKY-26e implementation flow.
The verification includes:
The RTL and gate-level tests completed successfully. The physical-design precheck also passed, and the final GDS layout was generated through the Tiny Tapeout SKY130 flow.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | Operand data bit 0 | Product or accumulator bit 0 | Operand select |
| 1 | Operand data bit 1 | Product or accumulator bit 1 | Load operand |
| 2 | Operand data bit 2 | Product or accumulator bit 2 | Exact or approximate mode |
| 3 | Operand data bit 3 | Product or accumulator bit 3 | MAC accumulate enable |
| 4 | Operand data bit 4 | Product or accumulator bit 4 | Accumulator reset |
| 5 | Operand data bit 5 | Product or accumulator bit 5 | Product or accumulator select |
| 6 | Operand data bit 6 | Product or accumulator bit 6 | Output byte select bit 0 |
| 7 | Operand data bit 7 | Product or accumulator bit 7 | Output byte select bit 1 |