Two's Complement Binary Multiplication: Understanding Why it Works

  • #1
181
0

Homework Statement




hey guys...
i try to do multiplication of two's complement number. I'm using straightforward method, which
give me wrong answer..

i know i can't use this method.. but.. i just want to know why..
why i can't use this method?



The Attempt at a Solution


1001 x 0101 = 0101101 which is 45.. it should be -35..
 
Physics news on Phys.org
  • #2
When you do multiplication you have to extend each number to double the number of bits by adding extra 1s in the start for negative numbers, or extra 0s for positive numbers. So the above multiplication should be 11111001x00000101 and at the result you consider only the first 8 bits. So in this case would be 11011101 which is -35.

For more info check http://en.wikipedia.org/wiki/Two's_complement , towards the end of page the section for multiplication.
 

Suggested for: Two's Complement Binary Multiplication: Understanding Why it Works

Replies
6
Views
737
Replies
10
Views
1K
Replies
6
Views
1K
Replies
10
Views
1K
Replies
3
Views
997
Replies
1
Views
514
Replies
2
Views
1K
Replies
5
Views
1K
Replies
2
Views
866
Back
Top