Page 56 - Cs_withBlue_J_C11_Flipbook
P. 56

Example 3: Find the result of the operation 26 ∧ 12.                 0   0   0   1   1  0   1   0
              Binary value of 26 represented in 8 bits is 00011010            ∧    0   0   0   0   1  1   0   0

              Binary representation of 12 in 8 bits form is 00001100               0   0   0   1  0   1   1   0
              Result of bitwise ∧ is 00010110
                                      4
                                             2
                                                    1
              Decimal equivalent is 1 × 2  + 1 × 2  + 1 × 2  =  22
                  2.2 REPRESENTATION OF REAL NUMBERS
              Real numbers comprise both rational and irrational numbers. They can be positive, negative or zero. All the natural
              numbers, decimals and fractions come under this category. Digital devices understand only 0 and 1. When real numbers
              are converted to binary, the digital device does not have the provision to represent the decimal point. The binary
              numbers are split into parts for internal representation.

              There are two ways of representing real numbers in computers which are as follows:
              •  Fixed point representation
              •  Floating point representation

              2.2.1 Fixed Point Representation of Real Numbers
              In this representation, the radix point (the point dividing the non-fractional and fractional parts) is assumed to be
              between the integral and fractional parts. The three parts that constitute this notation are as follows:
              •  Sign bit: It contains a single bit which is assigned 0 for positive and 1 for negative binary numbers.

              •  Integral part: This is of different lengths depending on the word size of the computer.
              •  Fractional part: Fractional part is also of different lengths for different computer types.
              The different lengths of the integral and fractional parts in different bit fields are tabulated below.

                                                        Sign bit     Integral part  Fractional part
                                         8 bits           1               4              3
                                         16 bits          1               9              6
                                         32 bits          1              15             16


                                                             Definition
                    A signed real number in fixed point notation is stored internally in three parts namely the sign bit, integral part and
                    fractional part. A fixed pre-determined number of bits is allocated for integral and fractional part depending on the
                    bytes of the computers.



              Advantage of fixed point notation:
              •  It is a simple representation technique.

              Disadvantages of fixed point notation:
              •  The range of numbers is restricted.
              •  It is difficult to represent complex fractional numbers.


              2.2.2 Floating Point Representation of Real Numbers
              As the name suggests, the radix point (though not physically written)  is not fixed in this type of representation. We
              can represent any real number according to the formula: Number = Mantissa × Base Exponent . Mantissa is the part after
              the decimal point.


                5454  Touchpad Computer Science-XI
   51   52   53   54   55   56   57   58   59   60   61