EXERCISES for Week 5 1. Draw a Boolean circuit using AND, OR, and NOT gates that implements the function X(Y + Z). 2. Draw a Boolean circuit using AND, OR, and NOT gates that implements the function XY + XZ. 3. Draw a Boolean circuit using AND, OR, and NOT gates that implements the function of three variables that is 0 if precisely two of the variables have the same value, 1 otherwise. 4. Draw a Boolean circuit using AND, OR, and NOT gates that implements the function of four variables that is 0 if precisely two of the variables have the same value, 1 otherwise. 5. A NOR gate is a logic element with two inputs that produces 1 if the inputs are both 0, 0 otherwise. Logic circuits can be built using NOR gates (no other kind of gate). Show how to implement a NOR gate with two transistors. 6. Draw a logic circuit that uses NOR gates to implement an AND circuit (output 1 if both inputs are 1, 0 otherwise). 7. What is the effect of wiring the output of a D flip-flop to its input? 8. What is the result of computing the AND of all the output lines of a decoder? Answer the same question for OR. 9. What is the result of wiring the output of a decoder to the input of a multiplexer, using the same address lines (see diagram below)? Answers to Exercises for Week 5 1. 2. 3. Unless all three are 0 or all three are 1, exactly two must be the same. It's simpler to compute (NOT f), as follows: x y z f ~f 0 0 0 0 1 ~f = ~x~y~z + xyz 0 0 1 1 0 0 1 0 1 0 0 1 1 1 0 1 0 0 1 0 1 0 1 1 0 1 1 0 1 0 1 1 1 0 1 4. x y z w f x y z w f 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 1 1 0 0 1 0 0 1 0 1 0 1 0 0 1 1 1 1 0 1 1 0 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 1 1 0 1 0 0 1 1 0 1 1 1 1 0 0 0 1 1 1 0 1 1 1 1 0 f = ~x~yzw + ~xy~zw + ~xyz~w + x~y~zw + x~yz~w + xy~z~w 5. 6. 7. It gets stuck at whatever the initial value of the input was. If 0, then the first clock pulse produces "reset" which keeps the input at 0. If 1, then the first clock pulse produces "set" which keeps the input at 1. 8. Exactly one of the outputs is 1, and the rest 0, so the AND is always 0 and the OR is always 1. 9. Always produces 1. The decoder produces 1 on whatever output line is addressed; the multiplexer selects that line.