Page 40 - Computer Science Class 11 With Functions
P. 40

Incidentally, the RGB triplet (FF, FF, 00) yields  yellow colour (Table 2.9).
            Colour: Yellow
                                Table 2.9: RGB code in binary and Hexadecimal for the colour - Yellow

                                                    Binary Value   Hexadecimal Value

                                         RED          11111111             FF
                                       GREEN          11111111             FF
                                        BLUE          00000000             00


                 Write the RGB code for the following colours:
                    a. Black (absence of all colours)
                    b. White (presence of all colours in full intensity)
                    c. Red
                    d. Green
                    e. Blue


        2.5 Expressing Numbers in Different Number Systems

        We have learnt about some commonly used number systems. Given a number (expressed in a number system), we can
        express it in another number system. Next, we will study the transformation of integers from one number system to
        another and then move to the transformation of fractional numbers from one number system to another. In this book,
        we will restrict the discussion to non-negative numbers.

        2.5.1 Transforming Integers from One Number System to Another

        Decimal to Binary Conversion
        To convert a whole decimal number to binary, we follow the following steps:
        1.  Divide the number by 2.
        2.  Note the remainder.
        3.  Repeat steps 3a and 3b until the quotient becomes 0
            3a. Divide the quotient by 2

            3b. Note the remainder
        4.  Write the remainders in reverse order from the binary number.
        Example 1: To convert the number (70 )  to its binary equivalent.
                                            10
              2   70          Remainder

              2   35             0
              2   17             1
              2    8             1

              2    4             0
              2    2             0

              2    1             0
              2    0             1

            (70)  = (1000110) 2
                10


          38   Touchpad Computer Science-XI
   35   36   37   38   39   40   41   42   43   44   45