

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
The concept of fast multiplication in computers and the reason why it is slower than addition. It discusses the rules of binary multiplication and the need to construct full adders for multi-bit numbers. The document also introduces a method called 'divide and conquer' to speed up multiplication, which is a common algorithm technique.
Typology: Study notes
1 / 3
This page cannot be seen from the preview
Don't miss anything!
3 October , Day 11 Chapter 25 – Fast Multiplication How do computers actually multiply numbers together? We know the hardware performs the processing, but how? People memorize rules to help us with multiplication, but what is the actual algorithm? Consider “standard multiplication” in decimal, eg 123 * 57. To calculate must a) break up the problem by column, b) perform standard rules of multiplication (eg, 73, 72, 7*1, etc) to form partial results, and then c) add the partial results together. As the size of the multiplicands increases, so too does the time to solve (but not just linearly as we will see). As multiplication problem (input) increases in size, the time to solve increases too. But is it linear? no. It is O(n^2 ). Why … consider: 123 vs 743, *57 * 4,
861 6,688, +615 66,880, ----- 74,311, 7011 +2,972,464,
3,120,344, Note that second problem is just twice as big (n=6) compared to first problem (n=3); yet the effort is much greater than twice (ie, not O(n) – linear) {remember n is the input size} {note that both “dimensions” of problem doubled – twice as many columns and twice as many partial results} binary arithmetic Consider addition: regardless of the “length” or size (number of bits, n), we will perform n (2 bit addition operations). If we have two 10 bit words to add, it will require 10 (2 bit addition operations). Thus, time for add is O(n) 1010
Look at “simple” rules of binary addition: 0+0 = 0; 0+1=1; 1+0+1; 1+1= Do these rules always hold true? Yes! Not thinking when you add, just following rules (algorithms) Now, we need to construct “full” adders to solve the general problem for any column: 3 inputs: two addends and a carry-in 2 outputs: sum and a carry-out CSC325 – constructed via gates {show on 325 review day} But., multiplication is much slower. Rules are easy: 00 = 0; 01=0; 10 = 0; 11= Eg, multiply two 4-bit values. 1010
1010 1010 0000
1101110 Why would we want to speed up multiplication? examples: eg graphics card, etc – response time, throughput for CPU intensive jobs Is it possible to get multiplication to O(n)? What does gut say? no – if so, multiplication could be performed as fast as addition. Covered fast technique … We want a “trick” to speed up multiplication; want something faster … Bottom of page 168 – first “speedup” method we’ll look at Separate each number in half – sort of like scientific notation split each number into equal halves eg x = a * 2n/2^ + b