Home › Practice › Accelerators › Dot product with one multiplier
Dot product with one multiplier
EasyRTLAcceleratorssequential
Four multipliers cost chip area. If you are not in a hurry, one multiplier used four times in a row does the same job. Spending time to save area is the trade every accelerator designer makes, in both directions.
Concept first. Feed the two lists in one pair per clock tick. A running total starts with the first pair's product and grows by each later pair's product. After the fourth pair the total is the dot product. Example with other numbers: pairs (2,1), (0,5), (1,4), (3,0) give totals 2, 2, 6, 6, and the last one is the answer. The circuit needs a way to know a new list is starting: the input first is 1 on the first pair of every list.
The trick is in the first pair of a new list: the old total must be forgotten, but the first pair itself must still count.
rstis synchronous, active-high: on a risingclkwithrst=1,ybecomes 0.- Otherwise, on every rising
clkone paira,b(3-bit, unsigned) is taken in. Iffirst=1the total becomes justa*b. Iffirst=0the total grows bya*b. - Output
yis the running total (8 bits).
No install and no sign-up needed. You write your answer in the editor and Nishkam checks it.