Forum Discussion
Altera_Forum
Honored Contributor
11 years agoAssignments for vectors inequal in length
let's t and d - unsigned vectors and they have different length, and perhaps reverse range does assignment t := to_unsigned(to_integer(d), t'length) right? what is regular way?
Altera_Forum
Honored Contributor
11 years agointegers are limited to 32 bits signed (31 bits unsigned), so this way is not universal.
You also would never have a reverse range unsigned value. The result of any arithmatic will always be (N downto 0). So it doesnt really matter how you declare it - the left bit is always the MSB. it would be much easier just to use the resize function: t := resize(d, t'length);