Converting 2's complement to decimal

  • Thread starter Thread starter dangish
  • Start date Start date
Click For Summary
SUMMARY

The discussion focuses on converting the binary number 11001100 from 8-bit 2's complement notation to its decimal equivalent. The correct approach involves recognizing that the most significant bit (MSB) is 1, indicating a negative number. Participants confirm that inverting the bits results in 00110011, which converts to 51 in decimal. Adding 1 gives 52, and the final result is -52, verified by the addition of the original binary number and its 2's complement.

PREREQUISITES
  • Understanding of 2's complement notation
  • Knowledge of binary to decimal conversion
  • Familiarity with bitwise operations
  • Basic arithmetic involving binary numbers
NEXT STEPS
  • Study the process of converting other binary numbers using 2's complement
  • Learn about signed vs. unsigned binary representations
  • Explore the implications of overflow in binary arithmetic
  • Investigate the use of 2's complement in computer architecture
USEFUL FOR

Students learning computer science concepts, software engineers working with low-level programming, and anyone interested in binary arithmetic and number representation in computing.

dangish
Messages
72
Reaction score
0
Convert the binary number 11001100 from 8-bit 2’s complement notation to decimal. Remember to specify the sign of the decimal number.

attampt: because the MSB is 1, the number is negative, therefore invert all the numbers getting:

00110011

now convert that to decimal which is, 2^0 + 2^1 + 2^4 + 2^5 = 51

then add 1, 51+1 = 52

and make that negative getting -52. Is this correct?
 
Physics news on Phys.org
dangish said:
Convert the binary number 11001100 from 8-bit 2’s complement notation to decimal. Remember to specify the sign of the decimal number.

attampt: because the MSB is 1, the number is negative, therefore invert all the numbers getting:

00110011

now convert that to decimal which is, 2^0 + 2^1 + 2^4 + 2^5 = 51

then add 1, 51+1 = 52

and make that negative getting -52. Is this correct?
Yes, although I would invert the binary bits and add 1 then, which gives you 00110100.

The check is that 11001100 + 00110100 == 00000000, and in fact, it is. (There's a final 1 bit, but it's out too far to fit in 8 bits.)
 
Since you know its 2's complement and therefore the first number is a negative, can't you just add the bits like normal?

-128 + 64 + 0 + 0 + 8 + 4 + 0 + 0 = -52
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
916
  • · Replies 3 ·
Replies
3
Views
3K
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K