CS 111
Fall 2018

Lab 5: Digital circuits

Task 0: Become familiar with Logicly

In Problem Set 5, you will be using a circuit-design tool called Logicly.

If you haven’t already installed it, you should follow the instructions found here:

Let’s review how to use it together.

Task 1: Practice minterm expansion

Consider the truth table below, which represents an unknown boolean function:

x y z boolean function’s value
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1

On paper, create the minterm expansion formula for this truth table. Here is a reminder of the steps:

  1. Delete all rows from the truth table where the value of the function is 0.

  2. For each remaining row, create a minterm as follows:

    • For each variable that has a 1 in that row, write the name of the variable. If the input variable is 0 in that row, write the variable with a negation symbol to NOT it.

    • AND all of these variables together (using multiplication).

  3. Combine all of the minterms for the rows using OR (i.e., addition).

Task 2: Practice building a circuit

Once you have completed the formula for Task 1, use Logicly to build the corresponding circuit.

To begin, download the following file:

lab5task2.logicly

and open it in Logicly.

Note that we’ve provided you with:

You may need to use the Pan Tool (the hand icon available at the top of the screen) and the magnification slider available in the lower right-hand corner to adjust how much of your circuit is visible. After using the Pan Tool, don’t forget to switch back to the Selection Tool (the arrow icon).

When constructing the circuit, remember that:

Once you have completed the circuit, test it by clicking the input switches to turn them on and off. Check to see if you obtain the correct output for all possible inputs.

After testing, make sure to save the final version of your circuit.

Task 3: More practice with circuits

  1. Build a circuit that represents a NAND gate, which has the following truth table:

    x y x NAND y
    0 0 1
    0 1 1
    1 0 1
    1 1 0

    Use the following file for your work:

    lab5task3-1.logicly

    Once you are done, make sure to save the final version of your circuit.

  2. To practice exporting and importing a circuit in Logicly, let’s export your NAND circuit and use it in another circuit.

    Exporting your NAND circuit:

    1. In your lab5task3-1.logicly file, use the Edit->Select All menu option to select the entire circuit.

    2. Click the building block icon (which looks like a Lego piece) at the top of the screen. (Alternatively, you can select the Edit->Create Integrated Circuit menu option.)

    3. In the window that pops up, give your circuit a name (e.g., My NAND) by entering it in the Full Name text box. You can also add a Symbol Label, but doing so is not required.

    4. Click the Create IC button to create the integrated circuit.

    5. Use the File->Export Integrated Circuit Library menu option to export your work. Give the file an appropriate name (e.g., my_nand) and save it in a place where you can easily find it.

    Using your NAND circuit in another circuit:

    1. Download the following file:

      lab5task3-2.logicly

      and open it in Logicly.

    2. Use the File->Import Integrated Circuit Library menu option to import the file in which you stored your exported NAND circuit in step e.

    3. After importing the file, scroll down to the bottom of the left-hand pane of components. You should see a section labeled Custom that contains a lego-like building block for your NAND circuit. (Do not use the built-in NAND gate under Logic Gates. Use your building block under Custom.)

    4. You can insert a copy of your NAND building block into your circuit by using the Selection Tool to drag the NAND building block into the circuit. You should see a box that looks like this:

      nand box

    5. Add wires to connect :

      • the input switch for x to the pin x in your NAND building block

      • the input switch for y to the pin y in your NAND building block

      • the output of your NAND building block to the output light bulb of the circuit.

    6. Test different combinations of values for the inputs, and you should see that your NAND building block behaves exactly the way that your NAND circuit did!

    7. Once you are done, make sure to save the final version of your circuit.

  3. Build a partial arithmetic logic unit that accepts three inputs: x, y, and op, where a value of 0 for op means that the circuit should compute and output x + y (with carry) and a value of 1 for op means that the circuit should compute and output x * y.

    Begin by filling in the following truth table:

    op x y r1 r0
    0 0 0
    0 0 1
    0 1 0
    0 1 1
    1 0 0
    1 0 1
    1 1 0
    1 1 1

    where r1 and r0 are the two bits of the result:

        x
        y
    -----
    r1 r0
    

    In the case of addition, r1 is the carry bit. In the case of multiplication, r1 will always be 0.

    Next, use minterm expansion twice – once for each result bit – and create a separate subcircuit for each of those bits.

    Use the following file for your work:

    lab5task3-3.logicly

    Once you are done, make sure to save the final version of your circuit.

Task 4: Submit your work

You should use Apollo to submit the following files:

Don’t worry if you didn’t finish all of the tasks. You should just submit whatever work you were able to complete during lab.

Here are the steps:

  1. Login to Apollo, using the link in the left-hand navigation bar. You will need to use your Kerberos user name and password.
  2. Check to see that your BU username is at the top of the Apollo page. If it isn’t, click the Log out button and login again.
  3. Find the appropriate lab section on the main page and click “Upload files.”
  4. For each file that you want to submit, find the matching upload section for the file. Make sure that you use the right section for each file. You may upload any number of files at a time.
  5. Click the “Upload” button at the bottom of the page.
  6. Review the upload results. If Apollo reports any issues, return to the upload page by clicking the link at the top of the results page, and try the upload again, per Apollo’s advice.
  7. Once all of your files have been successfully uploaded, return to the upload page by clicking the link at the top of the results page. The upload page will show you when you uploaded each file, and it will give you a way to view or download the uploaded file. Click on the link for each file so that you can ensure that you submitted the correct file.