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.

Solve in your browser →

No install and no sign-up needed. You write your answer in the editor and Nishkam checks it.

More in this track

← Dot product of two lists of four2x2 matrix multiply →