|
||||||||||||||||||
August 1, 1997 No fear of binary multiplication I thoroughly enjoyed Clive "Max" Maxfield's article about binary multiplication ("The product of all fears: binary multiplication," April 10, 1997, pg 195). I often have to program 8-bit microcontrollers to perform binary multiplication and division of 64-bit words. Until I read his article, I used rather crude methods (for example, shift left, shift left, shift left, add, add) to multiply by 10 (decimal). Although this method was sufficient for a fixed multiplier of 10 (decimal), which I use most, other multipliers always caused my programs to run slowly and consume a lot of code. Now, thanks to Maxfield, I can multiply by 10 (decimal) much more efficiently and quickly. What is still missing is a simple and efficient way to divide 64-bit values by 10 (decimal), because I use this method to display 64-bit binary numbers as ASCII decimal numbers by using the remainder after each division by 10. Unfortunately, even the Pentium CPU cannot handle 64-bit division by 10 (decimal) without overflows. (Yes, the EDX:EAX holds a 64-bit dividend, but the resulting quotient--if it is greater than 32 bits--overflows the EAX register.) That problem also means that the most popular older CPUs, such as the Intel 286, are limited to 16-bit division, and most microcontrollers have no way to divide except by powers of two. If I were going to divide by eight, I would simply shift right the whole 64-bit value three times, but dividing by 10 (decimal) opens a can of worms because powers of 2 are not divisible by 10. Do you have a solution for this problem? Richard
Sheldon Editor's note: The answer to this question was recently published in the article, "Divide and conquer: binary division," (EDN, May 8, 1997, pg 163), as well as in the book, Bebop Bytes Back (An Unconventional Guide to Computers). For more details, visit http://ro.com/~bebopbb. Corrections and updates In "FIFO memories supply the glue for high-speed systems" (EDN, March 14, 1997, pg 65), Table 1 (pg 72) contains incorrect prices for Texas Instruments' FIFO portfolio. The correct prices are in the table below.
In "Analog filters: even more essential in the digitized world" (EDN, April 24, 1997, pg 42), the entry for Linear Technology Corp in the box "Manufacturers of filter components and software" (pg 46) is incorrect. The company provides filter-design software in addition to filter op amps and complete filter ICs. EDN apologizes for the error. Sound off Send your letters to Signals and Noise Editor, EDN, 275 Washington St, Newton, MA 02158 or e-mail us at bmorrison@edn.cahners.com. Our fax is 1-617-558-4470. EDN reserves the right to edit letters for clarity and length. |
||||||||||||||||||
| EDN Access | Feedback | Table of Contents | |
||||||||||||||||||
| Copyright © 1997 EDN Magazine, EDN Access. EDN is a registered trademark of Reed Properties Inc, used under license. EDN is published by Cahners Publishing Company, a unit of Reed Elsevier Inc. | ||||||||||||||||||