Forum Discussion
Altera_Forum
Honored Contributor
14 years agoSynthesis Problem
Hi everyone, I have the following code worked fine: byte i, temp;
for (i=20; i>=0; i--)
begin
temp = i;
Array = array;
end when I change it to: byte i, temp;
for (i=2...
Altera_Forum
Honored Contributor
14 years agoI am going to make an assumption that this is inside a clocked process (a little bit more info would be helpful).
When you run your for loop, the array index will always follow [i], so the result is: array[20]; .. array[19]; .. .. array[0]; but with your index as temp, you end up with temp = 20; .. temp = 19; .. .. temp = 0; In this case, temp is assigned multiple times, therefore temp will get the lower assignment (temp = 0). so you will end up with: Array[20] = array[0]; ... Array[19] = array[0]; ... Array[0] = array[0]; If this isn't it, more information on the code would be helpful.