Draw the logic diagram of BCD adder and explain its working.
Q.) Draw the logic diagram of BCD adder and explain its working.
Subject: Digital ElectronicsA BCD (Binary-Coded Decimal) adder is a circuit that adds two BCD digits and produces a sum digit also in BCD. BCD is a form of decimal representation where each digit of a decimal number is represented by its own binary sequence. In BCD, the binary sequences 0000 to 1001 correspond to the decimal numbers 0 to 9. Any binary sequence above 1001 does not represent a valid BCD number.
To add BCD numbers, we can use a combination of binary adders and additional logic that handles the decimal carry and corrects the sum if it is not a valid BCD digit. The BCD adder is usually constructed from a 4-bit binary adder to add the BCD digits and a decimal carry logic to handle the carry from the fourth bit.
Step-by-Step Approach to Constructing a BCD Adder:
Binary Addition: First, add the two BCD digits using a 4-bit binary adder. The binary adder will give us a binary sum and a binary carry out.
Check for Invalid BCD: If the sum is greater than 9 (1001 in binary), it is not a valid BCD digit. We need to add 6 (0110 in binary) to correct it.
Decimal Carry: If there is a carry out from the 4-bit binary adder or if the binary sum is greater than 9, we need to generate a decimal carry for the next BCD digit.
Correction Mechanism: We use additional logic (AND, OR gates) to detect if the sum is greater than 9 and to generate the necessary signals to correct the sum and produce the decimal carry.
Logic Diagram and Explanation:
The logic diagram of a BCD adder is composed of the following parts:
- A 4-bit binary adder
- A 4-bit binary adder or an increment-by-6 circuit for correction
- Logic gates to detect the need for correction and to produce the decimal carry
Here is a simplified representation of a BCD adder:
A3 A2 A1 A0
+ B3 B2 B1 B0
--------------
S3 S2 S1 S0 (Binary Sum)
C4 (Carry Out)
Where A3-A0 and B3-B0 are the BCD digits to be added, and S3-S0 is the binary sum.
The correction mechanism can be represented as:
If (S3 S2 S1 S0 > 9 or C4 = 1) then
Add 0110 to the binary sum (S3 S2 S1 S0)
If there is a carry out, set the decimal carry (Cout) to 1
Example:
Let's add two BCD numbers: 5 (0101) and 7 (0111).
Perform binary addition:
0101 (5) + 0111 (7) ------ 1100 (12 in binary, which is an invalid BCD)
Since the sum is greater than 9, we need to add 6 (0110):
1100 (Invalid BCD) + 0110 (Correction) ------ 1 0010 (18 in binary, with a carry out)
The corrected sum is 0010 (2 in BCD), and we have a carry out, which will be the decimal carry for the next digit.
Differences and Important Points:
Feature | Binary Adder | BCD Adder |
---|---|---|
Number System | Binary | Binary-Coded Decimal |
Valid Outputs | 0 to 15 | 0 to 9 |
Correction Needed | No | Yes, if sum > 9 or carry out is 1 |
Additional Logic | No | Yes, to add 6 and generate Cout |
Carry Out | Binary Carry | Decimal Carry (if sum > 9 or C4=1) |
In summary, a BCD adder adds two BCD digits and corrects the sum if it is not a valid BCD digit. It uses a 4-bit binary adder for the initial sum and additional logic to ensure the result is a valid BCD number and to generate the correct decimal carry.