Forum Discussion
Altera_Forum
Honored Contributor
10 years ago --- Quote Start --- When using integer conversion one doesn't need to know the size difference when writing the code - it's more portable. Eventually one will forget why 'high+2 was used. Odds are the synthesis output is the same for both. --- Quote End --- But the OP is using the sfixed type, and this function exists exactly for this purpose. Using the to_integer function from sfixed directly will remove the fractional part, so you need to use appropriate type conversions. Your code also used the non-standard std_logic_arith library to convert the value.