CS61c

Lab 9 -- Introduction to Logisim

 

Preparation

Launch the Logisim application to begin. To do this, type

% java -jar ~cs61c/bin/logisim-2.1.6.jar

You can learn about Logisim beyond the scope of this lab (or download it to use at home) from the Logisim website.

The java installation on nova sometimes acts a little funny. If you're getting weird GUI issues, try ssh-ing into cory and running "java -jar ~cs61c/bin/logisim-2.1.6.jar" or simply "logisim".


Part 0: The Basics (Warm-Up)

We'll begin by creating a very simple circuit just to get the feel for placing gates and wires.

1. Start by clicking the "AND gate" button. This will cause the shadow of an AND gate to follow your cursor around. Click once within the main schematic window to place an AND gate.

2. Click the "Input Pin" button. Now, place two input pins somewhere to the left of your AND gate.

3. Click the "Output Pin" button. Then place an output pin somewhere to the right of your AND gate. Your schematic should look something like this at this point:

4. Click the "Wire tool" button. Click and drag to connect the input pins to the left side of the AND gate. This will take several steps, as you can only draw vertical and horizontal wires. Just draw a wire horizontally, release the mouse button, then click and drag down starting from the end of the wire to continue vertically. You can attach the wire to any pin on the AND gate on the left side. Repeat the same procedure to connect the output (right side) of the And Gate to the LED. After completing these steps your schematic should look roughly like this:

5. Finally, click the "Poke" tool and try clicking on the input pins in your schematic. Observe what happens. Does this match with what you think an AND Gate should do?



Part 1: Sub-Circuits

Since C programs can contain helper functions, a schematic can contain subcircuits. In this part of the lab, we will create several subcircuits to demonstrate their use.

  1. Create a new schematic (File->New) for your work.

  2. Create a new subcircuit (Project->Add Circuit ). You will be prompted for a name for the subcircuit; call it NAND.

  3. In the new schematic window that you see create a simple NAND circuit with 2 input pins on the left side and an output pin on the right side.

  4. Go back to your "main" schematic by double-clicking "main" in the circuit selector at the left of the screen. Your original (blank) schematic will now be displayed, but your NAND circuit has been stored.

  5. Now, single click the word "NAND" in the list. This will tell Logisim that you wish to add your "NAND" circuit into your "main" circuit.

  6. Try placing your NAND circuit into the "main" schematic. If you did it correctly, you should see a gate with 2 input pins on the left and one output pin on the right. Try hooking input pins and output pins up to these and see if it works as you expect.

  7. Repeat these steps to create several more subcircuits: NOR, XOR, 2 to 1 MUX, and 4 to 1 MUX. Do not use any built in gates other than AND, OR, and NOT. However, once you've built a subcircuit, you may use it to build others.

    Hint: Look at the lecture slides for a refresher on how to build these. You may want to consider using some of your custom subcircuits when designing the others.

Checkoff

Show your five circuits (NAND, XOR, 2 to 1 MUX, and 4 to 1 MUX) to your TA.  


Part 2: From Truth Table to Schematic

Between lecture, your reading, and this lab, you now have all the tools needed to take a truth table and implement it in a Logisim schematic. Given the following truth table, complete the tasks below.

1
in1 in0 | out1 out0
0
0
|
0
1
0
1
|
1
0
0
|
1
1
1
1
|
0
0

1. From the truth table above derive the Canonical SOP boolean equations for out1 and out0.

2. Using the rules of boolean algebra (see the lecture slides or go to Google refresh what they are) simplify your boolean equations. Once you arrive at the simplest boolean equation you may want to check to see if your equations fit the pattern of any of our well-known gates.

3. Implement your simplified boolean equations in your "main" schematic in Logisim. Feel free to use any of the subcircuits you designed earlier if they would help. Be sure you label your input and output pins appropriately using the "Text" tool. To use the text tool, select the tool and click on your schematic and start typing. If you make a mistake, you can edit the text by selecting your text object using the "selection" tool, and edit the "Text" property in the property list below the circuit browser (window where you can select your tools and circuit)

Checkoff

Show your canonical SOP of the truth table.  
Show your boolean algebra simplifications to your TA.  
Show your working schematics to your TA.