nibot ([personal profile] nibot) wrote2003-12-16 08:53 pm

Wurster Hall, and multiplying 2's complement numbers

Nick gave me a short tour of Wurster Hall. What a cool place! Must explore further...

Brandon sent me the following algorithm to multiply two's complement numbers. I needed to invoke Kenny to help decipher it!

  1. Use regular unsigned multiplication to compute A*B → H:L.
  2. If A<0, set H ← (H - B).
  3. If B<0, set H ← (H - A).