Problem: The Altera compiler thinks that it will take more than 10k iterations to complete this segment of code. I am not seeing how it would take more than a maximum of 36... I have not been coding in vhdl for all that long so I will more than accept any answer that should be obvious.
Code description: This should take an integer in the range of 0 to 9999 and separate the digits into their bcd compatible segments...
Code description: This should take an integer in the range of 0 to 9999 and separate the digits into their bcd compatible segments...
Code:
doConv: process (big_dec)
variable temp,tOne,tTen,tHun,tTho: integer := 0;
begin
if(big_dec > 9999) then
temp := 9999;
else
temp := big_dec;
end if;
while temp >= 1000 loop
temp := temp - 1000;
tTho := tTho + 1;
end loop;
while temp >= 100 loop
temp := temp - 100;
tHun := tHun + 1;
end loop;
while temp >= 10 loop
temp := temp - 10;
tTen := tTen + 1;
end loop;
while temp >= 1 loop
temp := temp - 1;
tOne := tOne + 1;
end loop;
ones <= tOne;
tens <= tTen;
hund <= tHun;
thou <= tTho;
end process;