SYED HASAN SAEED
hasansaeedcontrol@gmail.com
https://shasansaeed.yolasite.com
1
Syed Hasan Saeed, Integral University,
Lucknow
DECIMAL ADDER
2
Syed Hasan Saeed, Integral University,
Lucknow
BCD ADDER:
A BCD adder should perform the following
• Add two 4-bit BCD number using straight Binary Addition.
• If the sum of two numbers is equal to or less than 9, then the sum is
valid BCD number and no correction is required.
• If the sum of two numbers is greater than 9 or carry is generated
from the sum, then the sum is not valid BCD number. Then add
0110 (6) to the sum, the result will be valid BCD number. If further
a carry is generated then add 0110 to the result.
Syed Hasan Saeed, Integral University,
Lucknow
3
Assume that two 4-bit BCD numbers are being added. In BCD
addition, there are three different cases. Let us consider one by one.
CASE 1: Sum equal to or less than 9 with carry 0
DECIMAL BCD
2 0 0 1 0
+ 3 0 0 1 1
Carry 1
SUM 5 0 0 1 0 1
Syed Hasan Saeed, Integral University,
Lucknow
4
Valid BCD NumberFinal Carry
If the sum of two numbers is less than or equal to 9 with final carry zero,
then the sum is valid BCD number and no correction is required.
Consider second case
Syed Hasan Saeed, Integral University,
Lucknow
5
CASE 2: Sum greater than 9 with carry 0
DECIMAL BCD
5 0 1 0 1
+ 7 0 1 1 1
Carry 1 1
SUM 12 0 1 1 0 0
0 1 1 0
Syed Hasan Saeed, Integral University,
Lucknow
5
Invalid BCD Number
Carry
Add 6 for correction
1 0 0 1 0
0 0 1 00 0 0 1
Final Carry
1 2
Final result
Valid BCD number with
carry 1
If the sum of two numbers is greater than 9 with carry zero , and the sum is
invalid BCD number, then correction is required. Add 0 1 1 0 (6) for correction.
Final result will be the valid BCD number.
Syed Hasan Saeed, Integral University,
Lucknow
6
Syed Hasan Saeed, Integral University,
Lucknow
6
CASE 3: Sum is equal to or less than 9 with carry 1
DECIMAL BCD
8 1 0 0 0
+ 8 1 0 0 0
Carry 1
SUM 16 1 0 0 0 0
0 1 1 0
Syed Hasan Saeed, Integral University,
Lucknow
6
Invalid BCD Number
Add 6 for correction
0 1 1 0
0 1 1 00 0 0 1
Final Carry
1 6
Final result Valid BCD number with
carry 1
If the sum of two numbers is equal to or less than than 9 with carry 1 , and the
sum is invalid BCD number, then correction is required. Add 0 1 1 0 (6) for
correction. Final result will be the valid BCD number.
1
DESIGN:
• In fig. 1 B3B2B1B0 and A3A2A1A0 are the BCD inputs. S3S2S1S0 and
Cout is the output of Adder 1.
• Checked the output of Adder 1, whether it is greater than or less
than 9.
• If the sum of Adder 1 is greater than 9 then the output of
combinational circuit should be 1 (i.e Cout should be high ) and
correction is required.
• Write the truth table and K-Map for combinational circuit.
• The Boolean Expression from K-Map Y= S3S2+S3S1
• The output of combinational circuit Y2 is connected to B2B1 of
Adder 2 and B3B0 are connected to the ground. Therefore B3=B0=0
• The output sum of Adder 1 is connected to Adder 2. the output of
Adder 2 is the final result of BCD addition with Carry which can be
ignored if any.
Syed Hasan Saeed, Integral University,
Lucknow
7
INPUTS OUTPUT
S
S3 S2 S1 S0 Y1
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 0
0 1 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 0
1 0 0 0 0
1 0 0 1 0
1 0 1 0 1
1 0 1 1 1
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1
Syed Hasan Saeed, Integral University, Lucknow
8
SumisvalidBCDnumber.Therefore
Y=0
SumisvalidBCD
number.Therefore
Y=1
TRUTHTABLE K-Map
INPUTS OUTPUT
S
S3 S2 S1 S0 Y1
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 0
0 1 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 0
1 0 0 0 0
1 0 0 1 0
1 0 1 0 1
1 0 1 1 1
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1
Syed Hasan Saeed, Integral University, Lucknow
9
SumisvalidBCDnumber.Therefore
Y=0
SumisvalidBCD
number.Therefore
Y=1
TRUTHTABLE
0 0 0 0
0 0 0 0
1 1 1 1
0 0 1 1
K-Map
S3S2
S1S0
00 01 11 10
10
11
01
00
INPUTS OUTPUT
S
S3 S2 S1 S0 Y1
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 0
0 1 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 0
1 0 0 0 0
1 0 0 1 0
1 0 1 0 1
1 0 1 1 1
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1
Syed Hasan Saeed, Integral University, Lucknow
10
SumisvalidBCDnumber.Therefore
Y=0
SumisvalidBCD
number.Therefore
Y=1
TRUTHTABLE
0 0 0 0
0 0 0 0
1 1 1 1
0 0 1 1
K-Map
S3S2
S1S0
00 01 11 10
10
11
01
00
Y1=S3S2+S3S1
Syed Hasan Saeed, Integral University,
Lucknow
11
0
Output Carry
Cout
Cout
A1 AOA3 A2BO
B1B2B3
SOS1S2S3
SOS1S2S3
Cin
Cin
4-Bit Binary Adder 1
4-Bit Binary Adder 2
S3S1
S3S2
Final Sum Output
Combinational
Circuit
Not To Be Used
Fig.1:BLOCKDIAGRAMOFBCDADDER
Y1
Y2
M3 M2 M1 M0
CASE 1: Sum equal to or less than 9 with carry 0
DECIMAL BCD
2 0 0 1 0
+ 1 0 0 0 1
Carry 0
SUM 3 0 0 0 1 1
Syed Hasan Saeed, Integral University,
Lucknow
12
Valid BCD NumberFinal Carry
Output of combinational circuit Y2= 0, M3 M2 M1 M0 = 0
Output of Adder 2 is same as the output of Adder 1
Syed Hasan Saeed, Integral University,
Lucknow
13
0
Output Carry
Cout
Cout
A1 AOA3 A2BO
B1B2B3
SOS1S2S3
SOS1S2S3
Cin
Cin
4-Bit Binary Adder 1
4-Bit Binary Adder 2
S3S1
S3S2
Final Sum Output
Combinational
Circuit
Not To Be Used
Fig.1:BLOCKDIAGRAMOFBCDADDER
Y1
Y2
0 0 0 10 0 1 0
0
0
0
0
0
0 0 0 0 0 0 1 1
0 0 1 1
M3 M2 M1 M0
Consider second case
Syed Hasan Saeed, Integral University,
Lucknow
14
CASE 2: Sum greater than 9 with carry 0
DECIMAL BCD
5 0 1 0 1
+ 7 0 1 1 1
Carry 1 1
SUM 12 0 1 1 0 0
0 1 1 0
Syed Hasan Saeed, Integral University,
Lucknow
14
Invalid BCD Number
Carry
Add 6 for correction
1 0 0 1 0
0 0 1 00 0 0 1
Final Carry
1 2
Final result
Valid BCD number with
carry 1
Output of combinational circuit Y2= 0, M3 M2 M1 M0 = 0 1 1 0
Syed Hasan Saeed, Integral University,
Lucknow
15
0
Output Carry
Cout
Cout
A1 AOA3 A2BO
B1B2B3
SOS1S2S3
SOS1S2S3
Cin
Cin
4-Bit Binary Adder 1
4-Bit Binary Adder 2
S3S1
S3S2
Final Sum Output
Combinational
Circuit
Not To Be Used
Fig.1:BLOCKDIAGRAMOFBCDADDER
Y1
Y2
0 00 1 1111
1 1 0 0
1 1
1
1
0
0
1
1
0
1 1 000
00 01
2
1000
1
M3 M2 M1 M0
0 1 1 0
Syed Hasan Saeed, Integral University,
Lucknow
16
Syed Hasan Saeed, Integral University,
Lucknow
16
CASE 3: Sum is equal to or less than 9 with carry 1
DECIMAL BCD
8 1 0 0 0
+ 8 1 0 0 0
Carry 1
SUM 16 1 0 0 0 0
0 1 1 0
Syed Hasan Saeed, Integral University,
Lucknow
16
Invalid BCD Number
Add 6 for correction
0 1 1 0
0 1 1 00 0 0 1
Final Carry
1 6
Final result Valid BCD number with
carry 1
1
Output of combinational circuit Y2= 1, M3 M2 M1 M0 = 0 1 1 0
Syed Hasan Saeed, Integral University,
Lucknow
17
0
Output Carry
Cout
Cout
A1 AOA3 A2BO
B1B2B3
SOS1S2S3
SOS1S2S3
Cin
Cin
4-Bit Binary Adder 1
4-Bit Binary Adder 2
S3S1
S3S2
Final Sum Output
Combinational
Circuit
Not To Be Used
Fig.1:BLOCKDIAGRAMOFBCDADDER
Y1
Y2
1 1
1
0 0 0 000
0000
0
0
0
1
1 10 0 00 0 0
1 1 10 0
0 0 0 1
0 1 1 0 61
M3 M2 M1 M0
THANK YOU
Syed Hasan Saeed, Integral University,
Lucknow
18

