Integer multiplication of n-bit operands produces an integer of 2n bits. Some
applications in signal processing and graphics keep only n bits of the result and,
in case of a result larger than what can be represented with n bits (overflow),
saturate the result to the maximum representable value (2 ~ - 1 for magnitudes
and 2 n-1 - 1 and -2 n-1 for two's complement). These are called
saturating
multipliers.
The direct implementation incorporates a standard multiplier, a detection of
the overflow, and setting the result. Detection has two forms:
9 For magnitudes, overflow ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.