CS61c -- Spring 2005

Lab 9 -- Introduction to Logisim

 

Preparation

Launch the Logisim application to begin. To do this, type java -jar ~cs61c/bin/logisim.jar You can learn about Logisim beyond the scope of this lab from either the help system or the Logism website.

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 "Switch" button. Now place two switches somewhere to the left of your And Gate.

3. Click the "LED" button. Then place an LED somewhere to the right of your And Gate. Your schematic should look something like this at this point:

4. Click the "Add a Wire" button. Click and drag to connect the dots at the right side of the switches 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 to the And Gate anywhere on the left side.

Repeat the same procedure to connect the right side of the And Gate to the LED. After completing these steps your schematic should look roughly like this:

5. Finally, click the "Toggle" button and try clicking on the switches in your schematic. Observe what happens. Does this match with what you think an And Gate should do?

Sub-Circuits

Much like C programs can contain sub-procedures, 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. Enable the advanced tools of Logisim (Options->Advanced Tools).

3. Create a new subcircuit (Project->New Subcircuit). You will be prompted for a name for the subcircuit; call it NAND.

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

5. Go back to your "main" schematic (Project->main). Your original (blank) schematic will now be displayed, but your NAND gate has been stored.

6. Click the button labeled "8-bit register." After clicking, it should look like this:

Select your NAND gate.

7. Try placing your NAND gate 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 switches and LEDS up to these and see if it works as you expect.

8. Repeat these steps to create several more subcircuits. Create the following: NOR, XOR, 2 to 1 MUX, and 4 to 1 MUX.

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 1 (2 pts): Be ready to show your 5 subcircuits to your lab TA for checkoff.

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.

in1 in0 | out1 out0
0
0
|
0
1
0
1
|
1
0
1
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 google for a refresher) 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 switches and LEDs appropriately using the "Text" button .

CHECKOFF 2 (2 pts): Be ready to show your Canonical SOP, boolean algebra simplification, and working schematic to your lab TA for checkoff.