Free engineering calculators and unit convertersceo@instrumentationblog.in
PLC Digital Signal · Free Calculator

BCD to Decimal Converter for PLCs

Convert between decimal and packed BCD (binary coded decimal), the code used by thumbwheel switches, 7 segment displays and some PLC timer and counter values. The PLC word is shown in hex and binary.

Packed BCDThumbwheel switches16 and 32 bitHex view
BCD word (hex)0x1234
BCD binary0001 0010 0011 0100
Word as integer4660 (value you see if the PLC shows it as INT)
Plain binary of 123410011010010
How this result was calculated
  1. Write each decimal digit as 4 bits: 1 = 0001, 2 = 0010, 3 = 0011, 4 = 0100
  2. BCD = 0x1234
Advertisement

BCD Encoding

Each decimal digit → 4 bits (0000 to 1001)
1234 → 0001 0010 0011 0100 = 0x1234
Valid BCD nibbles: 0 to 9 only

Packed BCD stores one decimal digit in each 4 bit nibble, so a 16 bit word holds 0 to 9999 and a 32 bit word 0 to 99,999,999. PLCs provide BCD and BIN (or BCD_TO_INT) instructions to convert.

Worked example

Decimal 1234 in BCD is 0x1234 (0001 0010 0011 0100). If the PLC reads that word as a normal integer it shows 4660, a classic thumbwheel bug.

Key insight: when a value read from a BCD device looks wrong and jumps oddly, check whether it is being treated as binary. Hex digits A to F in a BCD word also mean a wiring or reading error.
Advertisement

Frequently Asked Questions

What is BCD?

Binary coded decimal: each decimal digit is stored in 4 bits. It is easy to display but wastes some of the binary range.

Where is BCD used in PLCs?

Thumbwheel switches, 7 segment displays, some legacy timer and counter presets and real time clock registers.

Why does my value read 4660 instead of 1234?

The PLC is reading the BCD word 0x1234 as a binary integer. Use the BCD to integer conversion instruction.

You May Also Like

Learn more on the blog

Introduction to number systems

A practical, field focused guide on instrumentationblog.in that explains the theory behind this calculator and how engineers apply it on real plants.

Read Full Article

More PLC Digital Signal Calculators

More Calculator Categories