A Logic Problem (5.1)

        Dr. Abner Mallity has been working with a counter circuit.  He has a counter that requires the following:

What Mallity wants is a circuit that will do the following.

Your Job:

        Your job is to design the "stuff" inside the box.

X
Y
U
D
0
0
1
 
0
1
1
 
1
0
 
1
1
1
 
1
X
Y
U
D
0
0
1
0
0
1
1
1
1
0
0
1
1
1
1
1