IT2001PA
Engineering Essentials (2/2)


Chapter 2 – Arithmetic Operation

 Lecturer Name
lecturer_email@ite.edu.sg
                               Nov 20, 2012
Contact Number
Chapter 2 – Arithmetic Operation


Lesson Objectives
Upon completion of this topic, you should be able to:
   Compute addition and subtraction arithmetic operation
    for the binary and hexadecimal number systems.




    IT2001PA Engineering Essentials (2/2)           2
Chapter 2 – Arithmetic Operation


Specific Objectives
  Students should be able to :
      Perform addition, subtraction using the binary and hexadecimal
       number systems.
      Explain the use of :
          1’s complement of a binary number and
          2’s complement of a binary number.
      Explain the following terms :
          Bit
          Nibble
          Byte and
          Word.




      IT2001PA Engineering Essentials (2/2)
Chapter 2 – Arithmetic Operation


 Binary addition
                                   Add 0112 and 1102
                                              011           (3)
                                       +      110           (6)
                                              (1)       carry

                                              1001          (9)
                       Add 10010.012 and 111.102
                                   10010.01                 (18.25)
                           +            111.10              ( 7.50)
                                    (1) (1)         carry
                                   11001.11                 (25.75)


    IT2001PA Engineering Essentials (2/2)                             4
Chapter 2 – Arithmetic Operation


  Binary Subtraction
    Subtract 1112 from 11002
   borrow    (2) (1) (2)

            1 1 0 0 (12)
       -      1 1 1 ( 7)
              1 0 1 ( 5)
    Binary Subtraction of 10000.012 - 111.102
             (1) (1) (1) (1) (2)
  borrow
            10000.01               (16.25)
       -         111.10            ( 7.50)
              1000.11              ( 8.75)



    IT2001PA Engineering Essentials (2/2)       5
Chapter 2 – Arithmetic Operation


Multiplication of Binary Numbers
                                     1 0 0 12                  ( 9)
                           x         1 0 1 12                  (11)
                                     1001
                                1001
                           0000
                    +1 0 0 1
                           (1) (1)
                                         carry

                      1100011                                  (99)
                    ( 64 32 0 0 0         2 1       binary )
                       6    5              1    0
                     22                  22
    IT2001PA Engineering Essentials (2/2)                             6
Chapter 2 – Arithmetic Operation

    Binary division

                       10012 ÷ 112              (9 ÷ 3 = 3)
                                   0011
                                     (1) (2)   borrow

                          11       1001
                                   011
                                   0011
                                   0011
                                   0000


    IT2001PA Engineering Essentials (2/2)                     7
Chapter 2 – Arithmetic Operation


    1’s complement

    Bit by Bit inversion of a binary number.

                    Given:                  110101112

    Result of 1’s complement is 0 0 1 0 1 0 0 0 2




    IT2001PA Engineering Essentials (2/2)               8
Chapter 2 – Arithmetic Operation


    2’s complement

    Result of 1’s complement plus 1.

                    Given:                  110101112

    Result of 1’s complement is 0 0 1 0 1 0 0 0 2
                                        +          12
    Result of 2’s complement is 0 0 1 0 1 0 0 1 2


    IT2001PA Engineering Essentials (2/2)               9
Chapter 2 – Arithmetic Operation


   Why use 2’s complement
         In computers, the operations of
         subtraction can be performed using
         only the addition operation with the
         2’s complement method.




    IT2001PA Engineering Essentials (2/2)       10
Chapter 2 – Arithmetic Operation


Why 2’s complement is popular
      This method is popular because
       only adder circuits are needed
           thus simplifying the circuitry.
      Easy with digital circuits to get the
      complements.




    IT2001PA Engineering Essentials (2/2)     11
Chapter 2 – Arithmetic Operation


Binary System
       Each digit in the binary number system is called a
        bit

       A group of four bits binary number is known as
        Nibble.

       A group of eight bits binary number is known as
        Byte.

       Two bytes number form a word.


    IT2001PA Engineering Essentials (2/2)               12
Chapter 2 – Arithmetic Operation


    Bit
           A binary digit, e.g.: 0 or 1

    Nibble
           A group of 4 bits, e.g.: 1010

    Byte
           A group of 8 bits, e.g.: 1001 1011

    Word
      A group of 16 bits, e.g.: 1011 1010 1100 1001
    IT2001PA Engineering Essentials (2/2)        13
