views:

39

answers:

1

I am trying to learn Binary Multiplication, 2's complement negative numbers.

-10
x 3

I know there is a simple way of doing this. Like sign extension and initial partial product.

-10         0110 twos complement
x 3       x 0011
----      ------
          000000  (initial partial product) with sign extension at the MSB
          10110  (bit 0 of the 3 times 10, sign extended at MSB)

          110110  (sign extended sum of initial partial product and
                           Multiplicand)

          10110- (bit 1 of the 3 multiplied by the 10. sign extension at the MSB Note the
                         Multiplicand is shifted left by one bit)

I am lost on how to continue. I am not even sure if i was completely right up to this point. Can someone show me how to do it by steps? I dont want to do it any other way. If i do it the traditional way big numbers could be bad. Thank you

+2  A: 

Your interpretation of -10 is off.

   ..11110110  (-10)
×    00000011    (3)
-------------
   ..11110110  (-10)
+ ..111101100  (-20)
-------------
   ..11100010  (-30)
Ignacio Vazquez-Abrams
To clarify: you *can't* represent -10 in twos complement in only 4 bits: a 4 bit, 2s-complement integer runs from -8 to +7. So you must do your math with at least 5 bit integers and use at least 10 bits for representing the product.
dmckee