Summary: You will learn to use Logisim—a program that simulates digital logic circuits—and practice building larger combinational logic circuits from logic gates.
Collaboration: You can work individually or in groups of up to three students to complete this in-class lab. The mentors will be available to help if you get stuck at any point.
Submitting your work: You do not need to turn in any work for this lab. If you are unable to finish all of the exercises during class time, I recommend that you complete this work on your own.
We often think of logic circuits in two distinct ways. The first is as a mechanism for computing logical formulas, which we used in the previous class. The second approach is to think of logical circuits as components performing some useful operation. This is often how we think of utility components like decoders and multiplexors, or the adders and memory elements we will see in the coming weeks. These view are not mutually exclusive. You will practice both approaches while learning to use Logisim in today’s in-class lab.
Logisim is a free graphical tool for designing and simulating logic diagrams. We are using an improved version of logisim, based on Logisim Evolution from GitHub. If you would like to set up Logisim on your personal machine, I can show you how to transfer the program from MathLAN to your own machine.
To start Logisim on a MathLAN machine, run the following command in a terminal window:
$ java -jar /home/curtsinger/bin/logisim.jar &
You will need to keep the terminal window open as long as you are using Logisim.
Now that you can find your way around Logisim, we’ll practice using basic logic gates by reducing boolean formulas and implementing them as Logisim circuits. You will use Logisim’s “pin” element for both inputs and outputs. Inputs have a square outline, while outputs have a circular outline. You can switch a pin from input to output using the attributes menu, or you can use the two pin element buttons in the toolbar along the top of the window.
Reduce the following boolean expressions, then implement them as logisim circuits (source: Null & Lobur: Focus on Karnaugh Maps, exercise 2).
Can’t see any formulas? Make sure you enable all scripts on this page if you are using the NoScript browser plugin.
The reading for class today introduced two useful combinational building blocks: decoders and multiplexors. To practice using logic gates, you will build a two-bit decoder and and a four-input multiplexor in Logisim.
Recall that a decoder takes some number of bits of input, interprets these bits as a binary number, and then turns on the corresponding output pin. A two-bit decoder will have two input pins and four output pins. When the two inputs are both zero, the zeroth output pin is on. If both inputs are on (encoding the number three in binary), the third output is on. You are free to establish the order of bits however you like.
I recommend that you use separate pins and wires for each bit of input, but if you are feeling adventurous you can use Logisim’s busses. A bus is a bundles of wires, which means they can carry more than one bit of input. You can connect a bus to a multi-bit pin (see the component attributes to set the number of bits). To break individual bits out of a bus, use a splitter. These can be a little tricky to configure, but the mentors can help you.
You can think of a decoder as a series of four logical formulas, one for each output, mapping the two input pins to the output pin. You can also approach this problem from the component viewpoint. Rather than thinking of an AND gate as the logical conjunction, you can think of it as a device that determines whether one input is mirrored to the output. If an input A is turned on, input B flows freely to the output C. If A is off, then no output passes through the gate. It’s okay if one of these approaches doesn’t make sense; we’ll practice both in the future.
Once you have implemented a decoder using logic gates, build a four-input multiplexor. A four-input multiplexor has four data inputs, two selector input bits, and one output. If the selector inputs encode the binary number zero, then the zeroth input should pass through to the output. If the selector inputs are encode the number two, then the second input should pass through to the output. Hint: a decoder is a useful building block in a multiplexor. The inputs to your two-bit decoder can serve as the selector bits for the multiplexor.
If you have finished all of the exercises above, you can start to prepare for lab 2. Read through the lab and work on a solution to the logical puzzle in the lab. Save the circuit design portion of the lab for tomorrow when you can work with your assigned lab group.