Page 71 - Programmable Logic Controllers, Fifth Edition
P. 71

Table 3-6 Numeric Values in Decimal, Binary, BCD,
                              and Hexadecimal Representation
                            Decimal               Binary                  BCD                  Hexadecimal
                                0                                                0                                          0000                                     0
                                1                                                1                                          0001                                     1
                                2                                               10                                          0010                                     2
                                3                                               11                                          0011                                     3
                                4                                             100                                          0100                                     4
                                5                                             101                                          0101                                     5
                                6                                             110                                          0110                                     6
                                7                                             111                                          0111                                     7
                                8                                          1000                                          1000                                     8
                                9                                          1001                                          1001                                     9
                               10                                          1010                                 0001 0000                                     A
                               11                                          1011                                 0001 0001                                     B
                               12                                          1100                                 0001 0010                                     C
                               13                                          1101                                 0001 0011                                     D
                               14                                          1110                                 0001 0100                                     E
                               15                                          1111                                 0001 0101                                     F
                               16                                       1 0000                                 0001 0110                                    10
                               17                                       1 0001                                 0001 0111                                    11
                               18                                       1 0010                                 0001 1000                                    12
                               19                                       1 0011                                 0001 1001                                    13
                               20                                       1 0100                                 0010 0000                                    14


                              126                                    111 1110                        0001 0010 0110                                    7E
                              127                                    111 1111                        0001 0010 0111                                    7F
                              128                                 1000 0000                        0001 0010 1000                                    80

                              510                              1 1111 1110                        0101 0001 0000                                  1FE
                              511                              1 1111 1111                        0101 0001 0001                                  1FF
                              512                             10 0000 0000                        0101 0001 0010                                  200







                                               Decimal  number   7  8   6  3





                                BCD      0   1  1   1    1  0   0   0    0  1   1  0     0  0   1  1  BCD
                              number

                                        4 bits used for
                                      each decimal digit
                              Figure 3-12  The BCD representation of a decimal number.



               52         Chapter 3  Number Systems and Codes







          pet73842_ch03_046-060.indd   52                                                                               03/11/15   3:50 PM
   66   67   68   69   70   71   72   73   74   75   76