Decimal adder

5,557 views 18 slides Apr 02, 2019
Slide 1
Slide 1 of 18
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18

About This Presentation

PPTs on Decimal Adder


Slide Content

SYED HASAN SAEED
[email protected]
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

Assumethattwo4-bitBCDnumbersarebeingadded.InBCD
addition,therearethreedifferentcases.Letusconsideronebyone.
CASE1:Sumequaltoorlessthan9withcarry0
DECIMAL BCD
2 0010
+3 0011
Carry 1
SUM 5 00101
Syed Hasan Saeed, Integral University,
Lucknow
4
Valid BCD Number
Final 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
CASE2:Sumgreaterthan9withcarry0
DECIMAL BCD
5 0101
+7 0111
Carry 11
SUM 12 01100
0110
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
Ifthesumoftwonumbersisgreaterthan9withcarryzero,andthesumis
invalidBCDnumber,thencorrectionisrequired.Add0110(6)forcorrection.
FinalresultwillbethevalidBCDnumber.

Syed Hasan Saeed, Integral University,
Lucknow
6
Syed Hasan Saeed, Integral University,
Lucknow
6
CASE3:Sumisequaltoorlessthan9withcarry1
DECIMAL BCD
8 1000
+8 1000
Carry 1
SUM 16 10000
0110
Syed Hasan Saeed, Integral University,
Lucknow
6
Invalid BCD Number
Add 6 for correction
0 1 1 0
0 1 1 0 0 0 0 1
Final Carry
1 6
Final result
Valid BCD number with
carry 1
Ifthesumoftwonumbersisequaltoorlessthanthan9withcarry1,andthe
sumisinvalidBCDnumber,thencorrectionisrequired.Add0110(6)for
correction.FinalresultwillbethevalidBCDnumber.
1

DESIGN:
•Infig.1B
3B
2B
1B
0andA
3A
2A
1A
0aretheBCDinputs.S
3S
2S
1S
0and
C
outistheoutputofAdder1.
•CheckedtheoutputofAdder1,whetheritisgreaterthanorless
than9.
•IfthesumofAdder1isgreaterthan9thentheoutputof
combinationalcircuitshouldbe1(i.eC
outshouldbehigh)and
correctionisrequired.
•WritethetruthtableandK-Mapforcombinationalcircuit.
•TheBooleanExpressionfromK-MapY=S
3S
2+S
3S
1
•TheoutputofcombinationalcircuitY
2isconnectedtoB
2B
1of
Adder2andB
3B
0areconnectedtotheground.ThereforeB
3=B
0=0
•TheoutputsumofAdder1isconnectedtoAdder2.theoutputof
Adder2isthefinalresultofBCDadditionwithCarrywhichcanbe
ignoredifany.
Syed Hasan Saeed, Integral University,
Lucknow
7

INPUTS OUTPUT
S
S3S2S1S0 Y
1
0 000 0
0 001 0
0 010 0
0 011 0
0 100 0
0 101 0
0 110 0
0 111 0
1 000 0
1 001 0
1 010 1
1 011 1
1 100 1
1 101 1
1 110 1
1 111 1
SyedHasanSaeed, Integral University, Lucknow
8
Sum is valid BCD number. Therefore Y=0
Sum is valid BCD number. Therefore Y=1
TRUTH TABLE
K-Map

INPUTS OUTPUT
S
S3S2S1S0 Y
1
0 000 0
0 001 0
0 010 0
0 011 0
0 100 0
0 101 0
0 110 0
0 111 0
1 000 0
1 001 0
1 010 1
1 011 1
1 100 1
1 101 1
1 110 1
1 111 1
SyedHasanSaeed, Integral University, Lucknow
9
Sum is valid BCD number. Therefore Y=0
Sum is valid BCD number. Therefore Y=1
TRUTH TABLE
0 0 0 0
0 0 0 0
1 1 1 1
0 0 1 1
K-Map
S
3S
2
S
1S
0
00 01 11 10
10
11
01
00

INPUTS OUTPUT
S
S3S2S1S0 Y
1
0 000 0
0 001 0
0 010 0
0 011 0
0 100 0
0 101 0
0 110 0
0 111 0
1 000 0
1 001 0
1 010 1
1 011 1
1 100 1
1 101 1
1 110 1
1 111 1
SyedHasanSaeed, Integral University, Lucknow
10
Sum is valid BCD number. Therefore Y=0
Sum is valid BCD number. Therefore Y=1
TRUTH TABLE
0 0 0 0
0 0 0 0
1 1 1 1
0 0 1 1
K-Map
S
3S
2
S
1S
0
00 01 11 10
10
11
01
00
Y
1=S
3S
2+S
3S
1

