BCD Addition and Subtraction
BCD Addition and Subtraction
BCD addition
Add two numbers as same as binary addition
Case 1: If the result is less than or equals to 9
and carry is zero then it is valid BCD.
Case 2: If result is greater than 9 and carry is
zero then add 6 in four bit combination.
Case 3: If result is less than or equals to 9 but
carry is 1 then add 6 in four bit combination.
Summary of BCD addition
Add two BCD
numbers
Sum <= 9,
carry = 0 Sum > 9, Sum < = 9,
carry = 0 carry = 1
Answer is
correct no Add 6 to sum Add 6 to sum
correction to get correct to get correct
required answer answer
BCD addition case 1 example
Ex: perform in BCD (2)10 + (6)10
Decimal BCD
st
2 0 0 1 0 1 number
nd
+ 6 0
0 1 1 0 2 number
0 1 1 carry
8 1 0 0 0 answer
Final Carry
BCD addition case 2 example
Ex: perform in BCD (7)10 + (6)10
Decimal BCD
st
7 0 1 1 1 1 number
nd
+ 6 0 1 1 0 2 number
01 1 carry
1
1 0 0 1 1
1 3 final answer
BCD addition case 3 example
Ex: perform in BCD (9)10 + (8)10
Decimal BCD
st
9 1 0 0 1 1 number
nd
+ 8
1 1 0 0 0 2 number
carry
Final Carry
17 0 0 0 1 answer (valid BCD but carry 1)
0 0 0 1 0 1 1 0 ADD 6
0 0 0 1 0 1 1 1
1 7 final answer
BCD arithmatic
Solve?????
1. Perform in BCD (57)10 + (26)10
2. Perform in BCD (83)10 + (34)10
3. Perform in BCD (421)10 + (975)10
9’s complement:
9’s complement of a BCD number can be
obtained by subtracting it from 9.
10’s compliment:
10’s compliment is obtained by adding 1 to 9’s
compliment
9’s complement
• The 9’s complement of BCD number is
obtained by subtracting it from 9.
• Ex: 9’s complement of 1 = 9 – 1 = 8
Decimal number BCD number 9’s complement
0 0000 1001
1 0001 1000
2 0010 0111
3 0011 0110
4 0100 0101
5 0101 0100
6 0110 0011
7 0111 0010
8 1000 0001
9 1001 0000
Find the 9’s complement
• 9’s COMPLEMENT of 28 = 99 – 28 = 71
• 9’s COMPLEMENT of 562 = 999 – 562 = 437
10’s complement
• 10’s complement of a number is obtained by
adding 1 to its 9’s complement.
Decimal BCD number 9’s 10’s
number complement complement
0 0000 1001 1 0000
1 0001 1000 1001
2 0010 0111 1000
3 0011 0110 0111
4 0100 0101 0110
5 0101 0100 0101
6 0110 0011 0100
7 0111 0010 0011
8 1000 0001 0010
9 1001 0000 0001
BCD subtraction
• Two methods:
1. 9’s complement method
2. 10’s complement method
BCD subtraction using 9’s complement
• Perform BCD subtraction using 9’s
complement method (A)10 - (B)10
1. Obtain 9’s complement of no. B
3. If carry is generated in step 2 then add it to sum to obtain final result. The
4. If carry is not produced then the result is negative hence take 9’s complement
of the result.
Examples
• Perform (8)10 - (3)10
8
9’s complement of 3
Ex.
Ex.
Ex.
Solve following subtraction of decimal
numbers using 9’s complement method.
4. If carry is not produced then the result is negative hence take 10’s complement
of the result.
Example using 10’s complement
Solve following subtraction of decimal
numbers using 9’s complement method.