CS 10, Spring 1998

Lab 6.1 Digital Circuits


Assignment for the Next Lab


Lab 6.1 Instructions

Copy DigSim from the "module6" folder from the Classes file server onto the user folder. If you have questions about using DigSim, read the documentation below.

  1. Build, test, and save a three-way AND circuit which accepts three inputs and produces an output of 1 only when all three inputs are 1; otherwise it produces an output of 0. Hint: translate the logical expression (P and Q) AND R into a digital circuit

  2. Build, test, and save a four-way OR circuit, which accepts four inputs and produces an output of 1 if at least one of the inputs is 1, and 0 if all of the inputs are 0.

  3. Build a circuit which has two inputs and one output, where the output is 1 only when the two inputs are equal. So if the two inputs are both 1, or both 0, then the output should be 1, and if the two inputs are different (if one input is 1, and the other 0) then the output should be 0. This circuit is called a 1 bit comparator (since it compares the state of the two input wires). Hint: start by figuring out a logical expression which behaves as specified (you may need to construct some truth tables to figure this out). Then translate this expression to a digital circuit.

  4. Build, test, and save a 1-bit adder.

DigSim 2.5: A Digital Logic Simulator for the Macintosh

DigSim is a program for designing and experimenting with digital circuits. It is useful for both learning digital logic and for testing advanced circuit ideas. When DigSim starts up, a palette of circuit elements and an untitled circuit window will appear. You can drag any of the elements over to the circuit window to add them to the circuit. To remove an element from the circuit window, drag it back to the palette. You can move around elements which are already in your circuit window by dragging them.

The palette of circuit elements also contains a soldering iron for connecting components and a pair of wire cutters for cutting connections. The Tools menu allows you to choose between them. When the soldering iron is selected, clicking on a lead out of an element and dragging to another lead will connect them with a wire as long as this does not connect two output leads together. When the wire cutters are selected, clicking on a wire where it comes out of the element (clicking in the middle of the wire will not work) will cut it out of the circuit. Clicking on a blank piece of screen and dragging will create a selection box. All the circuits in this box can be dragged together around the screen, and this group of circuits can be copied, cut and pasted.

Input switches and output lights are used to control the circuit after it is built. Clicking on an input switch will toggle its state from 0 to 1 or 1 to 0, and this value will be fed to the gates connected to it. Output lights will light up if they are connected to a 1 and stay dark if connected to a 0.

After you have built a circuit and saved it, its name will appear under the Sub-Circuits menu. You can now use that circuit as a sub-circuit inside any other circuit so that you can have much more complicated building blocks than are in the palette. To use a subcircuit which you have saved, simply select the sub-circuit you want from the Sub-Circuits menu, and a box labeled with the sub-circuit name will appear in the middle of the window. This box will have one input lead for every input switch the original circuit had and an output lead for every output light. It can now be used just like any circuit element. Double clicking on the box will open a circuit window showing the innards of the sub-circuit.