Binary-Coded Decimal (BCD)

A tool for direct and reverse BCD transformation with custom weights.

📚 About Algorithm

Binary-Coded Decimal (BCD) is an encoding where each decimal digit is represented by a separate 4-bit nibble.

  • Encoding: Each digit is replaced by 4 bits where the sum of weights (e.g. 8-4-2-1) equals the digit.
  • Decoding: The sequence is split into nibbles, and each value is calculated as the sum of active weights.
  • Forbidden states: Since a nibble has 16 combinations and there are only 10 digits, states > 9 are redundant.

🔒 BCD Encoding

// Waiting for input...

🔓 BCD Decoding

// Waiting for input...