Perform addition
operation
when the signs of A and B are
identical
(different)
Perform Subtraction
operation
when the signs of A and B are
different
(identical)
Hardware
Implementation
A and B be two registers that hold
the magnitudes of the numbers.
A s and B s be two flip-flops that
hold
the corresponding signs.
Result is transferred into A and A s
2 registers
2 flipflops
a magnitude comparator,
an adder, and
two subtractors.
Subtraction performed by
adding A to 2s complement of B
The add-overflow
flip-flop AVF holds the overflow bit
when A and B are added
AexorB
Multiplication Algorithms
Multiplication of two binary numbers
done with paper and pencil by a
process of successive shift and add
operations.
process
look at successive bits of the multiplier,
least significant bit first.
If the multiplier bit is a 1, the multiplicand is
copied down;
otherwise, zeros are copied down.
The numbers copied down in successive
lines are shifted one position to the left from
the previous number.
Finally, the numbers are added and their
sum forms the product.
Hardware implementation