Forum Discussion
Altera_Forum
Honored Contributor
12 years agoLets me show a code that's work may be can help you to locate the probleme:
generate
if(NUM_OF_TAPS == 4)
assign final_result_temp = final_additions;
else if (NUM_OF_TAPS == 8)
assign final_result_temp = final_additions + final_additions;
else if (NUM_OF_TAPS == 16)
assign final_result_temp = final_additions + final_additions + final_additions + final_additions;
endgenerate // after 16 taps this should addition should be done with registered stages
always @ (posedge clk or posedge reset)
begin
if (reset)
begin
final_result <= 0;
end
else if (clear == 1)
begin
final_result <= 0;
end
else
begin
final_result <= final_result_temp;
end
end This code it work very well. The change that i need is to calculate the final_result_temp result using a genereic code. That's mean avoid the using of the if statement. I hope that this code is more comprehensible. Thanks