Two's complement: Am I on the right track here?

  • Thread starter Thread starter Horizyn
  • Start date Start date
  • Tags Tags
    Track
Click For Summary
SUMMARY

The two's complement representation of -14 using 5 bits is (10010)2. The process involves converting the positive binary representation of 14, which is (01110)2, flipping the bits to get (10001)2, and then incrementing by 1 to arrive at (10010)2. This method ensures that adding the two's complement representation of -14 to its positive counterpart results in a binary sum of 00000, confirming the accuracy of the representation.

PREREQUISITES
  • Understanding of binary number systems
  • Knowledge of two's complement representation
  • Familiarity with bitwise operations
  • Basic arithmetic in binary
NEXT STEPS
  • Study the process of converting decimal numbers to binary
  • Learn about bitwise operations in programming languages
  • Explore the implications of two's complement in computer architecture
  • Investigate error detection and correction techniques in binary systems
USEFUL FOR

Computer science students, software developers, and anyone interested in understanding binary arithmetic and its applications in digital systems.

Horizyn
Messages
2
Reaction score
0
What is the the 2's complement representation of -14 using 5 bits?

1. (11110)2
2. (10100)2
3. (11001)2
4. (10010)2

I've changed to binary: 01110
Flipped over as in two's complement: 10010

So the likely answer seems to be option 4

Am I missing something?

Thanks
 
Physics news on Phys.org
To take the negative of a number in two's complement, you can take the one's complement (invert all the bits), then increment by 1. In this case ~01110 = 10001, then increment by 1 = 10010. Negating again, ~10010 = 01101, then increment by 1 = 01110.
 
As a check, if you add the binary representation of 14 to its two's complement representation, you should get 5 bits of 0.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
2
Views
1K
  • · Replies 24 ·
Replies
24
Views
7K
Replies
3
Views
3K
  • · Replies 13 ·
Replies
13
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 15 ·
Replies
15
Views
2K