CMU 15-190 Spring 2017: Topics in Intermediate Programming
Homework 1 (Due Wednesday 25-Jan, at 11:59pm)



  1. Install TMCM_Labs (The Most Complex Machine)
    We will use these labs several times in this mini-course, so you should install them. Note that you will also need Java, which you may have installed on your machine. If not, first install Java as explained here. Then, download TMCM_Labs.zip from here. Unzip that, and then run TMCM_Labs.jar in that folder (the first time you do this on a Mac, you'll have to ctrl-click it and click “Open”, thereafter you can just click it). From there, run “xLogicCircuits Lab 1” and you're in business. If you get stuck, go to OH and a TA can help you.

  2. Make a simple XOR circuit from scratch
    To demonstrate that you can use the logic circuit editor, try to make a simple XOR circuit from scratch. Take a screenshot of your circuit to submit. Call it xorCircuit.jpg (or .png or whatever).

  3. Make an XOR circuit using only NOR gates
    First, make a simple NOR gate (by adding a NOT gate to the output of an OR gate). Shrink it and name it “NOR”, so now you can use that NOR gate in other circuits. Then, remake your XOR circuit from the previous step, only now using only NOR gates (the point of this being to demonstrate that we can, in fact, do this -- and not just for XOR circuits, but any circuits at all -- just with NOR gates -- wow!). The way to do this is to follow the pathway that we covered in class. First, construct the Disjunctive Normal Form (DNF) of XOR (which is pretty much the only way you'll represent it anyhow). Next, use DeMorgan's Law to replace (X AND Y) with (NOT ((NOT X) OR (NOT Y))). Then, replace (X OR Y) with (NOT (X NOR Y)). And finally replace (NOT X) with (X NOR X). Whew! Take a screenshot and name it xorCircuitWithNors.jpg (or .png or whatever).

  4. Make a SELECT circuit
    Do Exercise 9 from here. Take a screenshot and name it selectCircuit.jpg (or .png or whatever).

  5. Make a Mini-ALU circuit
    Do Exercise 10 from here. This activity in particular is a fine precursor to the next part of the “Tetris with a Bucket of Sand” talks, where we discuss how to build a simple CPU. Take a screenshot and name it miniAluCircuit.jpg (or .png or whatever).

  6. Additional Reading and Exercises
    If you have time and interest, read the well-written text of xLogicCircuits Lab1 and Lab2, and do some of those exercises.

  7. What to Submit
    Each member of the group should submit their own PDF file, 15-190-hw1.pdf, containing this information:
    1. Your name and andrew id
    2. The names and andrew id's of your groupmates
    3. The start/stop times you worked, and the total time you worked.
    4. Your thoughts about this exercise -- useful, interesting, etc? This will help us improve the 15-190 experience as we go.
    5. The screenshots from above -- xorCircuit, xorCircuitWithNors, selectCircuit, and miniAluCircuit. Note: one way to create a PDF is to first make a Word file, then export that to PDF.
    You can submit your hw to the 15-190 autolab site here.

Have fun!