### Lecture 10 - Arithmetic

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

• 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.4)
• 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.6)
• 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 235 ("faster multiplication"))

#### Floating point representation (sec. 3.5, pp. 242-250)

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