Related Concepts: 05 Excess-3 Code & Self-Complementing Logic | 06 Gray Code & Code Conversions
04 BCD and Weighted Digital Codes
Concept Overview
Binary-Coded Decimal (BCD) is a family of binary encoding schemes where each individual decimal digit ( through ) is represented separately by a 4-bit binary group.
The 8421 code is the standard form of BCD. It is a weighted code, meaning each bit position within a 4-bit group carries a specific positional weight (, , , and ).
1. Binary Codes Classification
graph TD Codes[Binary Codes] --> Weighted[Weighted Codes] Codes --> NonWeighted[Non-Weighted Codes] Weighted -->|8421 Positional Weights| StandardBCD[8421 Standard BCD] Weighted -->|Self-Complementing| Code2421[2421 Code] Weighted -->|Self-Complementing| Code84n2n1[84-2-1 Code] Weighted --> Code5421[5421 Code] Weighted --> Code5211[5211 Code] NonWeighted -->|Self-Complementing| XS3[Excess-3 Code] NonWeighted -->|Single Bit Change| Gray[Gray / Reflected Code]
2. Characteristics of 8421 BCD Code
Advantages (Merits)
- Simple & Intuitive: Provides a direct mapping between decimal numbers and binary representations.
- No Multi-Digit Conversions: Converting decimal to BCD simply replaces each decimal digit with its 4-bit binary code word.
- Display System Friendly: Ideal for interfacing with 7-segment displays and decimal output devices {calculators, digital clocks, multimeters}.
- Industry Standard: Standardized across human-machine interfaces (HMIs).
Disadvantages (Demerits)
- Memory Inefficient: Requires 4 bits per decimal digit. For large numbers, BCD uses significantly more storage than pure binary {decimal needs 8 bits in BCD:
0001 0101, but only 4 bits in pure binary:1111}. - Complex Arithmetic Operations: Binary adders cannot directly add BCD numbers without special correction steps.
- Extra Hardware Requirements: BCD addition requires correction logic {adding or binary
0110} whenever a 4-bit sum exceeds () or generates a carry.
3. Weighted BCD Codes & Comparison Table
A code is classified as weighted if every bit position is assigned a fixed numerical weight . The decimal value of a 4-bit word is evaluated using:
Comparison Table of 4-Bit Weighted Codes:
| Decimal Digit | 8421 (Standard BCD) | 2421 (Self-Complementing) | 5421 Code | 84-2-1 Code (Self-Complementing) | 5211 Code |
|---|---|---|---|---|---|
| 0 | 0000 | 0000 | 0000 | 0000 | 0000 |
| 1 | 0001 | 0001 | 0001 | 0111 | 0001 |
| 2 | 0010 | 0010 | 0010 | 0110 | 0011 |
| 3 | 0011 | 0011 | 0011 | 0101 | 0101 |
| 4 | 0100 | 0100 | 0100 | 0100 | 0111 |
| 5 | 0101 | 1011 | 1000 | 1011 | 1000 |
| 6 | 0110 | 1100 | 1001 | 1010 | 1001 |
| 7 | 0111 | 1101 | 1010 | 1001 | 1011 |
| 8 | 1000 | 1110 | 1011 | 1000 | 1101 |
| 9 | 1001 | 1111 | 1100 | 1111 | 1111 |
Verification of Bit Weights (Decimal 5)
- 8421 Code (
0101):- 2421 Code (
1011):- 5421 Code (
1000):- 84-2-1 Code (
1011):- 5211 Code (
1000):
4. Invalid BCD Combinations & Don’t Care States
A 4-bit binary group yields possible combinations (0000 through 1111). Because BCD only uses the first 10 states (0000 to 1001 representing decimals 0–9), there are 6 invalid states:
Use of Invalid States in Circuit Design
When designing combinational BCD circuits using K-maps, these 6 invalid states are assigned as “Don’t Care” (X) conditions. This allows logic minimization to form larger K-map groupings, yielding simpler Boolean equations.
Past Year Questions (PYQs) & Solutions
1. Number System vs. Code & Multi-Conversion (2018 - 12 Marks)
Question: Explain the distinction between number system and code with example. Convert into: (i) BCD code, (ii) 5211 code, and (iii) Gray code.
Part A: Distinction between Number System and Code
- Number System: A positional mathematical system {such as Decimal, Binary, Octal, or Hexadecimal} used to express quantitative magnitudes and perform arithmetic operations using a fixed base radix ().
- Code: A symbolic binary mapping scheme {such as BCD, Excess-3, or Gray code} used to encode numbers or characters into binary words for storage, transmission, or display, where standard binary arithmetic rules do not directly apply.
Part B: Conversions of
- (i) BCD (8421):
- (ii) 5211 Code: From table:
- (iii) Gray Code:
- Convert Binary to Gray via XOR:
2. Register Decoding Numerical (2022 - 12 Marks)
Question: A 12-bit register contains
100010010111. What decimal value does it represent if it holds:
- Three decimal digits in BCD?
- Three decimal digits in 8,4,-2,-1 code?
- A pure binary number?
Solutions:
- BCD Decoding: Chunks
1000 | 1001 | 0111.- 8,4,-2,-1 Code Decoding:
100010010111- Result: .
- Pure Binary Decoding: