title: represent negative number with 2' complement technique?
body: <p>I am using 2' complement to represent a negative number in binary form</p>
  
  <p><strong>Case 1</strong>:number -5</p>
  
  <p>According to the 2' complement technique:</p>
  
  <p>Convert 5 to the binary form:</p>
  
  <p><code>00000101</code>, then flip the bits</p>
  
  <p><code>11111010</code>, then add 1</p>
  
  <pre><code>00000001
  </code></pre>
  
  <p>=> result: <code>11111011</code></p>
  
  <p>To make sure this is correct, I re-calculate to decimal:</p>
  
  <pre><code>-128 + 64 + 32 + 16 + 8 + 2 + 1 = -5
  </code></pre>
  
  <p><strong>Case 2</strong>: number -240</p>
  
  <p>The same steps are taken:</p>
  
  <pre><code>11110000
  
  00001111
  
  00000001
  
  00010000 =&gt; recalculate this I got 16, not -240
  </code></pre>
  
  <p>I am misunderstanding something?</p>