Binary Multiplication with Signed Numbers: Solving 15X-7

snoggerT
Messages
183
Reaction score
0
Perform the following operation in binary:

15X-7





The Attempt at a Solution



I tried getting help on the engineering board, but nobody has helped yet, so I figured I would try over here...

- I can't seem to figure this one out for some reason. My first attempt, I used 1111(15)X1001(2's complement of 7), but I can't get the right answer. I believe that the answer should come out to be the 2's complement of 105 since the actual answer is -105, but I can't get that. Please help.
 
Physics news on Phys.org
You can't represent 105 in four bits. I'd suggest you use eight.
 
Dick said:
You can't represent 105 in four bits. I'd suggest you use eight.

- so I would need to use 8 bits for both the 15 and the -7?
 
Yes.
 
also, do I have to use the 2's complement of the -7, or can I use the magnitude and then take the 2's complement of the answer?
 
You'll get the same answer both ways, but I think the point of the exercise is to show that.
 
I tried multiplying 1111X0111 and got 1101001 (105) and then just added a 0 to it to get 01101001 (+105). I then took the 2's complement of that to get 10010111 which should be -105. Is that valid?
 
That's the right answer, but you didn't really do it the two's complement way. Now multiply the two's complement of 7 by 15 and see if you get the same thing. I don't really remember the details of all the bit fiddling required. If you can't get it, bump this and see if someone else can help.
 
Back
Top