Forum Discussion
Altera_Forum
Honored Contributor
8 years ago --- Quote Start --- According to .sta.rpt Fmax for this is 307 MHz which is less than 50% of the datasheet listed max speed... wbr Kusti
always @(posedge sys_clk) begin
if (($signed({1'd0, e}) | (counter >= $signed({1'd0, 1'd0})))) begin
product <= (a * b);
accum_product <= (accum_product + product);
accum_in_a <= (accum_in_a + a);
accum_in_b <= (accum_in_b + b);
product_accum_in_a_and_b <= (accum_in_a * accum_in_b);
end
--- Quote End --- There is one possible improvement: register 'a' and 'b':
rega <= a
regb <= b
product <= rega * regb
Perhaps also do the same for the second multiplication. Depending on the size of the vectors the additions may turn out to be slow, you may want to write some code to pipeline the additions too. The ultimate speed is obtained when there is only one LUT between each register.