Forum Discussion
Altera_Forum
Honored Contributor
17 years agosigned/unsigned multipliers
I can't seem to find a way to instantiate a multiplier that will dynamically select between signed and unsigned multiplication. This is on a Cyclone II, but applies to other parts as well. Read...
Altera_Forum
Honored Contributor
17 years ago --- Quote Start --- It is always true if we allow for correct width. The issue of 8 bit width representing numbers from 0~127 and -1 to -128 is separate. The puzzle still stands: - => + should reverse + => - naturally hence for - => + subtract 1 then invert (by definition) but how come the same rule apply to both conversions as well. i.e. [invert add 1] in either case. --- Quote End --- If you search Wikipedia for "two's complement" there is an explanation, but rather complex. For me, when you start with a positive number and complement the objective is to find the distance from zero in the negative direction so when you complement 0 "adding 1" has the effect of reducing the magnitude so that 0 is still zero, but the magnitude of all negative numbers appears to be offset toward 0. When you complement the negative number you have to add 1 to adjust the magnitude to get the correct distance from 0 in the positive direction. Therefore the maximum negative number 1.000 ... 0 is farther away from 0 than the maximum positive number and cannot be converted.