Lab: Starting Logisim

CSC 211 - Computer Organization & Architecture - Weinman

Summary:
You will experiment with a free logic simulator during class.

Preparation

Logisim is a free graphical tool for designing and simulating logic diagrams.
To start Logisim on the MathLAN, run the following command in your terminal window.
java -jar /home/weinman/courses/CSC211/labs/logisim.jar &

Exercises

A. Tutorial

  1. To learn the basics of Logisim, complete the Beginner's Tutorial of the Guide to Being a Logisim User, up through step 4.
  2. Quickly read about the libraries and attributes of Logisim through its explorer pane, attribute table, and tool/component attributes.
  3. Read about creating circuits in Logisim (but don't go on to Using subcircuits yet).

B. Add it Up

Consider the problem of adding two bits x1 and x2:

x1
+ x2
co s.
Here s represents the "sum" or the rightmost bit, while co represents the carry (for reasons we'll understand in the next day's class, this is the carry out, hence the subscript).
  1. Complete the truth table for this problem, which is called a "half adder."
    x1 x2 co s
    0 0
    0 1
    1 0
    1 1
  2. Identify the sole two gates necessary to represent the co and s outputs of a half-adder circuit.
  3. Create a new circuit in Logisim by using the menu command Project > Add Circuit.... Call the new circuit half-adder.
  4. Build a half-adder circuit in Logisim. (Note that additional gates are available in the Logisim explorer pane.)

C. Subcircuits

You now have a simple half adder circuit, which you will reuse as a module in a circuit for doing multiple single bit additions.
  1. Create a new circuit (not a new project) called double-half-adder.
  2. Read about using sub-circuits.
  3. Use your half-adder as a subcircuit to create a new circuit that has four inputs and two outputs so that
    x1+y1
    =
    z1
    x2+y2
    =
    z2
    and any carries are simply ignored.
  4. Go on to read about debugging subcircuits.
This circuit of two half adders could be the basis for what is known as the Hamming distance, which counts the number of bits that differ. How to get the final result (in hardware) is left as an exercise for the reader.

For those with extra time

A half adder basically stands in isolation because it can't take the carry from a previous column as input in a multi-bit addition. The full adder therefore incorporates not only the two bits of a number to sum, but also the carry-out bit from the previous column as a carry-in input bit, called ci.
The truth table for a full adder would look like the following:
ci x1 x2 co s
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
  1. Complete the truth table for a full adder.
  2. Use a KMap to identify reduced functions for both co and s.
  3. Implement the full-adder circuit using the resulting simplified functions.
Copyright © 2015 Jerod Weinman.
ccbyncsa.png
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 4.0 International License.