hmwk7-sols

hmwk7-sols - 194 Solutions Manual - Introduction to Digital...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 194 Solutions Manual - Introduction to Digital Design - November 15, 2000 Exercise 10.4 BCD Addition When we add two BCD digits (0..9), considering a carry-in bit, the range of values obtained is from 0 to 19. The output consists of a carry out and a digit coded in BCD also. s = (a + b + CIN ) mod 10 ( 1 if (a + b + C COU T = 0 if otherwise IN ) 10 where s; a and b are BCD digits. When the integers a and b are applied to the inputs of the binary adder, the output is: z = (a + b + CIN ) mod 24 ( 4 1 if (a + b + C C0 = 0 if otherwise IN ) 2 So, looking at the binary adder output and comparing to the expected output for the BCD adder, we must consider three cases: (i) C0 = 0 and z < 10: the output of the binary adder does not need correction (ii) 10 z 15 and C0 = 0: in this case we convert the sum as follows: s = z mod 10 = (z ? 10) = (z + 6) mod 16 As the operation is done with 4 bits, adding 6 is equivalent to subtracting 10. COU T = 1 (iii) C0 = 1: in this case z = (A + B + Cin ) ? 16 and we want s = (A + B + Cin ) mod 10. For this range of values we have (A + B + Cin ) mod 10 = (A + B + Cin ) ? 10, so we make: s = z+6 COU T = 1 Therefore, to obtain the BCD adder, the following operations must be performed to the binary adder output (z ): ( if z C =0 s = zz + 6) mod 16 if 10 9zand15 0or C = 1 ( 0 C = COU T = 0 if z 9 and C 0 = 10 1 if z 10 or 0 The condition z 10 or C0 = 1 is described by the switching expression: ( w = (z1z3 + z2z3 + C0) The circuit is shown in Figure 10.2. Solutions Manual - Introduction to Digital Design - November 15, 2000 195 _ a _ b Binary Adder cin =0 0 0 Binary Adder 0 Cout _ s Figure 10.2: BCD adder (Exercise 10.4) ...
View Full Document

This note was uploaded on 04/17/2008 for the course CS 151A taught by Professor Miloseragovich during the Fall '07 term at UCLA.

Ask a homework question - tutors are online