Decimal to BCD Conversion (8421, 5421, 2421 Codes) – Digital Electronics
Introduction
There are different types of BCD codes depending on the weights assigned to each binary digit:
-
8421 Code (Natural BCD, Weighted Code)
-
5421 Code (Weighted Code)
-
2421 Code (Self-Complementing Weighted Code)
Let’s understand each one in detail.
1. 8421 BCD Code (Natural Binary Coded Decimal)
This is the most common BCD code.
-
Each digit has positional weights: 8, 4, 2, 1
-
Decimal numbers 0–9 are represented as 0000–1001
| Decimal | 8421 BCD |
|---|---|
| 0 | 0000 |
| 1 | 0001 |
| 2 | 0010 |
| 3 | 0011 |
| 4 | 0100 |
| 5 | 0101 |
| 6 | 0110 |
| 7 | 0111 |
| 8 | 1000 |
| 9 | 1001 |
Example: Convert Decimal 59 into 8421 BCD
-
5 → 0101
-
9 → 1001
So, 59 = 0101 1001 (BCD)
2. 5421 BCD Code
In this system, the weights are: 5, 4, 2, 1
-
Each decimal digit 0–9 is represented by a unique combination of these weights.
| Decimal | 5421 BCD |
|---|---|
| 0 | 0000 |
| 1 | 0001 |
| 2 | 0010 |
| 3 | 0011 |
| 4 | 0100 |
| 5 | 1000 |
| 6 | 1001 |
| 7 | 1010 |
| 8 | 1011 |
| 9 | 1100 |
Example: Convert Decimal 59 into 5421 BCD
-
5 → 1000
-
9 → 1100
So, 59 = 1000 1100 (BCD in 5421 code)
3. 2421 BCD Code
This is a self-complementing code, meaning:
-
The code for a digit and its 9’s complement add up to 1111.
-
Weights: 2, 4, 2, 1
| Decimal | 2421 BCD |
|---|---|
| 0 | 0000 |
| 1 | 0001 |
| 2 | 0010 |
| 3 | 0011 |
| 4 | 0100 |
| 5 | 1011 |
| 6 | 1100 |
| 7 | 1101 |
| 8 | 1110 |
| 9 | 1111 |
Example: Convert Decimal 59 into 2421 BCD
-
5 → 1011
-
9 → 1111
So, 59 = 1011 1111 (BCD in 2421 code)
-
8421 BCD → Most practical, widely used in calculators, clocks, and digital systems.
-
5421 BCD → Alternative weighted code, less common.
-
2421 BCD → Self-complementing code, useful for error checking and arithmetic simplifications.
Mastering these codes is essential for Digital Electronics, Computer Science, and Competitive Exams (GATE, ESE, etc.).
Click here to download:

Comments
Post a Comment