Forum Discussion
Altera_Forum
Honored Contributor
9 years agoDoes the alt_u16 type support 0xFFFF or not?
Please consider the following code:
...
alt_u16 i;
....
for(i=0x0000; i<=0xFFFF; i++)
...
I am getting the following warning during my compilation: comparison is always true due...
Altera_Forum
Honored Contributor
9 years agoalt_u16 can hold 0xFFFF, but it can't hold anything larger than that. So the comparison "<= 0xFFFF" is always true. Which is exactly what the compiler is telling you the problem with your code is.
You can use an alt_u32 to keep the rest of your for() loop the same as already written.