Decimal adder

  • 1.
  • 2.
    DECIMAL ADDER 2 Syed HasanSaeed, Integral University, Lucknow
  • 3.
    BCD ADDER: A BCDadder should perform the following • Add two 4-bit BCD number using straight Binary Addition. • If the sum of two numbers is equal to or less than 9, then the sum is valid BCD number and no correction is required. • If the sum of two numbers is greater than 9 or carry is generated from the sum, then the sum is not valid BCD number. Then add 0110 (6) to the sum, the result will be valid BCD number. If further a carry is generated then add 0110 to the result. Syed Hasan Saeed, Integral University, Lucknow 3
  • 4.
    Assume that two4-bit BCD numbers are being added. In BCD addition, there are three different cases. Let us consider one by one. CASE 1: Sum equal to or less than 9 with carry 0 DECIMAL BCD 2 0 0 1 0 + 3 0 0 1 1 Carry 1 SUM 5 0 0 1 0 1 Syed Hasan Saeed, Integral University, Lucknow 4 Valid BCD NumberFinal Carry If the sum of two numbers is less than or equal to 9 with final carry zero, then the sum is valid BCD number and no correction is required.
  • 5.
    Consider second case SyedHasan Saeed, Integral University, Lucknow 5 CASE 2: Sum greater than 9 with carry 0 DECIMAL BCD 5 0 1 0 1 + 7 0 1 1 1 Carry 1 1 SUM 12 0 1 1 0 0 0 1 1 0 Syed Hasan Saeed, Integral University, Lucknow 5 Invalid BCD Number Carry Add 6 for correction 1 0 0 1 0 0 0 1 00 0 0 1 Final Carry 1 2 Final result Valid BCD number with carry 1 If the sum of two numbers is greater than 9 with carry zero , and the sum is invalid BCD number, then correction is required. Add 0 1 1 0 (6) for correction. Final result will be the valid BCD number.
  • 6.
    Syed Hasan Saeed,Integral University, Lucknow 6 Syed Hasan Saeed, Integral University, Lucknow 6 CASE 3: Sum is equal to or less than 9 with carry 1 DECIMAL BCD 8 1 0 0 0 + 8 1 0 0 0 Carry 1 SUM 16 1 0 0 0 0 0 1 1 0 Syed Hasan Saeed, Integral University, Lucknow 6 Invalid BCD Number Add 6 for correction 0 1 1 0 0 1 1 00 0 0 1 Final Carry 1 6 Final result Valid BCD number with carry 1 If the sum of two numbers is equal to or less than than 9 with carry 1 , and the sum is invalid BCD number, then correction is required. Add 0 1 1 0 (6) for correction. Final result will be the valid BCD number. 1
  • 7.
    DESIGN: • In fig.1 B3B2B1B0 and A3A2A1A0 are the BCD inputs. S3S2S1S0 and Cout is the output of Adder 1. • Checked the output of Adder 1, whether it is greater than or less than 9. • If the sum of Adder 1 is greater than 9 then the output of combinational circuit should be 1 (i.e Cout should be high ) and correction is required. • Write the truth table and K-Map for combinational circuit. • The Boolean Expression from K-Map Y= S3S2+S3S1 • The output of combinational circuit Y2 is connected to B2B1 of Adder 2 and B3B0 are connected to the ground. Therefore B3=B0=0 • The output sum of Adder 1 is connected to Adder 2. the output of Adder 2 is the final result of BCD addition with Carry which can be ignored if any. Syed Hasan Saeed, Integral University, Lucknow 7
  • 8.
    INPUTS OUTPUT S S3 S2S1 S0 Y1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 1 0 0 1 0 0 0 0 1 0 1 0 0 1 1 0 0 0 1 1 1 0 1 0 0 0 0 1 0 0 1 0 1 0 1 0 1 1 0 1 1 1 1 1 0 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 Syed Hasan Saeed, Integral University, Lucknow 8 SumisvalidBCDnumber.Therefore Y=0 SumisvalidBCD number.Therefore Y=1 TRUTHTABLE K-Map
  • 9.
    INPUTS OUTPUT S S3 S2S1 S0 Y1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 1 0 0 1 0 0 0 0 1 0 1 0 0 1 1 0 0 0 1 1 1 0 1 0 0 0 0 1 0 0 1 0 1 0 1 0 1 1 0 1 1 1 1 1 0 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 Syed Hasan Saeed, Integral University, Lucknow 9 SumisvalidBCDnumber.Therefore Y=0 SumisvalidBCD number.Therefore Y=1 TRUTHTABLE 0 0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 K-Map S3S2 S1S0 00 01 11 10 10 11 01 00
  • 10.
    INPUTS OUTPUT S S3 S2S1 S0 Y1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 1 0 0 1 0 0 0 0 1 0 1 0 0 1 1 0 0 0 1 1 1 0 1 0 0 0 0 1 0 0 1 0 1 0 1 0 1 1 0 1 1 1 1 1 0 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 Syed Hasan Saeed, Integral University, Lucknow 10 SumisvalidBCDnumber.Therefore Y=0 SumisvalidBCD number.Therefore Y=1 TRUTHTABLE 0 0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 K-Map S3S2 S1S0 00 01 11 10 10 11 01 00 Y1=S3S2+S3S1
  • 11.
    Syed Hasan Saeed,Integral University, Lucknow 11 0 Output Carry Cout Cout A1 AOA3 A2BO B1B2B3 SOS1S2S3 SOS1S2S3 Cin Cin 4-Bit Binary Adder 1 4-Bit Binary Adder 2 S3S1 S3S2 Final Sum Output Combinational Circuit Not To Be Used Fig.1:BLOCKDIAGRAMOFBCDADDER Y1 Y2 M3 M2 M1 M0
  • 12.
    CASE 1: Sumequal to or less than 9 with carry 0 DECIMAL BCD 2 0 0 1 0 + 1 0 0 0 1 Carry 0 SUM 3 0 0 0 1 1 Syed Hasan Saeed, Integral University, Lucknow 12 Valid BCD NumberFinal Carry Output of combinational circuit Y2= 0, M3 M2 M1 M0 = 0 Output of Adder 2 is same as the output of Adder 1
  • 13.
    Syed Hasan Saeed,Integral University, Lucknow 13 0 Output Carry Cout Cout A1 AOA3 A2BO B1B2B3 SOS1S2S3 SOS1S2S3 Cin Cin 4-Bit Binary Adder 1 4-Bit Binary Adder 2 S3S1 S3S2 Final Sum Output Combinational Circuit Not To Be Used Fig.1:BLOCKDIAGRAMOFBCDADDER Y1 Y2 0 0 0 10 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 M3 M2 M1 M0
  • 14.
    Consider second case SyedHasan Saeed, Integral University, Lucknow 14 CASE 2: Sum greater than 9 with carry 0 DECIMAL BCD 5 0 1 0 1 + 7 0 1 1 1 Carry 1 1 SUM 12 0 1 1 0 0 0 1 1 0 Syed Hasan Saeed, Integral University, Lucknow 14 Invalid BCD Number Carry Add 6 for correction 1 0 0 1 0 0 0 1 00 0 0 1 Final Carry 1 2 Final result Valid BCD number with carry 1 Output of combinational circuit Y2= 0, M3 M2 M1 M0 = 0 1 1 0
  • 15.
    Syed Hasan Saeed,Integral University, Lucknow 15 0 Output Carry Cout Cout A1 AOA3 A2BO B1B2B3 SOS1S2S3 SOS1S2S3 Cin Cin 4-Bit Binary Adder 1 4-Bit Binary Adder 2 S3S1 S3S2 Final Sum Output Combinational Circuit Not To Be Used Fig.1:BLOCKDIAGRAMOFBCDADDER Y1 Y2 0 00 1 1111 1 1 0 0 1 1 1 1 0 0 1 1 0 1 1 000 00 01 2 1000 1 M3 M2 M1 M0 0 1 1 0
  • 16.
    Syed Hasan Saeed,Integral University, Lucknow 16 Syed Hasan Saeed, Integral University, Lucknow 16 CASE 3: Sum is equal to or less than 9 with carry 1 DECIMAL BCD 8 1 0 0 0 + 8 1 0 0 0 Carry 1 SUM 16 1 0 0 0 0 0 1 1 0 Syed Hasan Saeed, Integral University, Lucknow 16 Invalid BCD Number Add 6 for correction 0 1 1 0 0 1 1 00 0 0 1 Final Carry 1 6 Final result Valid BCD number with carry 1 1 Output of combinational circuit Y2= 1, M3 M2 M1 M0 = 0 1 1 0
  • 17.
    Syed Hasan Saeed,Integral University, Lucknow 17 0 Output Carry Cout Cout A1 AOA3 A2BO B1B2B3 SOS1S2S3 SOS1S2S3 Cin Cin 4-Bit Binary Adder 1 4-Bit Binary Adder 2 S3S1 S3S2 Final Sum Output Combinational Circuit Not To Be Used Fig.1:BLOCKDIAGRAMOFBCDADDER Y1 Y2 1 1 1 0 0 0 000 0000 0 0 0 1 1 10 0 00 0 0 1 1 10 0 0 0 0 1 0 1 1 0 61 M3 M2 M1 M0
  • 18.
    THANK YOU Syed HasanSaeed, Integral University, Lucknow 18