1
   

2's complement problem confusions

 
 
Reply Sat 9 Sep, 2006 01:42 pm
For example, below is the 6 bit binary numbers have a sign in the leftmost position and are expressed in 2's complement form.

001010+100010


I am not sure 2's complement is invert the binary number then plus one?

So the arithmetic operation 001010+100010 how do I perform?
To complement the second binary number izzit?
Or both can be add directly?

Hope expert could guide. Thanks.
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 1 • Views: 690 • Replies: 1
No top replies

 
markr
 
  1  
Reply Sat 9 Sep, 2006 03:31 pm
Just add the numbers.

001010
100010
--------
101100

Since bit 5 is a 1, the number is negative. To figure out what that number is, invert and add 1.

010011
000001
--------
010100 = 20

So, the result is -20. This can be verified by converting the original numbers to decimal. The first is 10, and the seconds is -30 (invert and add 1 then convert to decimal).
0 Replies
 
 

Related Topics

Evolution 101 - Discussion by gungasnake
Typing Equations on a PC - Discussion by Brandon9000
The Future of Artificial Intelligence - Discussion by Brandon9000
The well known Mind vs Brain. - Discussion by crayon851
Scientists Offer Proof of 'Dark Matter' - Discussion by oralloy
Blue Saturn - Discussion by oralloy
Bald Eagle-DDT Myth Still Flying High - Discussion by gungasnake
DDT: A Weapon of Mass Survival - Discussion by gungasnake
 
  1. Forums
  2. » 2's complement problem confusions
Copyright © 2025 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 1.09 seconds on 04/27/2025 at 11:47:03