Forum Discussion
Altera_Forum
Honored Contributor
10 years agoI thought of a better way - you shouldn't (can't) multiply because that preserves the sign, which is wrong. Shifting is OK, but it's too specific.
Use the built-in type conversions - convert the 14-bit to an integer (which should preserve the sign), then convert that integer to a std_logic_vector with the proper size for the Avalon port: port <= to_std_logic_vector(to_integer(data),port'size); You get to fix the syntax errors.