title: Adding and subtracting two's complement
body: <p>Using six-bit one's and two's complement representation I am trying to solve the following problem:</p>
  
  <pre><code>12 - 7 
  </code></pre>
  
  <p>Now, i take 12 in binary and 7 in binary first.</p>
  
  <pre><code>12 = 001100 - 6 bit 
  7 =  000111 - 6 bit
  </code></pre>
  
  <p>Then, would I then flip the bit for two's complement and add one?</p>
  
  <pre><code>12 = 110011 ones complement 
       +    1
      -------
       001101
  
  7  = 111000 ones complement 
      +     1
     ---------
        111001
  </code></pre>
  
  <p>then, add those two complement together</p>
  
  <pre><code> 001101
  +111001
  -------
  1000110 = overflow? discard the last digit?  If so I get 5
  </code></pre>
  
  <p>Now, if I have a number like</p>
  
  <pre><code>-15 + 2
  </code></pre>
  
  <p>I would then add a sign magnitude on the MSB if it's a zero?</p>
  
  <p>like:</p>
  
  <pre><code>-15 = 001111 6 bit
  </code></pre>
  
  <p>Would I add a 1 at the end here before I flip the bits?</p>
  
  <pre><code>  = 101111
  </code></pre>