CPSC220: Introduction to Computer Architecture (Fall 2014)

Assignment #5

Due by the start of class on Friday, 10/24/2014

This assignment provides some experience in designing and simulating logic circuits, using the open-source logic simulator, Logisim.

To do

Download a copy of Logisim from its distribution site at http://www.cburch.com/logisim/index.html. Get to know the icons on the application's toolbar. If you hover the cursor over an icon, a brief description will pop up.

Open the HELP menu, and read through the steps in the "Beginner's Tutorial". This will walk you through the creation of an XOR gate. Followup the steps therein.

  1. Create a folder for this assignment, lab5, and save your XOR circuit as lab5-xor.circ.
  2. Now move on to creating subcircuits. Study the "Subcircuits section of the Tutorial, and construct the 4-to-1 multiplexor described there. Once you're done with this, build a 2-to-1 multiplexor as well. Save both of these subcircuits in the file lab5-muxes.circ
  3. In Wednesday's class, we showed how to make a 1-bit full adder circuit, using only 1-bit half-adders and an OR gate. Since we know how to make half adders using XOR and AND, and an XOR gate using only AND, OR, and NOT, it is possible to make a full adder using only these latter three gates. Build two versions of this subcircuit, 1-bit adder, one using half-adder subcircuits (which you may half to construct yourselves), and the other using only AND, OR, and NOT (no subcircuit definition of halfadders).
  4. Using either of your 1-bit add implementations, construct a 4-bit add subcircuit.
  5. Build a "4-bit sub" subcircuit, which implements 4-bit subtraction.
  6. Build a 4-bit adder/subtractor subcircuit, which takes two 4-bit inputs, a and b, and a single "control" input. If the control is 1, the output should be the 4-bit value representing a-b. If it is 0, the output should be the 4-bit sum, a+b. This circuit and the other arithmetic subcircuits should be saved in the file lab5-addsub.circ.

Turn in:

Your three circuit files: lab5-xor.circ, lab5-muxes.circ, and lab5-addsub.circ.

Copy these files to lab5 subfolder of your handin folder.