M
MLyngsie
Guest
Dear All,
What is the resulting range of an arithmetic operation on ranged
integers?
E.g. with the following two signals.
signal X : integer range 1 to 255;
signal Y : integer range 1 to 255;
And then some ware in the code.
if ( X > Y/2) then .......
Our linding tools report a warning here stating the X is 8 bit wide and
Y/2 is only 7 bit.
So the simple question is now.
What is the range of Y/2?
The general question is. What is the range of any arithmetic operation
on ranged integers?
Which rules control this?
Where in the LRM is this described?
Regards,
Mogens.
What is the resulting range of an arithmetic operation on ranged
integers?
E.g. with the following two signals.
signal X : integer range 1 to 255;
signal Y : integer range 1 to 255;
And then some ware in the code.
if ( X > Y/2) then .......
Our linding tools report a warning here stating the X is 8 bit wide and
Y/2 is only 7 bit.
So the simple question is now.
What is the range of Y/2?
The general question is. What is the range of any arithmetic operation
on ranged integers?
Which rules control this?
Where in the LRM is this described?
Regards,
Mogens.