Lab 7
Lab 7
ICs: Two 7483 (4-bit binary adder), 7408 (2-input AND), 7432(2-input OR), 7486 (XOR),
7404 (Inverter)
1. BCD Adder: You are to design a circuit that adds two BCD digits. The inputs to the circuit
are BCD numbers A and B, plus a carry-in, cin. The output should be a two-digit BCD sum.
Build your BCD adder using two 4-bit binary adders and possibly some other logic gates.
In the BCD representation system each digit is encoded into its binary equivalent with four (4)
bits.
For the arithmetic addition of two decimal digits in BCD, the maximum value that may be
produced as the result is 9 + 9 + 1 = 19 (two largest operands plus the carry). If we try to add two
decimal digits in BCD with a 4-bit adder we will get a binary sum ranging from 0 to 19. When
the binary sum is less than or equal to 9, it also correctly represents the sum in BCD. When the
binary sum is greater than 9, however, it does not represent the correct BCD sum. The sum in
BCD is to be obtained by adding 6 to it. Perform the steps given below:
1) 7 + 4
2) 3 + 2
3) 9 + 9
The above examples should help you realize when the conversion is necessary and what should
be done to perform the conversion correctly.
Decimal
Binary Sum BCD Sum
Inputs Number
Cin X Y Cout Z Cout S
0 0000 0000 0 0000 0 0000 0
0 0000 0001 0 0001 0 0001 1
0 0001 0001
0 0101 0100
0 0101 0101
0 0101 0110
0 1000 1000 1 0000 1 0110 16
0 1000 1001
0 1001 1001
1 1001 1001
c. A block diagram of using 2 4-bit binary adders to construct a BCD adder is given below.
Construct your BCD adder based on this diagram. Verify your design using the numbers in
a).
d. In your report, describe in detail how the BCD adder works. Your answer should include the
BCD addition algorithm and how this circuit implements that algorithm. Include at least two
example additions.
2. Magnitude comparator: the comparison of two numbers is an operation that determines
whether one number is greater than, equal to, or less than the other number. Two numbers, A
and B, can be compared by first subtracting A-B. If the output in S is equal to 0, then A = B.
The output carry from C4 determines the relative magnitudes of the numbers: When C4 = 1,
A ≥ B; when C4=0, A < B; and when C4 = 1 and S≠0, A > B.
It is necessary to supplement the subtractor circuit (shown below) to provide the
comparison logic.
This is done with a combinational circuit that has five inputs: S1 through S4 and C4, and
three outputs, designed by x, y, and z, so that
x = 1 if A = B (S = 0000)
y = 1 if A < B (C4 = 0)
z = 1 if A > B (C4 = 1 and S ≠ 0000)
B3 B2 B1 B0
ABCD WXYZ (ABCD) A3 A2 A1 A0 M=0 add
M=1 sub
0000 1001
0001 1000
0010 0111
0011 0110
0100 0101
0101 0100
0110 0011
0111 0010 S
Quadruple 2-1 MUX
1000 0001
1001 0000
1010 xxxx
1011 xxxx
1100 xxxx
1101 xxxx
1110 xxxx
1111 xxxx