Section 6.6
Review Questions

Condition Codes

  1. In the spaces to the left of each description, write one of the four letters: C, N, V or Z. Use each one once:
     ______         if the result is all 0s
     
     
     ______         if the result has a 1 in the MSB
     
     
     ______         if there was a final carry out
     
     
     ______         if there was 2's complement overflow
answer...
__Z___         if the result is all 0s
__N___         if the result has a 1 in the MSB
__C___         if there was a final carry out
__V___         if there was 2's complement overflow
  1. What gate is used to compute the Z bit?
answer...
NOR
  1. The C bit can also be thought of as an overflow bit. But what interpretation must we use in this case?
answer...
if the two numbers are unsigned binary numbers
  1. Which of the following additions could possibly cause overflow? Don't worry about how many bits are used; just look at the signs. Circle them:
         176        -176        -176         125
       + 972      + -872      +  876      + -191
       -----      ------      ------      ------
answer...
    176        -176        -176         125
  + 972      + -872      +  876      + -191
  -----      ------      ------      ------

   yes          yes         no          no

 when the signs are the same overflow can occur,
 but not when the signs are different
  1. Following is the result of addition in an 8-bit system. Did arithemtic overflow occur? The 1 off to the side is the final carry out.
                          1      0 1 1 0 1 0 1 1
answer...
yes, when the final carry out does not match the sign bit there is signed overflow
  1. Which bits require no extra gates to compute? Their values are derived from certain outputs of the adder.
               C        N        V        Z
answer...
C and N