Multiplying two N bit signed numbers together

In summary, the number of bits needed to represent the range of results obtained when two N bit signed numbers are multiplied together is 2N for 2's complement and one less than 2N for sign-magnitude or ones complement.
  • #1
bd411
39
0

Homework Statement



Determine the number of bits needed to represent the range of results obtained when two N bit signed numbers are multiplied together.


Homework Equations



None.

The Attempt at a Solution



I considered the case when N = 3, i.e. a 3 bit signed number. The values that can be expressed with this are +3 - > -4. Hence with two 3 bit signed numbers we can get a maximum positive number of +16 and a maximum negative number of -12. We would therefore need 6 bits to represent this range of results (2N).

Looking at the case of 4 bits, the values that can be expressed are +7 -> -8. Here our largest positive number would be 64 and largest negative number -56. We would therefore need 8 bits (2N).

So my answer is 2N, is this correct ?
 
Physics news on Phys.org
  • #2
For 2's complement, this is true. For sign-magnitude, one less so.
 
  • #3
That's pretty much the same thing that's bothering me... I have written the question as it has been asked. I'm assuming they mean sign magnitude ?
 
  • #4
I suggest clarify question with instructor or state your assumptions in the answer. If you can't do that and if it is one of these computer-based answer entry systems (no assumptions permitted) I'd go with 2N. It allows you to do both.
 
  • #5
lewando said:
For 2's complement, this is true. For sign-magnitude, one less so.
Or ones complement. For 3 bit sign-magnitude or one's complement numbers the range of products is limited to -9 to +9, which only requires 5 bits.
 

1. What is the process for multiplying two N bit signed numbers together?

The process for multiplying two N bit signed numbers together is similar to traditional long multiplication. The two numbers are first multiplied digit by digit, starting from the rightmost digit. The resulting products are then added together, taking into account any carries. Finally, the sign of the product is determined based on the signs of the two original numbers.

2. Can a positive number be multiplied by a negative number in this process?

Yes, a positive number can be multiplied by a negative number in this process. However, the sign of the resulting product will depend on the signs of the two original numbers.

3. What is the range of possible values for the product of two N bit signed numbers?

The range of possible values for the product of two N bit signed numbers is -2^(N-1) to 2^(N-1) - 1. This means that the product can be any integer within this range, including negative numbers.

4. How does the number of bits in the two original numbers affect the result of the multiplication?

The number of bits in the two original numbers does not affect the result of the multiplication. As long as the number of bits in the product is equal to or greater than the number of bits in the two original numbers, the multiplication process will be accurate.

5. Is there a shortcut or faster method for multiplying two N bit signed numbers together?

Yes, there are various algorithms and techniques that can be used to speed up the process of multiplying two N bit signed numbers together. Some of these include Karatsuba's algorithm, Toom-Cook multiplication, and fast Fourier transform based multiplication. These techniques are commonly used in computer systems to perform multiplication operations efficiently.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
8
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
9
Views
955
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Computing and Technology
Replies
4
Views
764
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
16
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
10
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
32
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
12
Views
9K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
17K
Back
Top