From the course: Learning PLC Ladder Logic: 2 Diving Deeper

Introduction to binary coded decimal - Ladder Logic Tutorial

From the course: Learning PLC Ladder Logic: 2 Diving Deeper

Start my 1-month free trial

Introduction to binary coded decimal

- [Female Instructor] For a PLC to control any process or application it must be able to receive signals from outside devices. As humans, we prefer to work with decimal numbers, while the PLC only understands binary information. Thumbwheels are used to allow us to input numerical data into the programmable controller. And, in the PLC, they are being read as BCD, Binary Coded Decimal. The Binary Coded Decimal System provides a means of converting a number used by humans in decimal to a number understood by the controller in binary. The BCD System uses four bits to represent each decimal digits. The four bits used are the binary equivalents of the numbers from zero to nine. Let's fresh up on the concepts of binary weightings to understand how BCD numbers are represented. A binary number means that each bit has a power of two assigned to it. The least significant bit is giving weighting of two to the power zero, that gives number one. The next bit is giving a weighting of two to the power one, which gives number two and it continues for all the remaining bits. Here's and example of a decimal number one. The binary equivalent is zero zero zero one. Another example, number three, the binary equivalent output is zero zero one one. Remember, that we place one for each binary weighting so the total is equal to the decimal representation of three. So we place one under the weighting for number one and place one for number two, that gives a total of three. In the BCD system the largest decimal number that can be displayed by any four digits is nine. So if we have a decimal number that has three digits the BCD representation of that decimal number is obtained by replacing each decimal digit by its BCD equivalent. To distinguish the BCD numbering system from the binary system, a BCD designation is placed to the right of the unit digits. Here is the BCD equivalent for number eight hundred sixty three, and the binary equivalent for the same number. Binary and BCD have the same representation in terms of zeros and ones when you look at them. But BCD uses four bits to represent each decimal digits. So you can see that BCD is different than binary.

Contents