Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / help with binary multiplication (2's complement)

Author
Message
El Goorf
18
Years of Service
User Offline
Joined: 17th Sep 2006
Location: Uni: Manchester, Home: Dunstable
Posted: 26th Feb 2008 02:41
I'm stucky multiplying 7 by -11 and wondering where I've gone wrong.

7 in binary is 00111
11 is 01011, hence -11 comes to 10101, because of swapping the 1's/0's and adding 1 at the end.

hence 7*-11 =

10101
* 111
-----
10101
101010
1010100
-------
10010011

i sense i've gone wrong already, but carrying on:

i ignore the first 3 digits because they've carried over, leaving "10011" which comes to -16+2+1 = -13, not the -77 i was expecting

i've followed everything in the instructions, anyone care to tell me where i've gone wrong? thanks

http://notmybase.com
All my base are not belong to anyone.
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 26th Feb 2008 03:04 Edited at: 26th Feb 2008 03:10
-11 is 11110101, you must not leave any digits out (at least no less than the operand with more bits). After all, you can't do maths between two pieces of data a different size before sign-extending the smaller piece.

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 26th Feb 2008 12:45
01111001 01100101 01100001 01101000.
[b][/b]

[href]mod2software[/href]
El Goorf
18
Years of Service
User Offline
Joined: 17th Sep 2006
Location: Uni: Manchester, Home: Dunstable
Posted: 26th Feb 2008 14:19
ty, it all worked out in the end

http://notmybase.com
All my base are not belong to anyone.

Login to post a reply

Server time is: 2024-11-20 00:41:20
Your offset time is: 2024-11-20 00:41:20