title: How do I flip the most significant bit in MIPS?
body: <p>I am trying to convert a number in 2's complement in MIPS to sign magnitude. To do this, I think I would:</p>
  
  <ol>
  <li>subtract 1</li>
  <li>'Not' the word</li>
  <li>Flip the most significant bit</li>
  </ol>
  
  <p>For example, <code>11111111111111111111111111111001</code> (<code>0xfffffff9</code>) would become <code>00000000000000000000000000000111</code> (<code>0x00000007</code>).</p>
  
  <p>I figured out how to do step 1 &amp; 2, but can't figure out step 3. Does anyone know how I would do this?</p>
  
  <p>Also, is there a better way to convert from 2's complement to sign magnitude format in MIPS?</p>