This repository presents an approximation technique for a 4x4 bit multiplier based on the methods described in the paper Design and Analysis of Approximate Multipliers. The final implementation satisfies the following criteria:
- Mean relative error: Less than 10%
- Number of LUTs: Less than 12
The exact half adder is approximated as follows:
-
Exact Implementation:
- Sum = A
$\oplus$ B - Cout = A
$\cdot$ B
- Sum = A
-
Approximated Implementation:
- Sum = A
$+$ B - Cout = A
$\cdot$ B
- Sum = A
| A | B | Exact | Approximate | ||
|---|---|---|---|---|---|
| Sum | Cout | Sum | Cout | ||
| 1 | 1 | 0 | 1 | 1 | 1 |
1 out of 4 cases has an error in Sum.
The exact full adder is approximated as follows:
-
Exact Implementation:
- Sum = A
$\oplus$ B$\oplus$ Cin - Cout = (A
$\cdot$ B)$+$ (B$\cdot$ Cin)$+$ (Cin$\cdot$ A)
- Sum = A
-
Approximated Implementation:
- Sum = B
- Cout = A
- Cin is not used.
| A | B | Cin | Exact | Approximate | ||
|---|---|---|---|---|---|---|
| Sum | Cout | Sum | Cout | |||
| 0 | 0 | 1 | 1 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 | 0 | 0 | 1 |
| 1 | 1 | 0 | 0 | 1 | 1 | 1 |
4 out of 8 cases have errors: 4 in Sum and 2 in Cout.
The approximation involves the transformation of partial product terms am,n and an,m ( am,n = a[m]
- pm,n = am,n
$+$ an,m - gm,n = am,n
$\cdot$ an,m - am,m terms are retained.
A compressor is used to simplify the partial product tree. It takes 4 input bits and a carry-in (Cin) bit and generates Sum, Carry, and Carry-out (Cout) bits. The exact compressor uses two full adders:
- The first full adder takes 3 input bits and generates:
- Intermediate Sum
- Carry-out (Cout)
- The second full adder takes:
- Intermediate Sum
- 4th input bit
- Carry-in (Cin)
and generates the final Sum and Carry bits.
The approximated compressor is defined as:
- Carry = Cin
- Sum = (A
$\oplus$ B)$+$ (C$\oplus$ D) - Carry-out (Cout) = (A
$\cdot$ B)$+$ (C$\cdot$ D)
| A | B | C | D | Cin | Exact |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der: 



The Cout for the last half adder is always 0.
After the partial product reduction, the remaining Sum and Carry-out bits are processed using half adders and full adders to generate the final output.
The following images demonstrate that the design meets the specified criteria for:
- Error: Mean relative error =
8.23%(less than 10%)
- Power Utilization:
40 mWfor logic (Efficient power usage)
- LUT Utilization: Number of LUTs =
9(less than 12)
Feel free to clone this repository and explore the implementation!








