Computer Arithmetic Algorithm

In this course, we will study What is the computer arithmetic Algorithm and how arithmetic operations such as addition, subtraction, Algorithm, and multiplication are done on a computer?

What is computer arithmetic?

Computer arithmetic is the way in which our computer performs arithmetic operations like addition, subtraction, multiplication, and division. The arithmetic operations are performed on binary or decimal data.

Addition and subtraction

The magnitude of the two numbers is designated by A and B. There are eight different conditions that need to be considered that depending on the sign of the numbers and the operation performed. These conditions are listed in the first column of the Table.

Computer Arithmetic Algorithm

Algorithm

The two signs A, and B, are compared with the help of an exclusive-OR gate. In case if the output of the gate is 0 the signs are identical; otherwise, the signs are different. For an add operation, in case of identical signs, the magnitudes are added.

Algorithm

Multiplication

As in all multiplication schemes, the booth algorithm requires examination of the multiplier bits and the shifting of partial products.

  1. The multiplicand is subtracted from the partial product on an encounter with the first least significant 1 in a string of 1’s in the multiplier.

  2. The multiplicand is added to the partial product on an encounter with the first 0 in a string of 0’s in the multiplier.

  3. There is no change in the partial product when the multiplier bit is identical to the previous multiplier bit.
Multiplication