Page 29 - ComputerScience_Class_11
P. 29

3
                                                                           2
                                                                                          0
                                                                                  1
                                                                 8 (2 )  4 (2 )  2 (2 )  1 (2 )          Hexa
                   0001     1001     0001      .      0001        0       0      0      1     0 × 8 + 0 × 4 + 0 × 2 + 1 × 1 = 1
                     1       9        1        .        1         1       0      0      1     1 × 8 + 0 × 4 + 0 × 2 + 1 × 1 = 9
                                                                  0       0      0      1     0 × 8 + 0 × 4 + 0 × 2 + 1 × 1 = 1
                 (191.1) 16                                       0       0      0      1     0 × 8 + 0 × 4 + 0 × 2 + 1 × 1 = 1

                 Example 3:  Convert (25C9)  to octal.
                                         16
                 Answer: Converting Octal to Binary first        8 (2 )  4 (2 )  2 (2 )  1 (2 )          Hexa
                                                                           2
                                                                    3
                                                                                          0
                                                                                   1
                      2          5        C(12)       9           0       0      1       0     0 x 8 + 0 x 4 + 1 x 2 + 0 x 1 = 2
                    0010       0101       1100       1001         0       1      0       1     0 x 8 + 1 x 4 + 0 x 2 + 1 x 1 = 5
                 Binary equivalent is (0010010111001001) 2        1       1      0       0    1 x 8 + 1 x 4 + 0 x 2 + 0 x 1 = 12
                 Grouping 3 bits, we get 010  010  111  001  001  1       0      0       1     1 x 8 + 0 x 4 + 0 x 2 + 1 x 1 = 9
                 Converting to Octal

                    010     010      111      001      001        4 (2 )    2 (2 )   1 (2 )             Octal
                                                                               1
                                                                                        0
                                                                     2
                     2       2        7        1        1           0        1         0         0 × 4 + 1 × 2 + 0 × 1 = 2
                                                                    0        1         0         0 × 4 + 1 × 2 + 0 × 1 = 2
                                                                    1        1         1         1 × 4 + 1 × 2 + 1 × 1 = 7
                 (22711) 8                                          0        0         1         0 × 4 + 0 × 2 + 1 × 1 = 1
                                                                    0        0         1         0 × 4 + 0 × 2 + 1 × 1 = 1

                     1.3 BINARY ARITHMETIC
                 The arithmetic of binary numbers involves binary addition, binary subtraction, binary multiplication and binary division.
                 Like decimal arithmetic, binary arithmetic operations start from the rightmost least significant bit (LSB).

                 1.3.1 Binary Addition
                 The basic cases for binary addition are:

                                      Bits         Sum          Carry
                                     0 + 0           0            0
                                     0 + 1           1            0

                                     1 + 0           1            0
                                     1 + 1           0            1       Added to the adjacent left bits

                                    1 + 1 + 1        1            1       Added to the adjacent left bits

                 Let us understand with some examples.
                 Example 1: (1100111)  + (11101) 2
                                    2
                 Answer:               +1 +1 +1 +1 +1 +1 +1
                                            1   1   0   0   1   1   1
                                        +           1   1   1   0   1
                                        1   0   0   0   0   1   0   0

                 (10000100) 2





                                                                                              System of Numeration  27
   24   25   26   27   28   29   30   31   32   33   34