SlideShare a Scribd company logo
1.15
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                   Integers and
                                 2’s Complement



 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                             Goal

         To be able to specify how integers are stored by the
                computer in 2’s complement format.




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                     Integers




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                     Integers
     Integers and Real Numbers are stored in different ways
                      inside the computer.




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                     Integers
     Integers and Real Numbers are stored in different ways
                      inside the computer.
     35 and 35.0 to human beings represent the same value.




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                     Integers
     Integers and Real Numbers are stored in different ways
                      inside the computer.
     35 and 35.0 to human beings represent the same value.




    35 35.0
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                     Integers
     Integers and Real Numbers are stored in different ways
                      inside the computer.
     35 and 35.0 to human beings represent the same value.
       However, the computer “handles” these numbers with




    35 35.0
                      different mechanisms.




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                     Integers




 MATH1003
                                                       35
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                     Integers
           Today’s computers store integers usually in 32 bits.




 MATH1003
                                                       35
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                     Integers
           Today’s computers store integers usually in 32 bits.
    For the purpose of our discussions, we will imagine that
       we are working with an older computer that stores
    integers in 8 bits. Concepts that we will discuss are valid
          whether the integers are in 32 bits or 8 bits.




 MATH1003
                                                       35
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                     Integers




 MATH1003
                                                       35
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                     Integers
                   3510, as an 8 bit binary number, is 001000112




 MATH1003
                                                       35
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                     Integers
                   3510, as an 8 bit binary number, is 001000112
                        That’s how the computer will store 3510




 MATH1003
                                                       35
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                     Integers
                   3510, as an 8 bit binary number, is 001000112
                        That’s how the computer will store 3510
         But we know that integers include both positive and
                     negative whole numbers.




 MATH1003
                                                       35
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                          Sign and Magnitude



                          sign
                           bit




 MATH1003
                           001000112
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                          Sign and Magnitude
            How does the computer store negative numbers?
                  (Remember: bits are only 0 or 1)


                          sign
                           bit




 MATH1003
                           001000112
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                          Sign and Magnitude
            How does the computer store negative numbers?
                  (Remember: bits are only 0 or 1)
   One option would be to use the leftmost bit as a sign bit
    (0 for positive numbers and 1 for negative numbers).
                          sign
                           bit




 MATH1003
                           001000112
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                          Sign and Magnitude
            How does the computer store negative numbers?
                  (Remember: bits are only 0 or 1)
   One option would be to use the leftmost bit as a sign bit
    (0 for positive numbers and 1 for negative numbers).
                          sign
                           bit




 MATH1003
                           001000112
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                          Sign and Magnitude
            How does the computer store negative numbers?
                  (Remember: bits are only 0 or 1)
   One option would be to use the leftmost bit as a sign bit
    (0 for positive numbers and 1 for negative numbers).
                          sign
                           bit




 MATH1003
                           001000112
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                          Sign and Magnitude
   We’ll use the other 7 bits for the value (or magnitude) of
                         the number.


                          sign
                           bit




 MATH1003
                           001000112
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                          Sign and Magnitude
   We’ll use the other 7 bits for the value (or magnitude) of
                         the number.



                                  m agnitude




 MATH1003
                           001000112
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                          Sign and Magnitude
   We’ll use the other 7 bits for the value (or magnitude) of
                         the number.



                                                                magnitude




 MATH1003
                           001000112
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                          Sign and Magnitude
    Using this scheme, we can represent -3510 as 101000112
                               3510 as a 7 bit number is 01000112
           The sign bit will be a 1 to represent the minus sign
                             sign
                              bit                               m agnitude




 MATH1003
                               101000112
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                  Problems




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                  Problems
           In this scheme, what is 000000002 and 100000002?




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                  Problems
           In this scheme, what is 000000002 and 100000002?
                                            000000002 is positive 0




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                  Problems
           In this scheme, what is 000000002 and 100000002?
                                            000000002 is positive 0




 MATH1003
                             +0
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                  Problems
           In this scheme, what is 000000002 and 100000002?
                                            000000002 is positive 0
                                            100000002 is negative 0




 MATH1003
                             +0
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                  Problems
           In this scheme, what is 000000002 and 100000002?
                                            000000002 is positive 0
                                            100000002 is negative 0




 MATH1003
                             +0                                                               -0
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                  Problems
           In this scheme, what is 000000002 and 100000002?
                                            000000002 is positive 0
                                            100000002 is negative 0
   Believe or not, having two ways to represent 0 causes big
                           problems.




 MATH1003
                             +0                                                               -0
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                  Problems




 MATH1003
                             +0                                                               -0
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                  Problems
        Depending on the arithmetic operation, we can get a
                result of 000000002 or 100000002.




 MATH1003
                             +0                                                               -0
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                  Problems
        Depending on the arithmetic operation, we can get a
                result of 000000002 or 100000002.
      If we had this situation, there would have to be special
     circuitry to test for positive 0 and negative 0 - this adds
                    complexity to the computer.




 MATH1003
                             +0                                                               -0
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                  Problems




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                  Problems
    Another problem that arises has to do with the addition
             of a positive and a negative number.




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                                  Problems
    Another problem that arises has to do with the addition
             of a positive and a negative number.
  The computer would have to deal with the sign bit (which
               does not represent value).




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
           So a scheme was invented to address these issues.
                                        It is called 2’s complement.




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
     In 2’s complement, positive numbers are represented in
                 their normal binary equivalent.




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
  Negative number representation is found in the following
  manner:




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
  Negative number representation is found in the following
  manner:
  1. calculate the magnitude of the number




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
  Negative number representation is found in the following
  manner:
  1. calculate the magnitude of the number
  2. subtract the number from 111111112




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
  Negative number representation is found in the following
  manner:
  1. calculate the magnitude of the number
  2. subtract the number from 111111112
  3. add 1 to the result




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                                   2’s complement
                                                                                1. calculate the magnitude of the number
                                                                                2. subtract the number from 111111112
                                                                                3. add 1 to the result




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                                   2’s complement
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -10410                                                                2. subtract the number from 111111112
                                                                                3. add 1 to the result




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                                   2’s complement
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -10410                                                                2. subtract the number from 111111112

  1. 10410 = 011010002                                                          3. add 1 to the result




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                                   2’s complement
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -10410                                                                2. subtract the number from 111111112

  1. 10410 = 011010002                                                          3. add 1 to the result


  2. 111111112 - 011010002 = 100101112




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                                   2’s complement
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -10410                                                                2. subtract the number from 111111112

  1. 10410 = 011010002                                                          3. add 1 to the result


  2. 111111112 - 011010002 = 100101112
  3. 100101112 + 12 = 100110002




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                                   2’s complement
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -10410                                                                2. subtract the number from 111111112

  1. 10410 = 011010002                                                          3. add 1 to the result


  2. 111111112 - 011010002 = 100101112
  3. 100101112 + 12 = 100110002
  Therefore, -10410 = 100110002


 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
  Now, let us explore a less complicated way of calculating
  the 2’s complement form of a negative number:




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
  Now, let us explore a less complicated way of calculating
  the 2’s complement form of a negative number:
  1. calculate the magnitude of the number




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
  Now, let us explore a less complicated way of calculating
  the 2’s complement form of a negative number:
  1. calculate the magnitude of the number
  2. starting from the rightmost bit, look for the first bit
  that is a 1




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
  Now, let us explore a less complicated way of calculating
  the 2’s complement form of a negative number:
  1. calculate the magnitude of the number
  2. starting from the rightmost bit, look for the first bit
  that is a 1
  3. “invert” all bits to the left of the 1



 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -10410                                                                2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -10410                                                                2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                 10410 = 011010002

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -10410                                                                2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                 10410 = 011010002

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -10410                                                                2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                 10410 = 011010002

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -10410                                                                2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                 10410 = 011010002

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -10410                                                                2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                 10410 = 011010002

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -10410                                                                2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                 10410 = 011010002

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -10410                                                                2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                 10410 = 011010002

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -10410                                                                2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                 10410 = 011010002
                                            1

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -10410                                                                2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                 10410 = 011010002
                                           01

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -10410                                                                2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                 10410 = 011010002
                                          001

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -10410                                                                2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                 10410 = 011010002
                                         1 001

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -10410                                                                2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                              -10410 = 100110002

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -110                                                                  2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -110                                                                  2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                           110 = 000000012

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -110                                                                  2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                           110 = 000000012

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -110                                                                  2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                           110 = 000000012

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -110                                                                  2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                           110 = 000000012
                                                       1

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -110                                                                  2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                           110 = 000000012
                                                      11

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -110                                                                  2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                           110 = 000000012
                                                     111

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -110                                                                  2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                           110 = 000000012
                                                    1111

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -110                                                                  2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                           110 = 000000012
                                                   11111

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -110                                                                  2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                           110 = 000000012
                                                  111111

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -110                                                                  2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                           110 = 000000012
                                                 1111111

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -110                                                                  2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                        -110 = 111111112

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -4210                                                                 2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -4210                                                                 2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                      4210 = 001010102

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -4210                                                                 2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                           110 = 001010102

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -4210                                                                 2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                           110 = 001010102
                                                      1

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -4210                                                                 2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                           110 = 001010102
                                                     01

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -4210                                                                 2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                           110 = 001010102
                                                    101

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -4210                                                                 2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                           110 = 001010102
                                                   0101

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -4210                                                                 2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                           110 = 001010102
                                                  10101

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -4210                                                                 2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                           110 = 110101 2
                                                 00101010

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                         2’s complement (a better way)
  Calculate the 2’s complement                                                  1. calculate the magnitude of the number
  form of -4210                                                                 2. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                3. “invert” all bits to the left of the 1




                                   -4210 = 110101102

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                                 2’s complement
  Calculate the decimal value of                                                      (calculating the decimal equivalent)

  111101112                                                                     1. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                2. “invert” all bits to the left of the 1
                                                                                3. calculate the magnitude of the number




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                                 2’s complement
  Calculate the decimal value of                                                      (calculating the decimal equivalent)

  111101112                                                                     1. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                2. “invert” all bits to the left of the 1
                                                                                3. calculate the magnitude of the number




                                         111101112

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                                 2’s complement
  Calculate the decimal value of                                                      (calculating the decimal equivalent)

  111101112                                                                     1. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                2. “invert” all bits to the left of the 1
                                                                                3. calculate the magnitude of the number




                                         111101112

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                                 2’s complement
  Calculate the decimal value of                                                      (calculating the decimal equivalent)

  111101112                                                                     1. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                2. “invert” all bits to the left of the 1
                                                                                3. calculate the magnitude of the number




                                         111101112
                                               0

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                                 2’s complement
  Calculate the decimal value of                                                      (calculating the decimal equivalent)

  111101112                                                                     1. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                2. “invert” all bits to the left of the 1
                                                                                3. calculate the magnitude of the number




                                         111101112
                                              00

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                                 2’s complement
  Calculate the decimal value of                                                      (calculating the decimal equivalent)

  111101112                                                                     1. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                2. “invert” all bits to the left of the 1
                                                                                3. calculate the magnitude of the number




                                         111101112
                                             100

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                                 2’s complement
  Calculate the decimal value of                                                      (calculating the decimal equivalent)

  111101112                                                                     1. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                2. “invert” all bits to the left of the 1
                                                                                3. calculate the magnitude of the number




                                         111101112
                                            0100

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                                 2’s complement
  Calculate the decimal value of                                                      (calculating the decimal equivalent)

  111101112                                                                     1. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                2. “invert” all bits to the left of the 1
                                                                                3. calculate the magnitude of the number




                                         111101112
                                           00100

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                                 2’s complement
  Calculate the decimal value of                                                      (calculating the decimal equivalent)

  111101112                                                                     1. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                2. “invert” all bits to the left of the 1
                                                                                3. calculate the magnitude of the number




                                         111101112
                                          000100

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                                 2’s complement
  Calculate the decimal value of                                                      (calculating the decimal equivalent)

  111101112                                                                     1. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                2. “invert” all bits to the left of the 1
                                                                                3. calculate the magnitude of the number




                                         111101112
                                         0000100

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement                                                                 this method is
                                                                                                            for negative numbers
                                                                                                                     only
                                                                                                 2’s complement
  Calculate the decimal value of                                                      (calculating the decimal equivalent)

  111101112                                                                     1. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                2. “invert” all bits to the left of the 1
                                                                                3. calculate the magnitude of the number




                                         111101112
                                         0000100

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement                                                                 this method is
                                                                                                            for negative numbers
                                                                                                                     only
                                                                                                 2’s complement
  Calculate the decimal value of                                                      (calculating the decimal equivalent)

  111101112                                                                     1. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                2. “invert” all bits to the left of the 1
                                                                                3. calculate the magnitude of the number




                                         111101112 = -910
                                         0000100

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                                 2’s complement
  Calculate the decimal value of                                                      (calculating the decimal equivalent)

  111010002                                                                     1. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                2. “invert” all bits to the left of the 1
                                                                                3. calculate the magnitude of the number




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                                 2’s complement
  Calculate the decimal value of                                                      (calculating the decimal equivalent)

  111010002                                                                     1. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                2. “invert” all bits to the left of the 1
                                                                                3. calculate the magnitude of the number




                                         111010002

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                                 2’s complement
  Calculate the decimal value of                                                      (calculating the decimal equivalent)

  111010002                                                                     1. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                2. “invert” all bits to the left of the 1
                                                                                3. calculate the magnitude of the number




                                         111010002

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                                 2’s complement
  Calculate the decimal value of                                                      (calculating the decimal equivalent)

  111010002                                                                     1. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                2. “invert” all bits to the left of the 1
                                                                                3. calculate the magnitude of the number




                                         111010002
                                            1

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                                 2’s complement
  Calculate the decimal value of                                                      (calculating the decimal equivalent)

  111010002                                                                     1. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                2. “invert” all bits to the left of the 1
                                                                                3. calculate the magnitude of the number




                                         111010002
                                           01

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                                 2’s complement
  Calculate the decimal value of                                                      (calculating the decimal equivalent)

  111010002                                                                     1. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                2. “invert” all bits to the left of the 1
                                                                                3. calculate the magnitude of the number




                                         111010002
                                          001

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                                 2’s complement
  Calculate the decimal value of                                                      (calculating the decimal equivalent)

  111010002                                                                     1. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                2. “invert” all bits to the left of the 1
                                                                                3. calculate the magnitude of the number




                                         0001
                                         111010002

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                                                                                 2’s complement
  Calculate the decimal value of                                                      (calculating the decimal equivalent)

  111010002                                                                     1. starting from the rightmost bit, look for
                                                                                the first bit that is a 1
                                                                                2. “invert” all bits to the left of the 1
                                                                                3. calculate the magnitude of the number




                                         0001
                                         111010002 = -2410

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition




                                                  01011001
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                               Calculate 7210 + 1710
          Since these are both positive, this is straightforward




                                                  01011001
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                               Calculate 7210 + 1710
          Since these are both positive, this is straightforward

          7210
         +1710
                                                  01011001
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                               Calculate 7210 + 1710
          Since these are both positive, this is straightforward

          7210                               010010002
         +1710                              +000100012
                                             01011001
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                               Calculate 7210 + 1710
          Since these are both positive, this is straightforward

          7210                               010010002
         +1710                              +000100012
                                             01011001
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                               Calculate 7210 + 1710
          Since these are both positive, this is straightforward

          7210                               010010002
         +1710                              +000100012
                                             01011001
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                               Calculate 7210 + 1710
          Since these are both positive, this is straightforward

          7210                               010010002
         +1710                              +000100012
                                             01011001
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                               Calculate 7210 + 1710
          Since these are both positive, this is straightforward

          7210                               010010002
         +1710                              +000100012
                                             01011001
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                               Calculate 7210 + 1710
          Since these are both positive, this is straightforward

          7210                               010010002
         +1710                              +000100012
                                             01011001
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                               Calculate 7210 + 1710
          Since these are both positive, this is straightforward

          7210                               010010002
         +1710                              +000100012
                                             01011001
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                               Calculate 7210 + 1710
          Since these are both positive, this is straightforward

          7210                               010010002
         +1710                              +000100012
                                             01011001
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                               Calculate 7210 + 1710
          Since these are both positive, this is straightforward

          7210                               010010002
         +1710                              +000100012
                                             01011001
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                               Calculate 7210 + 1710
          Since these are both positive, this is straightforward

          7210                               010010002
         +1710                              +000100012
                                             010110012
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                               Calculate 7210 + 1710
          Since these are both positive, this is straightforward

          7210                               010010002
         +1710                              +000100012
                                bit n
                                 sig




                                             010110012
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                           Calculate 10410 + (-4210)
        Here we add a negative number to a positive number




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                           Calculate 10410 + (-4210)
        Here we add a negative number to a positive number

    10410
   + -4210

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                           Calculate 10410 + (-4210)
        Here we add a negative number to a positive number

    10410                                    011010002
   + -4210                                  +110101102

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                           Calculate 10410 + (-4210)
        Here we add a negative number to a positive number

    10410                                    011010002                                                      -4210 in
                                                                                                       2’s complement?
   + -4210                                  +110101102

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                           Calculate 10410 + (-4210)
        Here we add a negative number to a positive number

    10410                                    011010002
   + -4210                                  +110101102

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                           Calculate 10410 + (-4210)
        Here we add a negative number to a positive number

    10410                                    011010002
   + -4210                                  +110101102
                                            1001111102
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                           Calculate 10410 + (-4210)
        Here we add a negative number to a positive number

    10410
       since we are only
      using 8 bit numbers,
                                             011010002
   + -4210
     the ninth bit is simply
            dropped                         +110101102
                                            1001111102
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                           Calculate 10410 + (-4210)
        Here we add a negative number to a positive number

    10410                                    011010002
   + -4210                                  +110101102
                                            1001111102
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                           Calculate 10410 + (-4210)
        Here we add a negative number to a positive number

    10410                                    011010002
   + -4210                                  +110101102
                                 bit n
                                  sig




                                            1001111102
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                            Calculate 2710 + (-3510)
        Here we add a negative number to a positive number




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                            Calculate 2710 + (-3510)
        Here we add a negative number to a positive number

      2710
   + -3510

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                            Calculate 2710 + (-3510)
        Here we add a negative number to a positive number

      2710                                   000110112
   + -3510                                  +110111012

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                            Calculate 2710 + (-3510)
        Here we add a negative number to a positive number

      2710                                   000110112                                                      -3510 in
                                                                                                       2’s complement?
   + -3510                                  +110111012

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                            Calculate 2710 + (-3510)
        Here we add a negative number to a positive number

      2710                                   000110112
   + -3510                                  +110111012

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                            Calculate 2710 + (-3510)
        Here we add a negative number to a positive number

      2710                                   000110112
   + -3510                                  +110111012
                                            1111110002
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                            Calculate 2710 + (-3510)
        Here we add a negative number to a positive number

      2710                                   000110112
   + -3510                                  +110111012
                                 bit n
                                  sig




                                            1111110002
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                            Calculate 2710 + (-3510)
        Here we add a negative number to a positive number

      2710                                   000110112
   + -3510                                                can you verify
                                            +110111012 complement?
                                                       that this is -8 in 2’s                                           10
                                 bit n
                                  sig




                                            1111110002
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                             Calculate -4210 + (-110)
       Here we add a negative number to a negative number




 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                             Calculate -4210 + (-110)
       Here we add a negative number to a negative number

      -4210
     + -110

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                             Calculate -4210 + (-110)
       Here we add a negative number to a negative number

      -4210                                  110101102
     + -110                                 +111111112

 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                             Calculate -4210 + (-110)
       Here we add a negative number to a negative number

      -4210                                  110101102
     + -110                                 +111111112
                                            111010101
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                             Calculate -4210 + (-110)
       Here we add a negative number to a negative number

      -4210                                  110101102
     + -110                                 +111111112
                                            1110101012
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                             Calculate -4210 + (-110)
       Here we add a negative number to a negative number

      -4210
       since we are only
      using 8 bit numbers,
                                             110101102
     + -110
     the ninth bit is simply
            dropped                         +111111112
                                            1110101012
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                             Calculate -4210 + (-110)
       Here we add a negative number to a negative number

      -4210                                  110101102
     + -110                                 +111111112
                                            1110101012
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                             Calculate -4210 + (-110)
       Here we add a negative number to a negative number

      -4210                                  110101102
     + -110                                 +111111112
                                 bit n
                                  sig




                                            1110101012
 MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001




                                 2’s Complement
                                   and Addition
                                             Calculate -4210 + (-110)
       Here we add a negative number to a negative number

      -4210                                  110101102
     + -110                                 +111111112
                                                                                                      can you verify
                                                                                                   that this is -4310 in
                                 bit n




                                                                                                    2’s complement?
                                  sig




                                            1110101012
 MATH1003

