Page 58 - Cs_withBlue_J_C11_Flipbook
P. 58

Based on the three components, a floating point number can be of two types:
              •  Single Precision (32 bit): 1 sign bit, 8-bit exponent, 23-bit mantissa and bias is 127.
              •  Double Precision (64 bit): 1 sign bit, 11-bit exponent, 52-bit mantissa and bias is 1023.

              The accuracy or precision of a floating point number will increase if we increase the bit size of mantissa. But this would
              reduce the exponent size, thereby decreasing the range of the numbers. Hence, a trade-off or balance is to be achieved
              between precision and range while representing floating point numbers.

              Advantage of floating point representation:
              •  Provides a very large range of numbers

              Disadvantage of floating point representation:
              •  Rounds off large numbers which may lead to loss of precision
              Example 1: Convert 19.75  into mantissa exponent notation.
                                     10
              The binary value of 19.75 is 10011.11
              In normalised binary notation, shifting the binary point to 4 places left, we get 1.001111 × 2 4
              Expressing exponent 4 in binary 1.001111 × 2 100
              So the representation is – Mantissa: 1.001111 and Exponent: 100

              The mantissa in normalised notation always has a single 1 before binary point, the computer excludes this 1 to save
              space and stores only the bits to the right of mantissa.

              So, 32-bit memory representation is:
              MSB sign bit 0 as the number is positive
              Exponent in 8 bits notation = 00000100
              Mantissa in 23 bits filled from left to right 00111100000000000000000

              Example 2: Convert the following floating point binary number to decimal.

              1 00000101 00110100000000000000000
                                                   Sign bit  = 1 means a negative number
                                                 Exponent  = 101 = 5
                                                 Mantissa  = 001101 or 1.001101
                                                                       5
                                                  Number  = 1.001101 x 2  = 100110.1
                                                                5
                    Decimal equivalent of integer part 100110 = 1 × 2  + 1 × 2  + 1 × 2  = 38
                                                                       2
                                                                               1
                         Decimal equivalent of fractional part = 1 × 2  = 0.5
                                                                -1
              The number is -38.5.
                  2.3 CHARACTERS AND THEIR ENCODING
              A character set consists of a group of characters that are used to represent any particular language. The character set
              of the English language is different from Hindi, Bengali, Chinese or any other languages spoken in different parts of
              the world. The visual representation of a character is called a glyph. To represent these character sets, the computer
              uses the concept of a coded character set where the character is assigned a unique number called code points. The
              code points are commonly referred to in decimal notation, though hexadecimal notation can also be used. Character
              encoding demonstrates the way each code point is actually mapped with the glyph for that character. The evolution of
              character encoding is discussed in the next sub-sections.





                5656  Touchpad Computer Science-XI
   53   54   55   56   57   58   59   60   61   62   63