CPSC 3300 - Fall 2014 Homework 2 Due Wednesday, Feb. 26 Each student must turn in a separate set of homework solutions, but you may work together in study groups with other students from the class. Include the names of your study group members on the solution set you submit. Also, please provide sufficient space for your calculations and answers so that grading will be easier. Appendix B 1. B.6 - Show NAND is universal by implementing (a) two-input AND, (b) two-input OR, and (c) one-input NOT functions with one or more two-input NAND gates. 2. B.7 - Construct the truth table for a four-input odd parity function. That is, F = fn(A,B,C,D), where F is 1 when there are an odd number of 1s when the 1s in A,B,C,D are counted; thus, fn(0,1,1,0)=0, and fn(0,1,1,1)=1. 3. B.8 - Give a simplified logic expression for the odd parity function and implement the expression in a circuit with AND and OR gates. Show any inverted signal by using a bubble on the gate input. 4. Design a modulo-3 counter using two D flip-flops with the states cycling as 00,01,10,00,01,.... (There is no input.) Use a truth table with four columns, and use don't care values where appropriate. QA(t) QB(t) | QA(t+1) QB(t+1) ------------+---------------- Simplify the logic expressions for the next state values, and draw the resulting circuit. 5. Design a two-bit Gray-code up counter using two D flip-flops and a single "up" input. The state cycles as 00,01,11,10,00,01,11,... when up=1. The state remains the same when up=0. Use a truth table with five columns: up QA(t) QB(t) | QA(t+1) QB(t+1) ---------------+---------------- Simplify the logic expressions for the next state values, and draw the resulting circuit. 6. Add a "reset" control signal to your two-bit Gray-code up counter. Use the technique described in the notes to add gates to your previous circuit such that reset=1 will cause the next state to be 00. 7. Construct the truth table and state diagram for the "Synchronous 3-bit Up/Down Counter" we discussed in class. See http://www.electronics-tutorials.ws/counter/count_4.html. The table should have 13 columns (where UP=1 means counts up and UP=0 means counts down): QA(t) QB(t) QC(t) UP | JA KA JB KB JC KC | QA(t+1) QB(t+1) QC(t+1) ---------------------+-------------------+------------------------