CS31 Weekly Lab Week 3

logisim
Log in and create a cs31/weeklylab/week03 subdirectory and copy over some files from my public/cs31/week03/ directory into your subdirectory:
    cd
    cd cs31
    cd weeklylab
    mkdir week03
    cd week03
    pwd
    cp ~newhall/public/cs31/week03/* .
    ls
    firstcircuit.circ subcircuits.circ

Goals for this week:

  1. Learn how to use logisim, and start the tutorial
  2. Introduction to lab 3
Logisim
I suggest working in the CS labs on logisim rather than logging in remotely. Logisim will run very slowly if you are remotely logged in due to X forwarding events (use ssh -Y on Mac or Linux to enable X-forwarding, on Windows you need to install an X server to run logisim remotely). Alternatively, you can install logisim on your own computer, and scp your .circ file to/from your computer to your CS account. We are using version 2.7. Make sure to install the same version. Also, if you do this, you need to ensure that your circuit file works on logisim running on our system.

The Logisim simulator

This week we will start using the Logisim simulator to create circuits and to see what the does given different input. We will learn more Logisim in class, but today I want to step through a few examples using it.

The Logisim web page has user documentation that will be very helpful for the next lab assignment. We are using version 2.7.

$ logisim    # start new project

$ logisim  proj_file.circ  # edit an existing project
  1. Together, we will start with firstcircuit.circ, and build a simple AND circuit and some tester circuitry around it:
    $ logisim  firstcircuit.circ  
    
    After we have done this, you can double click on the "firstcircuit" circuit and see my solution to each step.

  2. Next, we will we create a new circuit interface to our simple 2-bit AND circuit. We will then add our new circuit into a main circuit containing some tester circuitry. The steps are described in the Logisim documentation for creating subcircuits
    1. open the subcircuits.circ file in logisim
      $ logisim  subcircuits.circ  
      
    2. Notice that we are in the main circuit. Let's create a new circuit. Choose:
      Project->Add Circuit
      Then enter the name of the new circuuit "2 bit AND". You should see two circuits in the subcircuits folder: main and 2 bit AND. Let's implement the 2-bit AND from last time, but without the counter and clock.

      Add two inputs and the single output, and add labels to each (A, B, 2bit A and B). And you can add probes to the inputs if you'd like.

    3. Next, select the 2-bit and circuit and add a label for it (2-bit AND)
    4. Now, lets go back to the main circuit (double click on test->main). And let's add our 2-bit AND circuit here (click on 2 bit AND and drag into main's window). If you hover with your mouse over the input and outputs, you will see their labels.
    5. Next, lets add a counter and a clock and input wires and ouput wires and see what we get.

Lab 3 Intro
Click on the Lab 3 link off the class schedule for week 3. We will go over the lab 3 assignment and requirements.

You should begin lab 3 by steping through the Beginner's tutorial in Logisim. It will take you through the steps of building an XOR circut from basic circuits, and some other features of logisim. You will also want to look through the creating subcircuits parts and use this document as a reference as you work on lab 3.