## The ABCs of BCD

Binary Coded Decimal (BCD) is a number code that makes all those 1s and 0s in the computer easier for humans to read. In BCD the digits 0 through 9 are stored as 4 bits (a.k.a. a nibble). Thus in a 16-bit word you can have four digits (16 bit word / 4 BCD bits = 4 digits).Ã‚Â  The figure below demonstrates how to convert a binary number to it's BCD equivalent.

The astute student will see that this is a lot like converting from binary to hexadecimal.Ã‚Â  In this case though there are no letters like A through F which is part of making it easier to read. Ã‚Â  In a pure binary sense the 16-bit word can have a value of 0 to 65535 but BCD limits us from 0 to 9999.

### What is BCD good for?

Most modern control system components like PLCs and HMIs (for example AutomationDirect) make the use of BCD seamless.Ã‚Â  That is, you use them like you would decimal numbers without knowing the difference.Ã‚Â  There comes a time though when you'll need to know the difference (for instance when setting up an I/O card).

The real use of BCD comes in older types of controls like thumbwheel switches, 7-segment data displays and absolute encoders.Ã‚Â  For example, the thumbwheel switch will have (at least) four outputs for one digit which represent the binary numbers of that digit.Ã‚Â  Ganging the thumbwheel switches together then makes a word in BCD format.