Two's Complement Binary Multiplication: Understanding Why it Works

Click For Summary
Two's complement multiplication requires extending the bit length of the numbers involved to ensure accurate results. When multiplying a negative and a positive number, the negative number must be represented with additional bits, which was not done in the initial calculation. The correct multiplication of 1001 (representing -7) and 0101 (representing 5) should yield 11011101, which equals -35 in two's complement. The error in the straightforward method arises from not properly handling the bit extension for negative numbers. Understanding these rules is crucial for accurate two's complement arithmetic.
naspek
Messages
176
Reaction score
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
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.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 13 ·
Replies
13
Views
4K
  • · Replies 10 ·
Replies
10
Views
2K
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
3
Views
3K
Replies
2
Views
3K