# CSCI 255 — Introducing Logisim

In this lab you will use Logisim, a graphical design tool for logic circuits, to create and simulate a logic design.

Because Logisim is written in Java, it will only requires the Java JRE to run. You can download a copy for your home copy from the Logisim web site.

## Getting started

First, start logisim using the Gnome menu buttons: ApplicationsCSCI @ UNCALogisim 2.7.1.

We’d like for you to start with Logisim Beginner’s tutorial. This will show you how to create place gates with a circuit, connect the gates, and test out your work.

Now, there is one change we’d like for you to make to your circuit. The OR and AND gates are really only using two inputs. We want you to click on those gates and change the number of inputs from five to two. If you need more guidance, read the tutorial on Libraries and Attributes.

When you have completed the Beginner’s tutorial, show the instructor your completed XOR circuit.

Large logic circuits are composed of modules of subcircuits just as large programs are composed of libraries and classes. Take a minute to read the brief tutorials on Creating circuits and Using circuits. Don’t worry about what a MUX is. You’ll find out later.

Start this task by building a subcircuit, called `IMPLIES`, corresponding to one of the most important operators of symbolic logic, the logical implication operator, generally written as →. In a functional style of definition, this operation can be defined as IMPLIES(α, β) ≡ OR(NOT(α), β). Digital logical designers would prefer α’+β, C/C++/Java programmers write `!`α `||` β, while logicians are fond of ¬α∨β. (Incidentally, the logicians certainly get priority in HTML: &not is ¬, &and is ∧, and &or is ∨.)

Next go to the main schematic and add two instances of the IMPLIES subcircuit and a single two-input AND gate. Connect these two IMPLIES subcircuits to create a two-input EQV (for ”equivalence“) circuit which outputs 1 if and only if both inputs are equal. You can do this by following the relation
EQV(α, β) = AND(IMPLIES(α, β), IMPLIES(β, α))

Once again, demonstrate your successful completion of this task to a lab instructor.

## Task 3: 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.

inputs output
a b c x
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 1

Start by deriving the Boolean equation as we did in class (known as canonical sum-of-products form) for this truth table.

Now implement your Boolean equations schematic in Logisim using standard gates. Be sure you label your input and output pins using either the “Label” attribute field of the pin.

Your circuit will (potentially) require the inputs and the negation of each of those inputs. The figure below represents three inputs and their negations in an easy-to-read standard layout. Use a similar layout in your circuit.

Show your canonical SOP and your working schematic to a lab instructor.

Although the circuit that you designed above may implement the truth table, it may not be the most efficient implementation. Very often it is possible to simplify the logical expression representing a truth table using Boolean algebra rules. The procedure for doing this can be automated and represented graphically, typically as a Karnaugh Map. Logisim implements such a simplification procedure and you can use that implementation to identify the most efficient circuit representing a truth table.

Perform the following steps to apply the Karnaugh map optimization.

1. Select main in the Explorer window and verify that the circuit representing the truth table is showing in Logisim’s circuit window. If not, select the project that contains the truth table circuit.
2. Select Project from the menu bar and then select Analyze Circuit from the drop-down menu.
3. In the Combinational Analysis window that appears, select the Minimized tab, set the minimized logic expression as the working expression using the Set As Expression button and select the Build Circuit button to see the new implementation of the truth table.

Also, take some time to investigate the other tabs on the Combinational Analysis window.

Show your simplified circuit to a lab instructor.