Page 27 - Trackpad_ipro 4.1_Class7
P. 27

BINARY TO DECIMAL CONVERSION

                 To convert a binary number into a decimal number, follow these steps:

                        ✶ Start from the right-most digit known as the LSD before the fractional point, and move
                       towards left.
                        ✶ Multiply each digit by 2 raised to the power corresponding to its position. The powers of
                       2 start from 0 and increase to 1, 2, and so on as you move towards left.

                        ✶ Add up all the resulting products. This sum gives you the decimal number.
                 The following examples will help you understand the conversion better.
                 Example 1: Convert (1111)  to decimal number.
                                             2
                                    3
                                                       1
                                                                0
                                             2
                           =  1 × 2  + 1 × 2  + 1 × 2  + 1 × 2
                           =  8 + 4 + 2 + 1
                           =  15
                           (1111)  = (15)
                                  2       10
                 Example 2: Convert (10111)  to decimal number.
                                              2
                                                                1
                                                       2
                                    4
                                             3
                           =  1 × 2  + 0 × 2  + 1 × 2  + 1 × 2  + 1 × 2   0
                           =  16 + 0 + 4 + 2 + 1
                           =  23
                           (10111)  = (23)
                                   2        10
                     OPERATIONS ON BINARY NUMBERS

                 We can perform various operations on binary numbers. Let's discuss binary addition and binary
                 subtraction in detail.
                 Binary Addition

                 Binary addition is similar to decimal addition. When the value of addition exceeds 1 (e.g., sums
                 of 10 or 11), a carry is moved to the left of the current position. The rules for adding two binary
                 digits are given below:
                                                                              Let  us  add  the  binary  numbers
                        X                Y                 X + Y              (101111)  and (10111) .
                                                                                       2              2
                        0                0               0 + 0 = 0                                   _____
                                                                                   1   1  1  1  1          Carry Bits
                        0                1               0 + 1 = 1
                                                                                   1   0  1  1  1  1
                        1                0               1 + 0 = 1             +       1  0  1  1  1
                        1                1          1 + 1 = 10 (carry 1)       1  0    0  0  1  1  0


                 Binary Subtraction


                 In binary subtraction, the smaller binary number is subtracted from the larger one. The table
                 below illustrates how to subtract digit Y from digit X. If Y is greater than X, we borrow 1 from the
                 next higher position. When a binary digit of 0 borrows 1, it effectively becomes 2 (written as 10
                 in binary).


                                                                                              Number System      25
   22   23   24   25   26   27   28   29   30   31   32