title: How can 1111 1111 be the two-s complement representation of -1?
body: <p>My book says that to get the two's-complement representation, to just flip the bits and add 1. Correct me if I am wrong but the binary representation of -1 would be:</p>
  
  <pre><code>1000 0001
  </code></pre>
  
  <p>The MSB 1 denotes the sign (1 being negative number) and the 1 at the very end is where the 1 comes from.</p>
  
  <p>So when I flip the bits:</p>
  
  <pre><code>0111 1110
  </code></pre>
  
  <p>So why does my book say that the two's complement representation of -1 is 1111 1111? I assume I am messing up somewhere.</p>