Chapter 2 – Arithmetic Operation


Next Lesson




    IT2001PA Engineering Essentials (2/2)   14

Ee2 chapter2 arithmetic_operation

  • 1.
    IT2001PA Engineering Essentials (2/2) Chapter2 – Arithmetic Operation Lecturer Name lecturer_email@ite.edu.sg Nov 20, 2012 Contact Number
  • 2.
    Chapter 2 –Arithmetic Operation Lesson Objectives Upon completion of this topic, you should be able to:  Compute addition and subtraction arithmetic operation for the binary and hexadecimal number systems. IT2001PA Engineering Essentials (2/2) 2
  • 3.
    Chapter 2 –Arithmetic Operation Specific Objectives Students should be able to :  Perform addition, subtraction using the binary and hexadecimal number systems.  Explain the use of :  1’s complement of a binary number and  2’s complement of a binary number.  Explain the following terms :  Bit  Nibble  Byte and  Word. IT2001PA Engineering Essentials (2/2)
  • 4.
    Chapter 2 –Arithmetic Operation Binary addition Add 0112 and 1102 011 (3) + 110 (6) (1) carry 1001 (9) Add 10010.012 and 111.102 10010.01 (18.25) + 111.10 ( 7.50) (1) (1) carry 11001.11 (25.75) IT2001PA Engineering Essentials (2/2) 4
  • 5.
    Chapter 2 –Arithmetic Operation Binary Subtraction Subtract 1112 from 11002 borrow (2) (1) (2) 1 1 0 0 (12) - 1 1 1 ( 7) 1 0 1 ( 5) Binary Subtraction of 10000.012 - 111.102 (1) (1) (1) (1) (2) borrow 10000.01 (16.25) - 111.10 ( 7.50) 1000.11 ( 8.75) IT2001PA Engineering Essentials (2/2) 5
  • 6.
    Chapter 2 –Arithmetic Operation Multiplication of Binary Numbers 1 0 0 12 ( 9) x 1 0 1 12 (11) 1001 1001 0000 +1 0 0 1 (1) (1) carry 1100011 (99) ( 64 32 0 0 0 2 1 binary ) 6 5 1 0 22 22 IT2001PA Engineering Essentials (2/2) 6
  • 7.
    Chapter 2 –Arithmetic Operation Binary division 10012 ÷ 112 (9 ÷ 3 = 3) 0011 (1) (2) borrow 11 1001 011 0011 0011 0000 IT2001PA Engineering Essentials (2/2) 7
  • 8.
    Chapter 2 –Arithmetic Operation 1’s complement Bit by Bit inversion of a binary number. Given: 110101112 Result of 1’s complement is 0 0 1 0 1 0 0 0 2 IT2001PA Engineering Essentials (2/2) 8
  • 9.
    Chapter 2 –Arithmetic Operation 2’s complement Result of 1’s complement plus 1. Given: 110101112 Result of 1’s complement is 0 0 1 0 1 0 0 0 2 + 12 Result of 2’s complement is 0 0 1 0 1 0 0 1 2 IT2001PA Engineering Essentials (2/2) 9
  • 10.
    Chapter 2 –Arithmetic Operation Why use 2’s complement In computers, the operations of subtraction can be performed using only the addition operation with the 2’s complement method. IT2001PA Engineering Essentials (2/2) 10
  • 11.
    Chapter 2 –Arithmetic Operation Why 2’s complement is popular This method is popular because  only adder circuits are needed  thus simplifying the circuitry. Easy with digital circuits to get the complements. IT2001PA Engineering Essentials (2/2) 11
  • 12.
    Chapter 2 –Arithmetic Operation Binary System  Each digit in the binary number system is called a bit  A group of four bits binary number is known as Nibble.  A group of eight bits binary number is known as Byte.  Two bytes number form a word. IT2001PA Engineering Essentials (2/2) 12
  • 13.
    Chapter 2 –Arithmetic Operation Bit A binary digit, e.g.: 0 or 1 Nibble A group of 4 bits, e.g.: 1010 Byte A group of 8 bits, e.g.: 1001 1011 Word A group of 16 bits, e.g.: 1011 1010 1100 1001 IT2001PA Engineering Essentials (2/2) 13
  • 14.
    Chapter 2 –Arithmetic Operation Next Lesson IT2001PA Engineering Essentials (2/2) 14