Booth's multiplication algorithm: Difference between revisions

Content deleted Content added
References: improved ref
A typical implementation: Wikifying 'multiplicand' and 'multiplier' for clarity and ease of reference.
Line 10:
==A typical implementation==
[[Image:Calculator walther hg.jpg|thumb|right|A Walther WSR160 [[Odhner Arithmometer|arithmometer]] from 1960. Each turn of the crank handle adds ''(up)'' or subtracts ''(down)'' the operand set to the top register from the value in the accumulator register at the bottom. [[Arithmetic shift|Shifting]] the adder left or right multiplies the effect by ten.]]
Booth's algorithm can be implemented by repeatedly adding (with ordinary unsigned binary addition) one of two predetermined values ''A'' and ''S'' to a product ''P'', then performing a rightward [[arithmetic shift]] on ''P''. Let '''m''' and '''r''' be the [[multiplicand]] and [[Multiplication#Terminology|multiplier]], respectively; and let ''x'' and ''y'' represent the number of bits in '''m''' and '''r'''.
 
# Determine the values of ''A'' and ''S'', and the initial value of ''P''. All of these numbers should have a length equal to (''x'' + ''y'' + 1).