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
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