Forum Discussion
Altera_Forum
Honored Contributor
10 years ago --- Quote Start --- 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? --- Quote End --- Not sure about your syntax or reverse range but generally your concept of conversion is right in theory but problematic in practice. You need to make sure that integer will fit... so best is use resize (sign extension) and for unsigned just add zeros to extra MSBs. If going down in bits you need to control what to do with remaining bits; do you chop off LSBs or MSBs and what does it imply for your design. so a general universal assignment is not realistic.