/ Instrumentation

Binary Coded Decimal with Example

Posted by Sreejith Hrishikesan ~ on ~ 0 comments

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.

Related Posts

No comments:

Leave a Reply

Popular Posts

About the Contributor

Dr B Somanathan Nair

Dr. B Somanathan Nair, one of the top engineering text author of India. He was born on September 1, 1950 in Kerala, India. In 1971, he obta...

Total Pageviews