0 votes
in General Knowledge by (744k points)
When does overflow occur for bit mult?

1 Answer

0 votes
by (744k points)
Best answer
For x and y, each with the same width (w).

Overflow happens if the result will not fit in w bits. To make sure this never happens, 2w bits are needed to store and possible result for multiplication for two w bit values.

This works for both unsigned and signed mult.
Welcome to the Answerine , a great place to find, read and share your favorite questions and answers.