Binary Multiplication with Signed Numbers: Solving 15X-7

In summary, the conversation is about performing an operation in binary, specifically 15X-7. The person seeking help has attempted to solve it using 4 bits for each number but is struggling to get the correct answer. Another person suggests using 8 bits for both numbers and taking the 2's complement of the negative number. The original person then asks if they can use the magnitude instead and take the 2's complement of the answer. The expert confirms that this is a valid method but suggests using the 2's complement of the negative number to show the point of the exercise. The original person then solves the problem correctly by multiplying the 2's complement of -7 by 15.
  • #1
snoggerT
186
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
  • #2
You can't represent 105 in four bits. I'd suggest you use eight.
 
  • #3
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?
 
  • #4
Yes.
 
  • #5
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?
 
  • #6
You'll get the same answer both ways, but I think the point of the exercise is to show that.
 
  • #7
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?
 
  • #8
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.
 

1. What is signed binary multiplication?

Signed binary multiplication is a method of multiplying two binary numbers, which are numbers expressed in base 2 using only 0s and 1s, while also taking into account their respective signed values. This means that the numbers can be positive or negative, and the result of the multiplication will also have a sign.

2. How do you perform signed binary multiplication?

To perform signed binary multiplication, you first convert the two numbers into their binary form. Then, you multiply them using the standard binary multiplication method. Finally, you apply the rules for determining the sign of the resulting number, which are based on the signs of the original numbers.

3. What are the rules for determining the sign of the result in signed binary multiplication?

The sign of the result in signed binary multiplication is determined by the following rules:

  • If both numbers have the same sign (both positive or both negative), the result will be positive.
  • If one number is positive and the other is negative, the result will be negative.
  • If one of the numbers is 0, the result will always be 0 regardless of the other number's sign.

4. Can the result of signed binary multiplication be larger than the original numbers?

Yes, the result of signed binary multiplication can be larger than the original numbers. This is because the multiplication process can result in a carryover of digits, which can increase the overall value of the result.

5. Are there any special cases to consider in signed binary multiplication?

Yes, there are two special cases to consider in signed binary multiplication:

  • If one of the numbers is represented by all 1s (in a two's complement representation), the result will be the negative value of the other number.
  • If both numbers are represented by all 1s, the result will be 0.

Similar threads

  • Precalculus Mathematics Homework Help
Replies
29
Views
2K
  • Calculus and Beyond Homework Help
Replies
4
Views
1K
  • Calculus and Beyond Homework Help
Replies
4
Views
800
  • Engineering and Comp Sci Homework Help
Replies
4
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
  • Calculus and Beyond Homework Help
Replies
9
Views
3K
  • Advanced Physics Homework Help
Replies
2
Views
392
  • Calculus and Beyond Homework Help
Replies
5
Views
990
  • Calculus and Beyond Homework Help
Replies
7
Views
1K
  • Calculus and Beyond Homework Help
Replies
6
Views
1K
Back
Top