Forum Discussion
Altera_Forum
Honored Contributor
15 years agofirst, I think you need to add a "use ieee.numeric_std.all;" to be able to use the unsigned and signed types.
Then the + operator only works on vectors with the same length. You should convert a and b to 5-bit vectors before adding them. Something like:sum <= resize(a,5) + resize(b,5); The resize function works with both unsigned and signed vectors.