6.5. Integer Multiplication and Division

In Section 6.1.6, we demonstrated how addition can be based on logic. Choosing two's complement representation for signed integers makes subtraction a special case of addition that is relatively easy to implement at the hardware level. That choice avoids complications associated with positive and negative variants of zero in sign and magnitude representation.

In this section, we extend the exploration of arithmetic founded on logic. First we look at an early algorithm that accomplishes multiplication by using addition. Then we look at division problems, where the divisor is a constant. The divisor is converted into a reciprocal to be used in a multiplication operation that is mathematically equivalent ...

Get Itanium® Architecture for Programmers: Understanding 64-Bit Processors and EPIC Principles now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.