Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

two's complement multiplication

Status
Not open for further replies.

anonymous.

Junior Member level 3
Joined
Apr 16, 2012
Messages
27
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,485
how can I multiply signed numbers in two's complement form ??

I tried the ordinary way but it seems to work only if the product is the same size with the operators

for example :
4 * -4 = -16 ======> 0000 0100 * 1111 1100 = 1111 0000 works fine

but
50 * -50 = -2500 ======> 0011 0010 * 1100 1110 = 0010 1000 0011 1100
however it should be 1111 0110 0011 1100


How to Fix This ??
 

Did u follow booth's algorithm in doing this? Let me check and verify it for you.
 

anonymous,

Your result is wrong, so your multiplication must have a mistake. Since you did not show us your work, we cannot tell you where your mistake is.

Ratch
 

To multiply two's complement, the sign bit must be treated differently.

For any multiplication of two n-bit numbers, the least significant n-bits for two's complement and unsigned numbers are the same. If you use a 2n-bit result, the most significant n-bits will be different.

You will get the correct results if you increase the number of bits of all the negative numbers to the same number of bits as your result. In order to retain the same "value" the new bits on the left of a negative number are all 1s.
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top