Multiplication by Integer Constants

dc.contributor.authorBriggs, Preston
dc.contributor.authorHarvey, Timothy J. 21, 2003
dc.description.abstractSome modern machines have no integer multiple instruction and must rely on expensive software methods to compute integer products. In other cases, the multiply instruction is significantly slower than simple integer addition. When faced with computing n*c, where n is some unknown integer value and c is a known integer constant, we can avoid the need for a general-purpose multiply by rewriting the expression in terms of shifts, adds, and subtracts—typically all one-cycle instructions. Bernstein gives a detailed discussion of the problem and presents a solution, including Ada code for its implementation. Unfortunately, the code is flawed, at least in part due to typesetting errors. It's also quite difficult to understand. This document represents an attempt to explain the elements of Bernstein's approach. At the same time, we will develop a complete, working, and hopefully understandable implementation of his approach.
dc.format.extent20 pp
dc.identifier.citationBriggs, Preston and Harvey, Timothy J.. "Multiplication by Integer Constants." (2003)
dc.rightsYou are granted permission for the noncommercial reproduction, distribution, display, and performance of this technical report in any format, but this permission is only for a period of forty-five (45) days from the most recent time that you verified that this technical report is still available from the Computer Science Department of Rice University under terms that include this permission. All other rights are reserved by the author(s).
dc.titleMultiplication by Integer Constants
dc.typeTechnical report
Original bundle
Now showing 1 - 1 of 1
Thumbnail Image
8.07 MB
Adobe Portable Document Format