Joined: Fri Dec 11, 2009 3:50 pm Posts: 3367 Location: Ontario, Canada
|
MichaelM wrote: Like you, some additional research on the web let me extend the Booth algorithm for any number of bits Thanks for the post, Michael. Since I haven't yet put the Booth method into practice, it's nice to have input from anyone who has. As for Booth encoding, yes I did eventually grok the general rule for the weighting. I don't know how you would state it but in my words the rule is that, regardless of radix, the sequence begins with 0, 1, 1, 2, 2, 3, 3, etc. and ends with -3, -3, -2, -2, -1,-1, 0. For example, - with radix 16, the encodings are 00000 to 11111, weighted 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, -8, -7, -7, -6, -6, -5, -5, -4, -4, -3, -3, -2,- 2, -1, -1, 0
- with radix 8, the encodings are 0000 to 1111, weighted 0, 1, 1, 2, 2, 3, 3, 4, -4, -3, -3, -2,- 2, -1, -1, 0
- with radix 4, the encodings are 000 to 111, weighted 0, 1, 1, 2, -2, -1, -1, 0
- with radix 2, the encodings are 00 to 11, weighted 0, 1, -1, 0
The last two examples may seem to break the rule, but radix 4 and radix 2 merely have sequences which are too short to fully and obviously show the pattern. They aren't good examples to learn from, which is why IMO it's unfortunate that the Wikipedia article confines itself to radix 2. Thanks for the reference to "Computer Organization." Between you and Ed the amount of info collected on the Booth topic is a little overwhelming. Big Ed wrote: I can't quite see why the patterns shouldn't be evenly distributed. (Is it because of the overlap??) I might have to retract or dilute what I said about there not being even distribution. Still, it does seem that the leading bit might throw things off, since it's always zero and there's no corresponding bit that's always one. I admit I'm not yet clear and comfortable with the reasoning. A separate issue (?) apart from even distribution is the likelihood that an operation will do more work and show an advantage compared to conventional long multiplication. The numbers I presented a few posts back do show that longer radices result in higher efficiency -- that is, fewer add/subtract ops are required to accomplish the 65,536 multiplications in the hypothetical test. (Ops like 3 and 7 do more work but still count as a single op.) -- Jeff
_________________ In 1988 my 65C02 got six new registers and 44 new full-speed instructions! https://laughtonelectronics.com/Arcana/ ... mmary.html
|
|