If you don’t see your question here, post it on Piazza or come to office hours! See the links in the navigation bar for both of those options.
I’m receiving an error message in Gradescope that begins “The circuit has a problem that prevents testing...”, but my circuit seems to work fine when I test it manually. What could this be?
The rest of the error message indicates two possible causes of this error: (1) failing to use our starter file, and (2) modifying or replacing any of the switches or light bulbs that we provided.
If you are getting this message and you didn’t do one of those two things, here are three other things you should check:
Make sure that you do not have any extra components in your Logicly file that are not actually being used as part of the circuit. If you do, you should delete them.
Make sure that you do not have any imported components that you are not actually using in your circuit.
To check for this, open your circuit in Logicly and scroll down to the Custom section of the left-hand component bar. For each component in the Custom section, right click on it and choose “Delete Integrated Circuit.” If the component is actually being used in your circuit, Logicly will display a message indicating that the component cannot be deleted. If the component is not being used, Logicly will allow you to delete it.
If your circuit uses an imported component, make sure that the imported circuit does not have any extra unused components.
To check for this, open your circuit in Logicly and scroll down to the Custom section of the left-hand component bar. Right-click on the building block for the imported component and choose View Integrated Circuit. This will open up a separate window for the imported circuit.
If you see any extra components in the imported circuit, you will need to delete all instances of the imported circuit from your current circuit. Next, export a version of the relevant building block that does not include any extra components, and then import that version of the building block into the current circuit.
All of my wires are connected and some of them are colored red, but I don’t see a problem in my circuit. How can I fix this?
Try saving your work, closing Logicly, and reopening everything. This should eliminate the problem.
If you can’t eliminate the red wires but you are still able to get correct results when you test your circuit, you can ignore the red wires.
Do we need to include docstrings in all of our functions?
Yes, for now and evermore!
How do we start the Full Adder?
If you look at the lecture notes on arithmetic circuits,
you will find the truth table and a partial model for that
circuit. You will need to
use minterm expansion twice: once to complete the portion of the
circuit that deals with the s
bit, and once to create the portion of
the circuit that deals with the c_out
bit.
How do we start the 4-bit Ripple-Carry Adder?
In lecture, we constructed a 2-bit Ripple-Carry Adder using two Full Adders. For the 4-bit Ripple-Carry Adder, you should extend this approach with more full adders so that you can add 4-bit numbers.
How should I start the 4x1 Multiplier? Will I need to use my Full Adder?
You will not need your Full Adder for the 4x1 multipler. Instead,
notice that you are essentially just multiplying a 4-bit number by
either 1 or 0. If you were to write this out by hand, each bit in
the output would either be the same as the input bit, or 0. This
depends on the 1-bit value y
that we are multiplying by. Which logic
gate could give us this behavior?
If you work through the multiplication one bit at a time, you should only need to use one gate for each output bit (with 4 gates total).
How do I combine my 4x1 Multiplier and 4-Bit Adder to create the 4x2 Multiplier?
If you look at the lecture notes on arithmetic circuits, you will see a high-level description of how to implement the 4x2 Multiplier. To start, you can use two 4x1 Multipliers to produce two partial products. You will then need to add up the results using your 4-Bit Ripple Carry Adder. This may appear awkward since you will need to add a 4-bit number to a 5-bit number, but the lecture notes show you how to arrange the addition so that you only add two 4-bit numbers to get the final output.
I’m stuck on the diff
function. Do you have any suggestions?
First, make sure that you are using an index-based loop. In the hints,
we’ve given you a suggested template that includes the header
of the necessary loop. It will allow you to consider one index i
at
a time, and to use i
to access the elements at position i
in
both vals1
and vals2
.
Because vals1
and vals2
may have different lengths, we have used
the length of the shorter list when constructing the range of index
values that the loop will consider.
Then, after the loop has completed, you will need to take care of any “extra” elements in the longer of the two lists.
To figure out the logic for handling the “extra” elements, try considering concrete cases. For example, consider this concrete case:
>>> diff([0, 3, 6, 9], [1, 1]) result: [1, 2, 6, 9]
The length of the shorter list ([1, 1]
) is 2, so your loop
will be responsible for handling the first 2 elements of each
list. At the conclusion of the loop, result
will have a value
of [1, 2]
, since that is the result of processing [0, 3]
and [1, 1]
.
Then, your code after the loop will need to include
the extra elements in [0, 3, 6, 9]
(i.e., the sublist [6, 9]
) to
get the final result ([1, 2, 6, 9]
).
What slice could you perform to get [6, 9]
from [0, 3, 6, 9]
? How
is that slice related to the variables that you have
available to you in the function?
Once you figure out the necessary logic, make sure that you also handle cases when the second list is longer than the first.
Last updated on April 28, 2025.