### Lecture 12 - Arithmetic

#### Multiplication (text, sec. 3.4)

• sequential multiplication
• basic algorithm is like decimal (long) multiplication
• keep a running total so we don't have to store so many numbers
• implement in hardware by using shift registers (text, figure 3.5)
• basic algorithm ...
• repeat 32 times:
• if low bit of multiplier == 1, product += multiplicand
• shift multiplicand left one bit
• shift multiplier right one bit
• because multiplier shrinks while product grows, can keep both in a single register (text, figure 3.7)
• sequential multiplier is slow (N clock cycles for N bits)
• now, with availability of lots of gates, can build combinatorial multipliers which are much faster (text, page 181)

#### Floating point representation (sec. 3.6, pp. 189-194)

• implements float and double types of Java and C
• 'scientific' representation:  sign, exponent, and coefficient (fraction)
• float:  8 bit exponent, 23 bit fraction
• double:  11 bit exponent, 52 bit fraction