Chargement…
Chargement…
Use a signed 9-bit accumulator A, signed 9-bit multiplicand M, 8-bit register Q, and bit Q-1. At each step: Q0,Q-1=01 adds M to A; 10 subtracts M; 00 or 11 leaves A unchanged. Then arithmetically shift the combined A,Q,Q-1 group right.
Load registers when i_start='1' and idle. Perform exactly eight steps. The signed 16-bit product is the useful A,Q portion after the last shift. o_done lasts one cycle and i_start is ignored while o_busy is active.
The testbench covers all four sign combinations, zero, and the -128, 127 extremes.