BCD Code
Binary coded decimal, valid and invalid BCD, BCD addition.
The Binary Coded Decimal (BCD) format stores each decimal digit as a 4-bit binary group. It is used in digital clocks, calculators, cash registers, and seven-segment display drivers like the 74LS47 BCD-to-seven-segment decoder.
Core Concept
BCD uses the 8421 weighting — the four bit positions have weights 8, 4, 2, 1 respectively. Only the ten patterns 0000 through 1001 are valid. The six patterns 1010 through 1111 are invalid BCD codes and must never appear in a correctly operating BCD system.
BCD is inefficient in storage. A single decimal digit needs 4 bits in BCD but only 3.32 bits in pure binary. However, BCD eliminates decimal-to-binary conversion errors and is standard in financial systems, frequency counters, digital panel meters, and LCD/LED display drivers. The 74LS47 BCD-to-seven-segment decoder accepts a 4-bit BCD input and drives seven-segment displays with active-low outputs, sinking up to 40 mA per segment at 5V.
BCD addition requires a correction step. After adding two BCD digits normally, if the sum exceeds 9 (1001) or if a carry-out occurs, add 6 (0110) to the lower nibble. This skips the six invalid codes and produces the correct BCD result with a carry into the next decade. The 74LS83 can perform this operation when combined with correction logic.
Boolean Expression
The BCD correction condition is: add 0110 if (sum > 9) OR (carry-out = 1). The carry-out flag for BCD addition is set when the corrected sum generates a carry. For a multi-digit BCD number, each 4-bit group is processed independently with carry propagation between groups.
Given:
Add BCD 47 + BCD 36
Formula / Rule:
Add digit by digit (units then tens).
If sum > 9 or carry, add 6 to that digit.
Step by step:
Units digit: 7 + 6 = 13
BCD: 0111 + 0110 = 1101
1101 > 1001, so add 0110:
1101 + 0110 = 1|0011
Lower digit = 0011 = 3, carry = 1
Tens digit: 4 + 3 + 1(carry) = 8
BCD: 0100 + 0011 + 0001 = 1000
1000 <= 1001, no correction needed.
Digit = 1000 = 8, carry = 0
Final Answer:
BCD 47 + BCD 36 = BCD 83 (0111 0011)
Decimal check: 47 + 36 = 83 ✓Exam Tip: A very common GATE trap is forgetting to add the correction factor of 6 when a carry-out occurs even if the raw sum is 9 or less. If the binary addition of two BCD digits produces a carry-out, add 6 regardless of the digit value. Also remember: BCD 9 + BCD 9 = 0001 0001 0010 in BCD (which is 18), not 10010 (which is 18 in binary but not valid BCD format).
Key Properties
- 8421 BCD: weights are 8, 4, 2, 1 for bit positions 3, 2, 1, 0
- Valid codes: 0000 to 1001 (decimal 0 to 9); 10 out of 16 patterns
- Invalid codes: 1010 to 1111 (decimal 10 to 15); 6 unused patterns
- BCD addition correction: add 0110 when sum > 9 or carry-out occurs
- 74LS47 BCD-to-seven-segment decoder: 5V TTL, tpd = 40 ns, active-low outputs, 40 mA sink
- 74HC4511: CMOS BCD decoder with latch enable, 3–15V supply, modern replacement
- Packed BCD stores two decimal digits per byte (upper nibble + lower nibble)
Quick Revision
- BCD: each decimal digit encoded as 4 binary bits
- Valid range: 0000 to 1001; codes 1010–1111 are invalid
- BCD wastes 6 out of 16 possible 4-bit codes
- Addition correction: add 6 if sum > 9 or carry generated
- Used in: digital clocks, calculators, seven-segment displays, financial hardware
- 74LS47 decodes BCD to active-low seven-segment; 74HC4511 is the CMOS version
- Packed BCD: two digits per byte; used in x86 DAA (Decimal Adjust after Addition) instruction
- Exam trap: adding two BCD numbers and reporting the raw binary sum without applying the +6 correction — this is the most frequent BCD arithmetic error in GATE
BCD Code Quiz
Test your understanding of Binary Coded Decimal encoding and BCD addition rules.
Q1.Which of the following 4-bit patterns is an invalid BCD code?
Related Articles
Excess-3 Code
Self complementing code, BCD to Excess-3 conversion.
4 min read
Hamming Code
Error correction, redundant bits, syndrome calculation.
8 min read
ASCII Code
7-bit character encoding, printable and control characters.
11 min read
Code Converter Circuits
BCD to Gray, Gray to BCD, BCD to Excess-3 circuits.
9 min read
BCD Adder
4-bit BCD addition, correction logic for invalid BCD.
4 min read