More Related Content

PDF
Math1003 1.16 - Real Numbers
PPT
Chapter 02 Data Types
PPTX
Representation of Integers
PPTX
Number systems and conversions
PPT
Computer Systems Data Representation
PPT
Representation of Real Numbers
PPTX
Data representation
PPT
[1] Data Representation
Math1003 1.16 - Real Numbers
Chapter 02 Data Types
Representation of Integers
Number systems and conversions
Computer Systems Data Representation
Representation of Real Numbers
Data representation
[1] Data Representation

What's hot (20)

PPT
Int 2 data representation 2010
PPT
IS 139 Lecture 4
PPTX
Data Representation
PPT
Topic 1 Data Representation
PPT
Data representation
PPTX
Representation of Signed Numbers - R.D.Sivakumar
PPT
Data representation
PPTX
Data representation in computers
PPTX
Data Representation
PPT
Computers numbering systems
PPT
Data types
PPT
Meghna ppt.
PDF
Computer data representation (integers, floating-point numbers, text, images,...
PPT
Representation Of Data
PDF
Data representation in computers
PPT
Lec 02 data representation part 1
PPT
Data representation moris mano ch 03
PPTX
Only floating point lecture 7 (1)
PPTX
Data representation
PPTX
Data representation
Int 2 data representation 2010
IS 139 Lecture 4
Data Representation
Topic 1 Data Representation
Data representation
Representation of Signed Numbers - R.D.Sivakumar
Data representation
Data representation in computers
Data Representation
Computers numbering systems
Data types
Meghna ppt.
Computer data representation (integers, floating-point numbers, text, images,...
Representation Of Data
Data representation in computers
Lec 02 data representation part 1
Data representation moris mano ch 03
Only floating point lecture 7 (1)
Data representation
Data representation
Ad

Viewers also liked (20)

PPTX
1s and 2s complement
PDF
Math1003 - An Intro to Number Systems
PPT
Complement
PPT
2s complement arithmetic
PPT
Two’s complement
DOCX
2's complement
PPT
Complements
PDF
Math1003 1.8 - Converting from Binary and Hex to Decimal
PDF
Math1003 1.12 - Binary Addition
PPTX
1's and 2's complement
PDF
Math1003 1.9 - Converting Decimal to Binary and Hex
PPTX
Computer arithmetic
PPT
Number System
PPTX
Digital logic mohammed salim ch3
PDF
Math1003 1.4 - Number Systems
PDF
Math1003 1.5 - Decimal Number System
PDF
Math1003 welcome-13 w
PDF
Math1003 1.1 - Sets of Numbers
PDF
Math1003 1.14 - Scientific Notation
PDF
Binary addition
1s and 2s complement
Math1003 - An Intro to Number Systems
Complement
2s complement arithmetic
Two’s complement
2's complement
Complements
Math1003 1.8 - Converting from Binary and Hex to Decimal
Math1003 1.12 - Binary Addition
1's and 2's complement
Math1003 1.9 - Converting Decimal to Binary and Hex
Computer arithmetic
Number System
Digital logic mohammed salim ch3
Math1003 1.4 - Number Systems
Math1003 1.5 - Decimal Number System
Math1003 welcome-13 w
Math1003 1.1 - Sets of Numbers
Math1003 1.14 - Scientific Notation
Binary addition
Ad

Similar to Math1003 1.15 - Integers and 2's Complement (20)

PPTX
Represntasi data bilangan.pptx
PPT
Topic 1 Data Representation
PPT
Data storage (number,string,sound, image and video
PDF
Errors
PPT
PDF
1.1.1 binary systems By Zak
PPTX
The fundamentals of Computer Storage System
PDF
LEC-3-CAO-FLOATING-POINT-REPRESENTATION.pdf
PPTX
Chapter_Two.pptx data representation in computer
PPT
Chapter 2 Data Representation.pptChapter 2 Data Representation.ppt
ODP
Number systems
DOC
Chapter 4--Data representation Method.doc
PPT
Data Representation Data Representation1
PPTX
Floating point representation
PPT
Network Slides
PDF
FIXED and FLOATING-POINT-REPRESENTATION.pdf
PDF
chapter one && two.pdf
PPTX
Number system of computer
PPT
cfe2-d-35-binary-code-powerpoint_ver_1.ppt
PDF
ICT - Lecture Notes 4.pdf
Represntasi data bilangan.pptx
Topic 1 Data Representation
Data storage (number,string,sound, image and video
Errors
1.1.1 binary systems By Zak
The fundamentals of Computer Storage System
LEC-3-CAO-FLOATING-POINT-REPRESENTATION.pdf
Chapter_Two.pptx data representation in computer
Chapter 2 Data Representation.pptChapter 2 Data Representation.ppt
Number systems
Chapter 4--Data representation Method.doc
Data Representation Data Representation1
Floating point representation
Network Slides
FIXED and FLOATING-POINT-REPRESENTATION.pdf
chapter one && two.pdf
Number system of computer
cfe2-d-35-binary-code-powerpoint_ver_1.ppt
ICT - Lecture Notes 4.pdf

More from gcmath1003 (9)

PDF
Math1003 1.4 - Order of Operations
PDF
Math1003 1.17 - Truncation, Rounding, Overflow, & Conversion Error
PDF
Math1003 1.13 - Significant Digits, Accuracy, Precision
PDF
Math1003 1.11 - Hex to Binary Conversion
PDF
Math1003 1.10 - Binary to Hex Conversion
PDF
Math1003 1.7 - Hexadecimal Number System
PDF
Math1003 1.6 - Binary Number System
PDF
Math1003 1.3 - Exponents
PDF
Math1003 1.2 - Properties of Numbers
Math1003 1.4 - Order of Operations
Math1003 1.17 - Truncation, Rounding, Overflow, & Conversion Error
Math1003 1.13 - Significant Digits, Accuracy, Precision
Math1003 1.11 - Hex to Binary Conversion
Math1003 1.10 - Binary to Hex Conversion
Math1003 1.7 - Hexadecimal Number System
Math1003 1.6 - Binary Number System
Math1003 1.3 - Exponents
Math1003 1.2 - Properties of Numbers

Recently uploaded (20)

PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
01-Introduction-to-Information-Management.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Computing-Curriculum for Schools in Ghana
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Pharma ospi slides which help in ospi learning
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Classroom Observation Tools for Teachers
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
master seminar digital applications in india
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
GDM (1) (1).pptx small presentation for students
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Renaissance Architecture: A Journey from Faith to Humanism
01-Introduction-to-Information-Management.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Computing-Curriculum for Schools in Ghana
Anesthesia in Laparoscopic Surgery in India
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Pharma ospi slides which help in ospi learning
TR - Agricultural Crops Production NC III.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
human mycosis Human fungal infections are called human mycosis..pptx
Classroom Observation Tools for Teachers
STATICS OF THE RIGID BODIES Hibbelers.pdf
master seminar digital applications in india
Microbial diseases, their pathogenesis and prophylaxis
GDM (1) (1).pptx small presentation for students
Abdominal Access Techniques with Prof. Dr. R K Mishra
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
O7-L3 Supply Chain Operations - ICLT Program
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
3rd Neelam Sanjeevareddy Memorial Lecture.pdf

Math1003 1.15 - Integers and 2's Complement