Question: Computer multiplication. One way to multiply two integers A times B is to add A to itself B times. But this is rather inefficient for

Computer multiplication. One way to multiply two integers A times B is to add A to itself
B times. But this is rather inefficient for a large number, since, for example, to multiply
by 100 could require 100 separate additions. However, when expressed in binary, 100 takes
only 7 bits (01100100). By using bit shifting (RLF or RRF) operations along with addition,
the number of iterations can be reduced, depending on the maximum sizes of the numbers
allowed in a memory unit.
The largest number one can store on our PIC16F88 is 255(all 8 bits set to 1). With this
in mind, consider multiplying two 4-bit numbers together and putting the result into an 8-
bit register by using shifting and adding. The table below shows a multiplication of 3\times 13
following such an algorithm where the shifts rotate through carry (car below). Each row
shows the contents of C, B and A at the end of each iteration, along with the operations
performed:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!