Syed Hasan Saeed, Integral University,
Lucknow
11
0
Output Carry
C
out
C
out
A
1A
OA
3A
2B
O
B
1B
2B
3
S
OS
1S
2
S
3
S
OS
1S
2S
3
C
in
C
in
4-Bit Binary Adder 1
4-Bit Binary Adder 2
S
3S
1
S
3S
2
Final Sum Output
Combinational
Circuit
Not To Be Used
Fig. 1: BLOCK DIAGRAM OF BCD ADDER
Y
1
Y
2
M
3 M
2 M
1 M
0

CASE1:Sumequaltoorlessthan9withcarry0
DECIMAL BCD
2 0010
+1 0001
Carry 0
SUM 3 00011
Syed Hasan Saeed, Integral University,
Lucknow
12
Valid BCD NumberFinal Carry
Output of combinational circuit Y
2= 0, M
3 M
2 M
1 M
0= 0
Output of Adder 2 is same as the output of Adder 1

Syed Hasan Saeed, Integral University,
Lucknow
13
0
Output Carry
C
out
C
out
A
1A
OA
3A
2B
O
B
1B
2B
3
S
OS
1S
2
S
3
S
OS
1S
2S
3
C
in
C
in
4-Bit Binary Adder 1
4-Bit Binary Adder 2
S
3S
1
S
3S
2
Final Sum Output
Combinational
Circuit
Not To Be Used
Fig. 1: BLOCK DIAGRAM OF BCD ADDER
Y
1
Y
2
0 0 0 1
0 0 1 0
0
0
0
0
0
0000
0011
0011
M
3 M
2 M
1 M
0

Consider second case
Syed Hasan Saeed, Integral University,
Lucknow
14
CASE2:Sumgreaterthan9withcarry0
DECIMAL BCD
5 0101
+7 0111
Carry 11
SUM 12 01100
0110
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 Y
2= 0, M
3 M
2 M
1 M
0= 0 1 1 0

Syed Hasan Saeed, Integral University,
Lucknow
15
0
Output Carry
C
out
C
out
A
1A
OA
3A
2B
O
B
1B
2B
3
S
OS
1S
2
S
3
S
OS
1S
2S
3
C
in
C
in
4-Bit Binary Adder 1
4-Bit Binary Adder 2
S
3S
1
S
3S
2
Final Sum Output
Combinational
Circuit
Not To Be Used
Fig. 1: BLOCK DIAGRAM OF BCD ADDER
Y
1
Y
2
0 00 1 1111
1100
1
1
1
1
0
0
1
1
0
1
1000
00 01
2
1000
1
M
3 M
2 M
1 M
0
0 1 1 0

Syed Hasan Saeed, Integral University,
Lucknow
16
Syed Hasan Saeed, Integral University,
Lucknow
16
CASE3:Sumisequaltoorlessthan9withcarry1
DECIMAL BCD
8 1000
+8 1000
Carry 1
SUM 16 10000
0110
Syed Hasan Saeed, Integral University,
Lucknow
16
Invalid BCD Number
Add 6 for correction
0 1 1 0
0 1 1 0 0 0 0 1
Final Carry
1 6
Final result
Valid BCD number with
carry 1
1
Output of combinational circuit Y
2= 1, M
3 M
2 M
1 M
0= 0 1 1 0

SyedHasanSaeed, Integral University,
Lucknow
17
0
Output Carry
C
out
C
out
A
1A
OA
3A
2B
O
B
1B
2B
3
S
OS
1S
2
S
3
S
OS
1S
2S
3
C
in
C
in
4-Bit Binary Adder 1
4-Bit Binary Adder 2
S
3S
1
S
3S
2
Final Sum Output
Combinational
Circuit
Not To Be Used
Fig. 1: BLOCK DIAGRAM OF BCD ADDER
Y
1
Y
2
1 1
1
000 000
0000
0
0
0
1
110 0 0000
1
1 10 0
0 0 0 1
0 1 1 0
6
1
M
3 M
2 M
1 M
0

THANK YOU
Syed Hasan Saeed, Integral University,
Lucknow
18
Tags