Binary Coded Decimal (BCD) — TechAmbitionX | Mr. BILRED | Basic Stuff

Binary Coded Decimal (BCD) — TechAmbitionX
Binary Coded Decimal (BCD) Cover

🔹 1. What is BCD?

BCD (Binary Coded Decimal) is a way of representing decimal numbers (0–9) in binary form using 4 bits for each digit.

Example:

  • Decimal 59 → BCD = 0101 1001
  • Pure Binary 59 → 111011

Notice how in BCD, each digit is separate (5 = 0101, 9 = 1001). This makes it easier for circuits to display numbers.

🔹 2. Why use BCD?

Normal binary is compact, but BCD is better when numbers need to be shown to humans (digit by digit).

💡 Devices like digital clocks, calculators, counters, and 7-segment displays often use BCD internally.

🔹 3. Rules of BCD

  • Each digit = 4 bits (nibble).
  • Valid range = 0000 (0) to 1001 (9).
  • 1010–1111 are invalid in standard BCD.

🔹 4. BCD Truth Table (0–9)

Decimal BCD (8421)
00000
10001
20010
30011
40100
50101
60110
70111
81000
91001

🔹 5. BCD Addition

When adding, if the sum ≥ 10 (1010), add 0110 (6) to adjust it.

9 (1001)
+ 4 (0100)
= 1101 (13, invalid BCD)
+ 0110
= 1 0011 (Carry + 3 → 13 in BCD)
    

🔹 6. Applications

  • BCD to 7-segment decoder (for LED/LCD displays)
  • BCD adders & counters (decimal arithmetic in hardware)
  • Shift registers (rollover after 9 instead of 15)

🔹 7. Quick Recap

BCD = each decimal digit stored separately in 4-bit binary. ✅ Easier for digital logic & display circuits. ❌ Wastes memory compared to pure binary.

Disclaimer: Mistakes can happen; feel free to contact me.

SSB3YW50ZWQgdG8gYWRkIHNvbWV0aGluZyBtb3JlIGluIGl0IGJ1dC4uLiB1Z2gh

Comments

Popular posts from this blog

Bits, Bytes, Binary, and ASCII: The Fundamentals of Data Representation - Compiled By Bilal Ahmad Khan AKA Mr. BILRED - TechAmbitionX

C++ escape sequences with clear examples and outputs - Compiled By Bilal Ahmad Khan AKA Mr. BILRED

C++ Prog Lang In A Nutshell VOL #2 Compiled By Bilal Ahmad Khan AKA Mr. BILRED - TechAmbitonX