title: need help in understanding Arm processor
body: <p>I am a mechanical eng student, I am currently studying about the ARM processor. I just came across a question but I don't understand how they could arrive at these answers. Need help in understanding. Also please help in how to convert from negative decimal to hexadecimal. Thank you.</p>
  
  <p>What is the result of the following calculations performed in ARM? How
  are the status flags set? (Write the operands and the result in 32-bit
  hexadecimal notation!)</p>
  
  <blockquote>
    <ol>
    <li>(–1) + (+1)</li>
    <li>(0) – (+1)</li>
    <li>(2^31 – 1) + (+1)</li>
    <li>(–4) + (+5)</li>
    </ol>
  </blockquote>
  
  <p>The Answers are :</p>
  
  <ol>
  <li><p>(-1)+(+1):</p>
  
  <pre><code>-1: 0xFFFFFFFF 
   1: 0x00000001
  ----------------
   0:  0x00000000
  N=0, Z=1, C=1, V=0
  </code></pre></li>
  <li><p>(0)-(+1): subtraction replaced by addition and negation => (0)+(-1)</p>
  
  <pre><code> 0: 0x00000000 
  -1: 0xFFFFFFFF
  ----------------
   0: 0xFFFFFFFF
  N=1, Z=0, C=0, V=0
  </code></pre></li>
  <li><p>(2^31-1)+(+1):</p>
  
  <pre><code>  :  0x7FFFFFFF
   1:  0x00000001
  ----------------
   0:  0x80000000
  N=1, Z=0, C=0, V=1
  </code></pre></li>
  <li><p>(-4)+(+5):</p>
  
  <pre><code>-4: 0xFFFFFFFC 
   5: 0x00000005
  ----------------
   1:  0x00000001
  N=0, Z=0, C=1, V=0
  </code></pre></li>
  </ol>