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

  • Thread starter Horizyn
  • Start date
  • #1
2
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
 

Answers and Replies

  • #2
rcgldr
Homework Helper
8,756
555
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.
 
  • #3
34,988
6,739
As a check, if you add the binary representation of 14 to its two's complement representation, you should get 5 bits of 0.
 

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

Replies
4
Views
620
  • Last Post
Replies
3
Views
1K
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
8
Views
1K
  • Last Post
Replies
4
Views
1K
Replies
0
Views
2K
Replies
3
Views
986
Replies
14
Views
200
Top