• Support PF! Buy your school textbooks, materials and every day products Here!

Binary multiplication

  • Thread starter naspek
  • Start date
  • #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..
 

Answers and Replies

  • #2
Delta2
Homework Helper
Insights Author
Gold Member
2,423
683
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.
 

Related Threads for: Binary multiplication

  • Last Post
Replies
11
Views
2K
  • Last Post
Replies
1
Views
16K
  • Last Post
Replies
3
Views
8K
  • Last Post
Replies
2
Views
1K
  • Last Post
Replies
6
Views
817
  • Last Post
Replies
14
Views
2K
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
1
Views
1K
Top