Sie sind auf Seite 1von 16

Conversion and Coding

(12)10

Conversion and Coding


(12)10

1100

Conversion

Conversion and Coding


(12)10

1100

Conversion

Coding
(using BCD code
for each digit)

00010010

BCD Adder
Design a circuit that calculates the
Arithmetic addition of two decimal digits.
+

1
carry

9
3
2

BCD Adder

Maximum sum is 9+9 + 1 = 19


Max digit

Carry from previous digits

BCD adder (sum up to 9)


Number

S8

S4

S2

S1

BCD adder (sum up to 9)


Number

S8

S4

S2

S1

The sum is the same with BCD adder

BCD adder (sum is 10 to


19)
Number

S8

S4

S2

S1

10

11

12

13

14

15

16

17

18

19

BCD adder (sum is 10 to


19)
Binary sum

BCD adder sum


Numbe
r

S8

S4

S2

S1

Z8

Z4

Z2

Z1

10

11

12

13

14

15

16

17

18

19

BCD adder (sum is 10 to


19)
Binary sum

BCD adder sum


Numbe
r

S8

S4

S2

S1

Z8

Z4

Z2

Z1

10

11

12

13

14

15

16

17

18

19

BCD adder (sum is 10 to


19)
Binary sum

BCD adder sum


Numbe
r

S8

S4

S2

S1

Z8

Z4

Z2

Z1

10

11

12

13

14

15

16

17

18

19

+6

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

When is the result > 9


Binary sum
Number

Z8

Z4

Z2

Z1

10

11

12

13

14

15

16

17

18

19

C=K+

When is the result > 9


Binary sum
Number

Z8

Z4

Z2

Z1

10

11

12

13

14

15

16

17

18

19

C = K + Z8*Z4+

When is the result > 9


Binary sum
Number

Z8

Z4

Z2

Z1

10

11

12

13

14

15

16

17

18

19

C = K + Z8*Z4+
Z8*Z2

BCD Adder
4-bit Adder

z8 z4 z2 z1

4-bit Adder

s8 s4 s2 s1

Cin

Das könnte Ihnen auch gefallen