-12(%ebp), %eax
movl
%eax, (%esp)
call
foo
leave
ret
8

2. (2 points) What mathematical function does the above program compute? What is the result of thefollowing function call?
9

3. (10 points) As with the bomblab you have to devise the input to this program. There are multipleinputs that solve this phase namedfoo.Identify all the inputs that would defuse this phase. The
10

00
01
10
11
0
1
1
B
B
0
C
D
A
Y
2:1
decoder
0
1
Figure 1: Logic Design Problem 1
Problem 4: Logic Design (20 points)
1. (5 points) Write the expression for the circuit in Figure 1. Subsequently simplify it using the K-map.
11

2. (5 points) Simplify the following boolean expression using Karnaugh maps.
¯
A
¯
B
¯
C
¯
D
+
¯
AB
¯
C
¯
D
+
AB
¯
C
¯
D
+
¯
A
¯
B
¯
CD
+
¯
AB
¯
CD
+
AB
¯
CD
3. (10 points) Design an FSM that detects 1 0 1 in consecutive digits and outputs a 1 in the input stream of0’s and 1’s. Implement the FSM using a combination of sequential and combinational logic. Clearlyshow your work.Draw the truth table for inputs, outputs and your states.Draw the K-map foreverything. Clearly indicate how many flip flops you are going to use. Draw the final circuit with theflip flops.
INPUT :
0 1 0 1 0 1 1 0 1 0 0
....
OUTPUT:
0 0 0 1 0 1 0 0 1 0 0
....
12

/* Extra page for work here */
13


