diff --git a/DA.sv b/DA.sv index e388fdf4b61d3859bfa6ad0978e9a2ea4d2acaab..987f25edf7b160465d7bd4c60248c07e47fa2b58 100644 --- a/DA.sv +++ b/DA.sv @@ -49,27 +49,27 @@ always_ff@(posedge ck, posedge rst) // ==== DA accumulator ==== always_ff @(posedge ck, posedge rst) - if (reset_accumulator) - begin - partial_sum <= '0; - shifted_out <= '0; - end - else - begin - if(compute) - begin - if(address < N-1) - begin - shifted_out <= {partial_sum[0], shifted_out[N-1:1]}; - partial_sum <= {partial_sum[(N-1)+8],partial_sum[(N-1)+8:1]} + multiplication_coefficients[multiplication_addresses[address]]; - end - else - begin - shifted_out <= {partial_sum[0], shifted_out[N-1:1]}; - partial_sum <= {partial_sum[(N-1)+8],partial_sum[(N-1)+8:1]} - multiplication_coefficients[multiplication_addresses[address]]; + if (reset_accumulator) + begin + partial_sum <= '0; + shifted_out <= '0; + end + else + begin + if(compute) + begin + if(address < N-1) + begin + shifted_out <= {partial_sum[0], shifted_out[N-1:1]}; + partial_sum <= {partial_sum[(N-1)+8],partial_sum[(N-1)+8:1]} + multiplication_coefficients[multiplication_addresses[address]]; + end + else + begin + shifted_out <= {partial_sum[0], shifted_out[N-1:1]}; + partial_sum <= {partial_sum[(N-1)+8],partial_sum[(N-1)+8:1]} - multiplication_coefficients[multiplication_addresses[address]]; + end end end - end // ==== DA accumulator ==== @@ -103,7 +103,7 @@ begin: SEQ end: SEQ always_comb - begin: COM +begin: COM load = '0; reset_accumulator = '0; output_ready = '0; @@ -137,7 +137,7 @@ always_comb end default : next_state = waiting; endcase - end: COM +end: COM // ==== state machine to control the FIR ==== endmodule \ No newline at end of file