-
I think I understand the sign extension, that happens because we are
working with numbers in two's complement and the most significant
bit must be propagated. (correct?)
Break down \$Y\$ such that \$Y=-y_3\cdot 2^3+\sum_{i=0}^2 y_i\cdot 2^i\$. But don't break down \$X\$. Just take it as a 2's complement signed value. Then \$X\cdot Y=y_0\cdot \underline{X\cdot 2^0}+y_1\cdot \underline{X\cdot 2^1}+y_2\cdot \underline{X\cdot 2^2}-y_3\cdot \underline{X\cdot 2^3}\$. Note that the first three lines are just a shifted version of \$X\$ (times an unsigned bit in \$Y\$) and, since \$X\$ is signed, the result must be sign-extended. The last term is again just a sign-extended result but in this case must be subtracted. This explains all four of the lines in case 1.
-
Why is the last line of partial products subtracting instead of
adding? Wouldn't it ruin multiplication between two positives? (I've
tested the circuit based on this demonstration and it works for two
positive numbers as well.)
See above.
-
My last question resides in the simplification of those 1s
$$\begin{align*}X\cdot Y&=\left(-x_3\cdot 2^3+\sum_{i=0}^2 x_i\cdot 2^i\right)\cdot \left(-y_3\cdot 2^3+\sum_{i=0}^2 y_i\cdot 2^i\right)
\\\\
&=x_3y_3\cdot2^6\\&\quad +\left(\sum_{i=0}^2 x_i\cdot 2^i\right)\cdot\left(\sum_{i=0}^2 y_i\cdot 2^i\right)\\&\quad-y_3\cdot\left(\sum_{i=0}^2 x_i\cdot 2^i\right)\cdot 2^3\\&\quad-x_3\cdot\left(\sum_{i=0}^2 y_i\cdot 2^i\right)\cdot 2^3
\\\\
&=x_3y_32^6+\sum_{i=0}^2 \sum_{j=0}^2 x_iy_j 2^{i+j}-y_32^3\sum_{i=0}^2 x_i 2^i-x_32^3\sum_{i=0}^2 y_i2^i
\end{align*}$$
Or, in table form:
$$\begin{matrix}
&2^7&2^6&2^5&2^4&2^3&2^2&2^1&2^0\\
\hline
\\
+&0&x_3y_3&0&0&0&x_2y_0&x_1y_0&x_0y_0
\\\\
+&0&0&0&0&x_2y_1&x_1y_1&x_0y_1&0
\\\\
+&0&0&0&x_2y_2&x_1y_2&x_0y_2&0&0
\\\\
-&0&0&x_2y_3&x_1y_3&x_0y_3&0&0&0
\\\\
-&0&0&x_3y_2&x_3y_1&x_3y_0&0&0&0
\end{matrix}$$
Complement and increment the last two lines:
$$\begin{matrix}
&2^7&2^6&2^5&2^4&2^3&2^2&2^1&2^0\\
\hline
\\
+&0&x_3y_3&0&0&0&x_2y_0&x_1y_0&x_0y_0
\\\\
+&0&0&0&0&x_2y_1&x_1y_1&x_0y_1&0
\\\\
+&0&0&0&x_2y_2&x_1y_2&x_0y_2&0&0
\\\\
+&1&1&\overline{x_2y_3}&\overline{x_1y_3}&\overline{x_0y_3}&1&1&1
\\\\
+&0&0&0&0&0&0&0&1
\\\\
+&1&1&\overline{x_3y_2}&\overline{x_3y_1}&\overline{x_3y_0}&1&1&1
\\\\
+&0&0&0&0&0&0&0&1
\end{matrix}$$
Combine the constants:
$$\begin{matrix}
&2^7&2^6&2^5&2^4&2^3&2^2&2^1&2^0\\
\hline
\\
+&0&x_3y_3&0&0&0&x_2y_0&x_1y_0&x_0y_0
\\\\
+&0&0&0&0&x_2y_1&x_1y_1&x_0y_1&0
\\\\
+&0&0&0&x_2y_2&x_1y_2&x_0y_2&0&0
\\\\
+&0&0&\overline{x_2y_3}&\overline{x_1y_3}&\overline{x_0y_3}&0&0&0
\\\\
+&0&0&\overline{x_3y_2}&\overline{x_3y_1}&\overline{x_3y_0}&0&0&0
\\\\
+&1&0&0&1&0&0&0&0
\end{matrix}$$
Clear, now?