Exam1 - University of Waterloo

University of Waterloo
Department of Electrical and Computer Engineering
ECE 223 Introduction to Digital Systems
Winter 2010
Solutions to Midterm Examination
Instructor: Otman A. Basir
1) [20 points]
a) List the minterms and maxterms for the expression
𝐹 𝐴, 𝐡, 𝐢 = 𝐴′ 𝐡 + 𝐴 + 𝐡′ 𝐢 + 𝐴 + 𝐢 β€² 𝐡
𝐴 + 𝐢 β€² = 𝐴′ 𝐢 β€²
𝐹 𝐴, 𝐡, 𝐢 = 𝐴′ 𝐡 + 𝐴𝐢 + 𝐡′ 𝐢 + 𝐴′𝐡𝐢′
𝐴, 𝐡, 𝐢 = 𝐴′ 𝐡𝐢 + 𝐴𝐡𝐢 + 𝐴𝐡′ 𝐢 + 𝐴′ 𝐡′ 𝐢 + 𝐴′𝐡𝐢′
𝐹 𝐴, 𝐡, 𝐢 =
(1,2,3,5, ,7)
𝐹 𝐴, 𝐡, 𝐢 =
(0,4,6)
b) Express the complement of the expression
𝐹 𝐴, 𝐡, 𝐢 = 𝐴′ 𝐡 + 𝐴 + 𝐡′ 𝐢 + 𝐴 + 𝐢 β€² 𝐡
in the simplest form you can using Boolean algebra. Show your work.
𝐹 𝐴, 𝐡, 𝐢 = 𝐴′ 𝐡 + 𝐴 + 𝐡′ 𝐢 + 𝐴 + 𝐢 β€² 𝐡
𝐹 𝐴, 𝐡, 𝐢 = 𝐴′ 𝐡 + 𝐴𝐢 + 𝐡′𝐢 + 𝐴′𝐢 β€² 𝐡
𝐹 𝐴, 𝐡, 𝐢 = 𝐴′ 𝐡 (1 + 𝐢 β€² ) + 𝐴𝐢 + 𝐡′𝐢
𝐹 𝐴, 𝐡, 𝐢 = 𝐴′ 𝐡 + 𝐴𝐢 + 𝐡′𝐢
But based on the consensus theorem we have 𝐴′ 𝐡 + 𝐴𝐢 = 𝐴′ 𝐡 + 𝐴𝐢 + 𝐡𝐢
We conclude that
𝐹 𝐴, 𝐡, 𝐢 = 𝐴′ 𝐡 + 𝐴𝐢 + 𝐡𝐢 + 𝐡′𝐢
𝐹 𝐴, 𝐡, 𝐢 = 𝐴′ 𝐡 + 𝐢
𝐹 β€² (𝐴, 𝐡, 𝐢) = 𝐴′ 𝐡 β€² . 𝐢′
c) Use a Karnaugh map to find a simplest sum-of-products expression for
𝐹(𝐴, 𝐡, 𝐢, 𝐷) = π›΄π‘š(1,3,4,5,9,10,12),
𝑑(𝐴, 𝐡, 𝐢, 𝐷) = π›΄π‘š(8,11,14,15).
AB\CD
00
01
11
10
00
0
1
1
x
01
1
1
0
1
11
1
0
x
x
10
0
0
x
1
𝐹 𝐴, 𝐡, 𝐢, 𝐷 = 𝐴𝐡′ + 𝐢 β€² 𝐷′ 𝐡 + 𝐴′ 𝐢 β€² 𝐷 + 𝐷𝐡′
𝑑) Use the QM tabulation method to simplify the function in 1.c
Truth Table
M0
M1
M2
M3
M4
M5
M6
M7
M8
M9
M10
M11
M12
M13
M14
M15
A
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
B
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
C
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
D
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
Minterms Table
Number of ones
1
Minterm
M1
M4
M8
Binary
0001
0100
1000
2
M3
M5
M9
M10
M12
0011
0101
1001
1010
1100
3
M11
M14
1011
1110
4
M15
1111
Size [ 2 ] Implicants
M(1, 3)
00-1
F
0
1
0
1
1
1
0
0
x
1
1
x
1
0
x
x
M(1, 5)
M(1, 9)
M(4, 5)
M(4, 12)
M(8, 9)
M(8, 10)
M(8, 12)
M(3, 11)
M(9, 11)
M(10, 11)
M(10, 14)
M(12, 14)
M(11, 15)
M(14, 15)
0-01
-001
010-100
10010-0
1-00
-011
10-1
1011-10
11-0
1-11
111Size [ 4 ] Implicants
-0-1
M(1, 3, 9, 11)
M(8, 9, 10, 11)
M(8, 10, 12, 14)
M(10, 11, 14, 15)
10-1β€”0
1-1Essential Prime Implicants
M(1, 5)
M(4, 5)
M(4, 12)
M(1, 3, 9, 11)
M(8, 9, 10, 11)
M(8, 10, 12, 14)
M(10, 11, 14, 15)
0-01
010-100
-0-1
10-1β€”0
1-1Prime Implicants Chart
M(1, 5)
M(4, 5)
1
x
3
4
X
5
x
x
9
10
12
0-01
010-
M(4, 12)
M(1, 3, 9, 11)
M(8, 9, 10, 11)
M(8, 10, 12, 14)
M(10, 11, 14, 15)
x
x
x
x
x
X
x
x
x
x
x
x
x
x
-100
-0-1
10-1--0
1-1-
𝐹 𝐴, 𝐡, 𝐢, 𝐷 = 𝐴𝐡′ + 𝐢 β€² 𝐷′ 𝐡 + 𝐴′ 𝐢 β€² 𝐷 + 𝐷𝐡′ (FROM KM)
(1,5)A’C’D+(4,12)BC’D’+(1,3,9,11)B’D+(8,9,10,11)AB’ (FROM QM)
2) [30 points] For the circuit given by F(A,B,C,D)=βˆ‘m(0,5,6,7,11)
a. Derive an algebraic expression for F(A,B,C,D),
F(A,B,C,D)= A’B’C’D’+A’BC’D+A’BCD’+A’BCD+AB’CD
b. Implemented this circuit using logic gates (&,+,!) and 2-to-4 non-inverted
output decoders .
c. Implement this circuit using logic gates (&,+,!) and 4 to 1 multiplexers
C'D'
CD+C'D+C'D=D
00
01
CD
10
0
11
AB
3) 30 points]
A=A3 A2 A1 A0; A=B3 B2 B1 B0
Operations:
B0A0=11: A and B are odd numbers οƒ F1=A-B: add A to 2’s complement of B
B0A0=00: A and B are even numbers οƒ F2=B-A: add B to 2’s Complement of A
B0A0=10: A is an even number and B is an odd number οƒ F3=A+B: add A to B
B0A0=01: A is an odd number and B is an even number οƒ F4=A-B-1: add A to 1’s
complement of B
Remember from our parallel 4-bit adder, we get 2’s complement by 1’s complement plus
1 (which we achieved by sitting Cin to 1).
MA= 1’s complement of A
1
0
0
0
B0A0
00
01
10
11
2-to-4 Decoder
00
MB= 1’s Complement of B
0
1
0
1
Cin
1
0
0
1
A
A 1’s complement
Full
Adder
01
Z
10
11
B 1’s complement
Cout
B
B0A0
Cin