Page 9 - Code & Click - 7
P. 9

Example 1                                           Example 2

            To convert the decimal number                       To convert the decimal number 145 into
            35 into its binary equivalent.                      its binary equivalent.

              2    35                                                         2    145
              2    17        Remainder     1
                                                                              2    72       Remainder      1
              2      8       Remainder     1                                  2    36       Remainder      0
              2      4       Remainder     0                                  2    18       Remainder      0

              2      2       Remainder     0                                  2     9       Remainder      0

              2      1       Remainder     0                                  2     4       Remainder      1
                     0       Remainder     1                                  2     2       Remainder      0

                                                                              2     1       Remainder      0

                                                                                    0       Remainder      1

                            1 0 0 0 1 1           Thus, the decimal number 145
            Thus, the decimal number 35
            is equal to 100011 in binary form.    is equal to 10010001 in binary form.
            It is expressed as (35)  = (100011) It is expressed as (145)  = (10010001)    2 1 0 0 1 0 0 0     1
                                  10            2                        10
            Conversion of Binary Number into Decimal Number

            To convert a binary number into a decimal number:
               •   Write the place value of every digit of the binary number by multiplying it with the correct
                  power of the base 2, starting with power 0 from the extreme right.
               •   Add the result of each multiplication to get the decimal number.

            Example 1:  To convert (11001)  into decimal number.
                                              2
                          (11001)        = 1 × 2  + 1 × 2  + 0 × 2  + 0 × 2  + 1 × 2 0
                                                4
                                                        3
                                                                         1
                                                                2
                                  2
                                         = 1 × 16 + 1 × 8 + 0 × 4 + 0 × 2 + 1 × 1
                                         = 16 + 8 + 0 + 0 + 1
                                         = 25
                          Thus, (11001)  = (25) 10
                                         2
            Example 2:   To convert (100101)  into decimal number.
                                               2
                          (100101)       = 1 × 2  + 0 × 2  + 0 × 2  + 1 × 2  + 0 × 2  + 1 × 2 0
                                                                3
                                                        4
                                                                         2
                                                                                 1
                                                5
                                    2
                                         = 1 × 32 + 0 × 16 + 0 × 8 + 1 × 4 + 0 × 2 + 1 × 1
                                         = 32 + 0 + 0 + 4 + 0 + 1
                                         = 37
                          Thus, (100101)  = (37) 10
                                          2
            Binary Arithmetic
            The arithmetic of binary numbers involves the addition, subtraction, multiplication, and division
            of binary numbers. Binary arithmetic operations usually start from the rightmost digit.


                                                                                                                  7
   4   5   6   7   8   9   10   11   12   13   14