Sep 082014
 

The BCD Code

In order to share information in digital format, it is common to use a binary or hexadecimal representations. There are other methods to represent this information and one of them is the BCD code. By using the BCD coding is easy to see the relationship between a decimal number (base 10) and the corresponding binary one (base 2)

The BCD code uses 4 binary digits to represent a decimal number (0 to 9). When you make a normal convertion from a binary number to a decimal one there is no direct relationship between the decimal digit and the binary digit.

Example #1:

BCD code example 1

This is a direct normal convertion from a decimal number to a binary one. 8510 = 10101012

The representation of the same decimal number on BCD code is shown above.

Example # 2:

BCD code example 2

This is a direct normal convertion from a decimal number to a binary one. 56810 = 10001110002

The representation of the same decimal number on BCD code is shown above.

As you can see from the two examples, the decimal equivalent number does not seem to be a good BCD representation. To obtain the equivalent BCD code of each previous decimal number, we have to assign a “weight” or “value” to each digit according to its position.

This “weight” or “value” follows the following order: 8 – 4 – 2 – 1. (It is a weighted code)

The last example shows that the number 5 is represented as: 0 1 0 1.
the first “0” corresponds to 8,
the first “1” corresponds to 4,
the second “0” corresponds to 2, and …
the second “1” corresponds to 1.

Decimal to BCD code convertion Table

From the chart above: 0x8 + 1×4 + 0x2 + 1×1 = 5

The BCD code that has the “weights” or “values” described before is called: Natural BCD Code. The BCD code counts like a normal binary number from 0 to 9, but numbers from ten (1010) to fifteen (1111) are not used because these numbers do not have an equivalent decimal number. This code is used, among other applications, to represent decimal numbers on 7 segment displays.

Notes: The subscript 2 and 10, are used to represent, in the first case a binary number and in the second case a decimal number.

Please like & share:

Related Post

Binary to Gray code and Gray code to Binary Conver... Binary to Gray Code Conversion and Gray code to Binary Conversion We recommend reading the The Binary Number System before you start reading this...
Combinational circuit What is a Combinational circuit? A combinational circuit is. as its name suggests, a circuit where the output depends only on the "combination" o...
The Binary Number System The Binary Number System (base 2) The Binary number system, unlike the Decimal number System, where they are allowed 10 digits (0 to 9), you only nee...
Sequential circuit What is a Sequential circuit? The main difference between a combinational circuit and a sequential circuit is that in the sequential circuit...
NAND Gate – Truth table NAND Gate Theoretically, a NAND gate with two inputs, can be implemented by cascading a two-input AND gate and a NOT gate (or inverter gate). See t...
Boolean Algebra – Introduction and Rules Boolean Algebra - Introduction and Rules The Boolean algebra works only with two values: 1/0, Yes/NO, High/Low, True/False, On/Off. The possible opti...
The logic OR gate The logic OR gate The logic Or logic gate is one of the simplest digital logic gates. The output of this gate is high, when one or all of its inpu...
Gray code – Introduction What is the Gray code? We recommend reading the Binary Number System before you start reading this tutorial. The Gray code is a special type of bina...

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>