CPSC 330 - Fall 2012 Homework 2 Due Monday, Oct. 8 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 C (see http://www.cs.colostate.edu/~malaiya/470/Appendix-C.pdf) 1. C.4 - Implement a two-input XOR function using AND, OR, and NOT gates. 2. C.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. 3. C.14 - Implement the switching element as described. 4. Finish the analysis started in class of the three-bit synchronous up/down counter shown in http://www.electronics-tutorials.ws/counter/count_4.html. (a) Give the three logic expressions: JA = KA = ____ JB = KB = ____ JC = KC = ____ ____ (b) Complete the truth table with these 13 columns, where I=up/down: I QC(t) QB(t) QA(t) | JC KC JB KB JA KA | QC(t+1) QB(t+1) QA(t+1) --------------------+-------------------+------------------------ (c) Draw the state diagram from the truth table. Is it as expected? 5. Design a modulo-3 counter using two D flip-flops. (There is no input.) Use a truth table with 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. 6. Design a modulo-3 counter using two JK flip-flops. (There is no input.) Use a truth table with don't care values where appropriate. QA(t) QB(t) | JA KA JB KB | QA(t+1) QB(t+1) ------------+-------------+---------------- Simplify the logic expressions for the JK values, and draw the resulting circuit. 7. C.40 - Design a 3-bit Gray code up counter using three D flip-flops. (a) Design the circuit where "inc" is the single input and do not include "reset". The truth table can have the form: inc QA(t) QB(t) QC(t) | QA(t+1) QB(t+1) QC(t+1) ----------------------+------------------------ Use 4x4 Kmaps to simplify the logic expressions for the next state values. The use of a PLA is optional; you can instead draw individual gates in the circuit. (b) Add the "reset" function using the technique described in the notes.