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 to limited range of data type To temporarily solve this I changed the upper limit from 0xFFFF to 0xFFFE My questions are: - Why this is happening? I ask this because I was thinking that the alt_u16 as an unsigned 16 bit could fit the 0xFFFF
- Do I need to increase the type alt_u16 to alt_u32 only to support one additional bit or how can I solve this problem?