We have defined a KxMxN MAC unit as a device which takes K signed M-bit numbers ($a_0, a_1, ..., a_{K-1}$) and K signed N-bit numbers ($b_0, b_1, ..., b_{K-1}$), and computes
$$a_0*b_0 + a_1*b_1 + ... + a_{K-1}*b_{K-1}$$
We have defined a KxMxN MAC unit as a device which takes K signed M-bit numbers ($a_0, a_1, ..., a_{K-1}$) and K signed N-bit numbers ($b_0, b_1, ..., b_{K-1}$), and computes $$a_0 \ast b_0 + a_1 \ast b_1 + ... + a_{K-1} \ast b_{K-1}$$
For making an KxMxN MAC unit, the number of output bits will be
@@ -10,84 +9,25 @@ First, to perform a signed multiplication, we use the modified Baugh-Wooley form
\url{https://web.ece.ucsb.edu/~parhami/pres_folder/f31-book-arith-pres-pt3.pdf}. A more clear representation of this method is shown at \url{https://en.wikipedia.org/wiki/Binary_multiplier#Signed_integers} with the exception of a missing 1 in the MSB of the last partial sum.
Using an example calculation with a 4-bit by 5-bit signed multiply with multiplicands `a` and `b`:
We have defined a 5x9x8 MAC unit as a device which takes 5 signed 9-bit numbers (a0, ..., a4) and 5 signed 8-bit numbers (b0, ..., b4), and computes a0*b0 + a1*b1 + a2*b2 + a3*b3 + a4*b4.
For making an KxMxN MAC unit, the number of output bits will be
ceil(log2(K * 2^M * 2^N)) = ceil(log2(K)) + M + N
For a 5x9x8 MAC unit, ceil(log2(5)) + 8 + 9 = 20 bits.
First, to perform a signed multiplication, the modified Baugh-Wooley form on slide 64 of
https://web.ece.ucsb.edu/~parhami/pres_folder/f31-book-arith-pres-pt3.pdf was used. A more clear representation of this method is shown at https://en.wikipedia.org/wiki/Binary_multiplier#Signed_integers with the exception of a missing 1 in the MSB of the last partial sum.
A corrected form for a 9-bit input `a` and an 8-bit input `b`: