Why is BCD = Decimal in PLC?

KMC picture KMC · Feb 21, 2012 · Viewed 16.5k times · Source

This question is derived from my previous SO question's commends.

I am confused with PLC's interpretation of BCD and decimal. In a PLC documentation, it somehow implies BCD = decimal:

enter image description here

The instruction reads the content of D300, 0100, as BCD. Referring to Cyber Slueth Omega's answer and online BCD-Hex converter, 0100 (BCD) = 4 (Decimal) = 4 (Hex), but the documentation indicates 0100 (BCD) = 100 (Decimal).

Why?

Answer

Ignacio Vazquez-Abrams picture Ignacio Vazquez-Abrams · Feb 21, 2012

Binary-coded decimal is encoded as hex digits that have a limited range of 0-9. This means that 0x0100 should be read as 100 when BCD is meant. Numbers with hexadecimal digits from A to F are not valid BCD numbers.