Binary Coded Decimal with Example

  • Decimal numbers can also be represented directly by using binary digits in a coding scheme called the binary-coded decimal (BCD) code. We now illustrate this coding scheme using Example 17.

    Example 17: Convert the decimal number 234 into its BCD equivalent.

    Solution: This coding scheme is illustrated in Table 1.22. The coding is done using a 4-bit binary scheme. For example, decimal 2 is 0010 in BCD, decimal 3 is 0011, … , and decimal 9 is 1001. Decimal 10, however, must be written as 0001 0000 in BCD and not as 1010. For the desired conversion, we first draw Table 1.22 as shown. Then in the top row, we enter digits 3, 4, and 5. After this, below each decimal number, in the second row, we write its binary-equivalent numbers as shown. Thus, below decimal 3, we write 0011, below 5, 0100 and below 5, 0101, as shown.

    Table 1.22 Decimal to BCD

    Decimal number
    BCD equivalent

    From Table 1.22, we find
    (345)10 ≡  (0011 0100 0101)BCD
    As illustrated in Table 1.23, the decimal to BCD conversion is very simple, easy, and fast. Similarly, we can see that the BCD to decimal conversion is also very simple, easy, and fast. This is illustrated using Example 18.

    Example 18: Convert the BCD number 100101110001 into its decimal equivalent.

    Solution: We first separate the bits into groups of 4 bits each as shown in Table 1.23. Then write below each group the decimal equivalent of the binary number as shown.\

    Table 1.23 BCD to Decimal

    BCD number
    BCD equivalent

    From Table 1.23, we get
    (1001 0111 0001)BCD ≡ (971)10 

    BCD Advantages and Disadvantages:

    Advantages of BCD code

    Any large decimal number can be easily converted into corresponding binary number.
    We need remember only the binary equivalents of decimal numbers from 0 to 9.
    Conversion from BCD back to decimal is also very easy.

    Disadvantages of BCD code

    The code is least efficient; it requires several symbols to represent even small numbers.
    Binary addition and subtraction can lead to wrong answers.
    Special codes are required for arithmetic operations.
    This is not a self-complementing code.
    Conversion to other coding schemes requires special methods.

    0 Responses to “Binary Coded Decimal with Example”

    Post a Comment