Presentation is loading. Please wait.

Presentation is loading. Please wait.

Conversion and Coding (12)10.

Similar presentations


Presentation on theme: "Conversion and Coding (12)10."— Presentation transcript:

1 Conversion and Coding (12)10

2 Conversion and Coding (12)10 1100 Conversion

3 Conversion and Coding (12)10 00010010 1100 Coding Conversion
(using BCD code for each digit) Conversion

4 BCD Adder Design a circuit that calculates the
Arithmetic addition of two decimal digits. 9 + 3 1 2 carry

5 BCD Adder Maximum sum is 9+9 + 1 = 19 Max digit
Carry from previous digits

6 BCD adder (sum up to 9) Number C S8 S4 S2 S1 1 2 3 4 5 6 7 8 9

7 BCD adder (sum up to 9) Number C S8 S4 S2 S1 1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9 The sum is the same with BCD adder

8 BCD adder (sum is 10 to 19) Number C S8 S4 S2 S1 10 1 11 12 13 14 15
11 12 13 14 15 16 17 18 19

9 BCD adder (sum is 10 to 19) C S8 S4 S2 S1 10 1 11 12 13 14 15 16 17 18
Binary sum Number C S8 S4 S2 S1 10 1 11 12 13 14 15 16 17 18 19 K Z8 Z4 Z2 Z1 1

10 BCD adder (sum is 10 to 19) C S8 S4 S2 S1 10 1 11 12 13 14 15 16 17 18
Binary sum Number C S8 S4 S2 S1 10 1 11 12 13 14 15 16 17 18 19 K Z8 Z4 Z2 Z1 1

11 BCD adder (sum is 10 to 19) +6 C S8 S4 S2 S1 10 1 11 12 13 14 15 16 17
Binary sum Number C S8 S4 S2 S1 10 1 11 12 13 14 15 16 17 18 19 K Z8 Z4 Z2 Z1 1 +6

12 Algorithm for BCD Adder
If sum is up to 9 Use the regular Adder. If the sum > 9 Use the regular adder and add 6 to the result

13 When is the result > 9 K Z8 Z4 Z2 Z1 10 1 11 12 13 14 15 16 17 18
Binary sum Number K Z8 Z4 Z2 Z1 10 1 11 12 13 14 15 16 17 18 19 C = K +

14 When is the result > 9 K Z8 Z4 Z2 Z1 10 1 11 12 13 14 15 16 17 18
Binary sum Number K Z8 Z4 Z2 Z1 10 1 11 12 13 14 15 16 17 18 19 C = K + Z8*Z4+

15 When is the result > 9 K Z8 Z4 Z2 Z1 10 1 11 12 13 14 15 16 17 18
Binary sum Number K Z8 Z4 Z2 Z1 10 1 11 12 13 14 15 16 17 18 19 C = K + Z8*Z4+ Z8*Z2

16 BCD Adder 4-bit Adder Cin z8 z4 z2 z1 4-bit Adder K s8 s4 s2 s1


Download ppt "Conversion and Coding (12)10."

Similar presentations


Ads by Google