Forum Discussion
Altera_Forum
Honored Contributor
15 years agoMultiplier and Divider
I am new to the forum, but not VHDL. I am a student at RIT and have taken classes and am very familiar with the language. The questions I have are more of what should my hardware multiplier and divid...
Altera_Forum
Honored Contributor
15 years agoIn that case, all you need for a single overflow but is to or the top 32 bits of the output of the multuplier (because you connect the least significant 32 bits of the multiplier to your output) for your unsigned ALU.
for the signed, the output becomes and overflow/underflow. first check is to see if the top 32 bit are all 1 or all 0. If this fails, there is an overflow (in the case of MSB = '1') or underflow (MSB = '0'). Then you compare MSB with bit 31. MSB = '1' and bit31 = '0' means underflow, MSB = '0' and bit31 = '1' mean overflow. You can of course combine all this for a single bit "error".