Page 854 - Mechanical Engineers' Handbook (Volume 2)
P. 854

3 Binary Numbers   845

                                      th
                                                      K
                           the left. The K bit represents the 2 place holder. The zeroth bit is called the least significant
                           bit (LSB) and the highest bit (e.g., seventh in illustration) is called the most significant bit
                           (MSB):
                              Identifying individual bits (see Fig. 30):
                                • Starting from the right
                                                        K
                                • The Kth bit represents the 2 slot
                              Least significant bit: bit furthest to the right
                              Most significant bit: bit furthest to the left


            3.2  Hexadecimal Numbers
                           Hexadecimal numbers are binary numbers that are easier for humans to work with. Hexa-
                           decimal numbers have 16 unique digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F). Since
                           hexadecimal numbers sometimes use both letters and numbers an ‘‘h’’ is usually placed at
                           the end of the number to distinguish it as a hexadecimal number (e.g., ACEh). Again, the
                           value of each digit increases by a factor of 16 as you move to the left and decreases by a
                           factor of 16 as you move to the right. The advantage of hexadecimal numbers is that each
                           hexadecimal digit represents a 4 bit binary number. This makes it very simple to convert
                           from hexadecimal to binary (see Fig. 31).


                           Example 1 34h   52:
                                                        3   16’s         4   1’s


                                                         3    4   h =  3  *  16 + 4  *  1= 52 decimal
                                   Hexadecimal to binary
                                                           0 0 1 1   0 1 0 0

                                                                     0  1’s
                                                                     0  2’s

                                      Memorize 4-bit numbers         1  4’s
                                                                     0  8’s       52
                                                                     1  16’s
                                                                     1  32’s
                                   52 decimal   34h   0011  0100

                           Example 2 Binary to hexadecimal:
                                                    0  0  1  0  1  0  0  1  0  0  1  0



                              1. Break into 4-bit segments (add two 0’s to left).
                              2. Convert each 4-bit segment into one hexadecimal digit using Fig. 31:
                                            0  0  1  0   1  0   0  1  0  0  1  0


                                                 2                 9             2h  =  2 (256) + 9 (16) + 2 (1) = 658
   849   850   851   852   853   854   855   856   857   858   859