Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Contact Us
  • Home
  • Products
  • Automation Systems
  • Programmable Logic Controllers (PLC)

What is BCD?

Written by Arlo D'Cruz

Updated at November 30th, 2023

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Products
    Automation Systems Control Components Motion & Drives Quality control & Inspection Robotics Safety Sensing Services Software Switching Components
  • Amplify e-Store
    e-Store public
  • Public CSC
+ More

BCD (Binary coded decimal) is a method for encoding decimal numbers and is not to be confused with binary. BCD encodes each digit of a decimal number in 4 bits of data. 

One way of thinking about it is that each decimal digit is represented by one hexadecimal digit (or four binary bits). 

The below table shows how decimal digits are encoded in BCD and how they differ from its binary equivalent. Keep in mind that BCD and binary are the same from 0-9 but for values greater than 9 they are different.

Decimal Binary(BCD) Hexadecimal Binary Hexadecimal
0 00000000 0 00000000 0
1 00000001 1 00000001 1
2 00000010 2 00000010 2
…        
9 00001001 9 00001001 9
10 00010000 10 00001010 A
11 00010001 11 00001011 B
12 00010010 12 00001100 C
…        
20 00100000 20 00010100 14
21 00100001 21 00010101 15
…        
99 10011001 99 01100011 63

In the above example, note that each 4 bits gives us one digit. This means that when we are using 8 bits like above, the maximum value that can be stored is 99. To store more digits we would need to use 12 bits which would give us a maximum value of 999. 

Additionally take notice when encoding using BCD the hexadecimal representation mirrors the decimal value. To enter the decimal value 1234 to cx-p in a BCD format, you would notate it as #1234.

Warning

Ensure that the values A,B,C,D,E,F are not used when encoding values in BCD. Doing so will result in errors. A common way this can occur is using standard binary math functions rather than BCD math functions when working with BCD values.

 

In CX-Programmer, channels have 16 bits which means that the maximum value that can be stored is 9999.

Info

A common occurrence of BCD values is scaling analogue values using the SCL function. The reason for this is that some of the parameter inputs for the function require BCD, and the output of the function is also BCD.

If you treat P1 or P1+2 as a binary the block either won't scale as expected, or it will not function at all.

 

 

 

bcd definition bcd abbreviation

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • My PLC does not show up in the NB component settings
  • How to Setup a CP1W-CIF41 option board
  • Ethernet/IP Setup Guide Using Network Configurator
  • Grounding the 0VDC line for power supplies (PELV)

Definition by Author

0
0
Expand