Lab 5: Digital circuits
Task 0: Become familiar with Logicly
In Problem Set 5, you will be using a circuitdesign 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:

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

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).


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:
and open it in Logicly.
Note that we’ve provided you with:

switches for the inputs
x
,y
, andz

a
NOT
gate for the negation of each input; for example, the leftmost switch is forx
itself, and theNOT
gate immediately to its right is forNOT x

a light bulb for the output.
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 righthand 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:
 each minterm in the minterm expansion should get its own AND gate
 the outputs of the AND gates should be fed into an OR gate.
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

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:
Once you are done, make sure to save the final version of your circuit.

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:

In your
lab5task31.logicly
file, use the Edit>Select All menu option to select the entire circuit. 
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.)

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. 
Click the Create IC button to create the integrated circuit.

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:

Download the following file:
and open it in Logicly.

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

After importing the file, scroll down to the bottom of the lefthand pane of components. You should see a section labeled
Custom
that contains a legolike building block for your NAND circuit. (Do not use the builtin NAND gate underLogic Gates
. Use your building block underCustom
.) 
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:

Add wires to connect :

the input switch for
x
to the pinx
in your NAND building block 
the input switch for
y
to the piny
in your NAND building block 
the output of your NAND building block to the output light bulb of the circuit.


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!

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


Build a partial arithmetic logic unit that accepts three inputs:
x
,y
, andop
, where a value of 0 forop
means that the circuit should compute and outputx + y
(with carry) and a value of 1 forop
means that the circuit should compute and outputx * 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
andr0
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:
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:
 your
lab5task2.logicly
file containing your solution to Task 2  your
lab5task31.logicly
file containing your solution to the first problem of Task 3  your
lab5task32.logicly
file containing your solution to the second problem of Task 3  your
lab5task33.logicly
file containing your solution to the third problem of Task 3
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:
 Login to Apollo, using the link in the lefthand navigation bar. You will need to use your Kerberos user name and password.
 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.
 Find the appropriate lab section on the main page and click “Upload files.”
 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.
 Click the “Upload” button at the bottom of the page.
 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.
 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.