From Sand to Computers (part II)
Multiplication
Multiplication is simply a series of additions. You keep adding the
the multiplicand to itself as many times as the multiplier tells you.
One interesting observation in multiplication leads to Booth's
algorithm. Booth observed that if you can subtract you can save time
by eliminating some of the partial products. For example the
multiplication of
0111010101 X 01111111111110 is the same as the sum of
(0111010101 X 10000000000000) - (0111010101 X 00000000000010)
Division
Division similarly is a series of subtractions. You keep subtracting
the divisor from the divident as many times as you can. The result is
the quotient and what is left in the divident register is the
remainder.
Floating Point Representation
Floating Point numbers are not interpreted as a sequence of bits.
Rather there are fields in them. The first bit is the sign bit of the
number, the next 8 bits are the exponent, and the final 23 bits are
the significand. The significand is in the form 1.xxx where bits in
the decimal part multipliers for the fractions 1/2, 1/4, 1/8, 1/26
etc.
In order to add floating point numbers you have to make sure they have
the same exponent and then add the significands. To multiply two
floating point numbers you add the exponents and multiply the
significands.