As we have observed in this Binary Numbers portion of tutorials, there are various binary codes found in digital and electronic circuits, each using its own specific use.

As we naturally reside in a decimal (base-10) world we are in need of a way of converting these decimal numbers right into a binary (base-2) environment that computers and digital gadgets understand, and binary coded decimal code we can do that.

**Source: text to binary conversion**

We’ve seen previously an n-bit binary code is several “n” bits that assume up to 2n distinct mixtures of 1’s and 0’s. The benefit of the Binary Coded Decimal system is usually that every decimal digit is represented by several 4 binary digits or bits in quite similar way as Hexadecimal. So for the 10 decimal digits (0-to-9) we are in need of a 4-little bit binary code.

But don’t get confused, binary coded decimal isn’t exactly like hexadecimal. Whereas a 4-bit hexadecimal number is definitely valid up to F16 representing binary 11112, (decimal 15), binary coded decimal numbers visit 9 binary 10012. Which means that although 16 numbers (24) could be represented using four binary digits, in the BCD numbering system the six binary code combinations of: 1010 (decimal 10), 1011 (decimal 11), 1100 (decimal 12), 1101 (decimal 13), 1110 (decimal 14), and 1111 (decimal 15) are classed as forbidden numbers and may not be used.

The benefit of binary coded decimal is that it allows easy conversion between decimal (base-10) and binary (base-2) form. However, the disadvantage can be that BCD code is certainly wasteful as the states between 1010 (decimal 10), and 1111 (decimal 15) aren’t used. Nevertheless, binary coded decimal has many important applications especially using digital displays.

In the BCD numbering system, a decimal number is sectioned off into four bits for every decimal digit within the quantity. Each decimal digit is normally represented by its weighted binary value performing a primary translation of the quantity. So a 4-little bit group represents each displayed decimal digit from 0000 for a zero to 1001 for a nine.

So for instance, 35710 (3 HUNDRED and Fifty Seven) in decimal will be presented in Binary Coded Decimal as:

35710 = 0011 0101 0111 (BCD)

Then we are able to see that BCD uses weighted codification, as the binary little bit of each 4-bit group represents confirmed weight of the ultimate value. Quite simply, the BCD is usually a weighted code and the weights found in binary coded decimal code are 8, 4, 2, 1, commonly called the 8421 code since it forms the 4-little bit binary representation of the relevant decimal digit.

### Table for Binary Coded Decimal

Decimal Number | BCD 8421 Code |

0 | 0000 0000 |

1 | 0000 0001 |

2 | 0000 0010 |

3 | 0000 0011 |

4 | 0000 0100 |

5 | 0000 0101 |

6 | 0000 0110 |

7 | 0000 0111 |

8 | 0000 1000 |

9 | 0000 1001 |

10 (1+0) | 0001 0000 |

11 (1+1) | 0001 0001 |

12 (1+2) | 0001 0010 |

… | … |

20 (2+0) | 0010 0000 |

21 (2+1) | 0010 0001 |

22 (2+2) | 0010 0010 |

**Binary Coded Decimal Example No1**

Using the above table, convert the next decimal (denary) numbers: 8510, 57210 and 857910 to their 8421 BCD equivalents.

85_{10} = 1000 0101 (BCD)

572_{10} = 0101 0111 0010 (BCD)

8579_{10} = 1000 0101 0111 1001 (BCD)

Remember that the resulting binary number following the conversion is a true binary translation of decimal digits. It is because the binary code means a genuine binary count.