BCD-Addition-and-subtraction in digital .pptx

78 views 31 slides Nov 18, 2024
Slide 1
Slide 1 of 31
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
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31

About This Presentation

BCD subtraction


Slide Content

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

BCD addition case 1 example Ex: perform in BCD (2) 10 + (6) 10 Decimal BCD 2 0 0 1 0 1 st number + 6 0 1 1 0 2 nd 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 7 0 1 1 1 1 st number + 6 0 1 1 0 2 nd number 1 1 carry 8 1 1 0 1 answer (invalid BCD) 0 1 1 0 ADD 6 1 0 0 1 1 1 3 final answer Final Carry 1

BCD addition case 3 example Ex: perform in BCD (9) 10 + (8) 10 Decimal BCD 9 1 0 0 1 1 st number + 8 1 0 0 0 2 nd number 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 1 Final Carry

BCD arithmetic

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 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 number BCD number 9’s complement 10’s complement 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: 9’s complement method 10’s complement method

BCD subtraction using 9’s complement Perform BCD subtraction using 9’s complement method (A) 10 - (B) 10 Obtain 9’s complement of no. B Add no. A and 9’s complement of no. B If carry is generated in step 2 then add it to sum to obtain final result. The carry is called as end around carry. If carry is not produced then the result is negative hence take 9’s complement of the result.

Examples Perform (8) 10 - (3) 10 9’s complement of 3 8

Ex.

Ex.

Ex.

Solve following subtraction of decimal numbers using 9’s complement method. 1. Perform (7) 10 - (3) 10 2. Perform (4) 10 - (7) 10 3. Perform (83) 10 - (21) 10 4. Perform (52) 10 – (89) 10

BCD subtraction 10’s complement method Perform BCD subtraction using 10’s complement method (A) 10 - (B) 10 Obtain 10’s complement of no. B Add no. A and 10’s complement of no. B If carry is generated in step 2 then discard it. 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. 1. Perform (7) 10 - (3) 10 2. Perform (4) 10 - (7) 10 3. Perform (83) 10 - (21) 10 4. Perform (52) 10 – (89) 10

9’s complement and 10’s complement

Perform (9) 10 – (4) 10 using 1’s complement method

Perform (4) 10 – (9) 10 using 1’s complement method

Solve Perform following subtraction using 1’s complement method. (-5) 10 - (-7) 10 (48) 10 – (61) 10 (33) 10 – (54) 10 (99) 10 – (22) 10

Perform (9) 10 – (4) 10 using 2’s complement method

Perform (4) 10 – (9) 10 using 2’s complement method

Solve Perform following subtraction using 2’s complement method. (-5) 10 - (-7) 10 (48) 10 – (61) 10 (33) 10 – (54) 10 (99) 10 – (22) 10 (1010) 2 – (101) 2
Tags