Reed CSCI 221 Fall 2020Lab 06: some digital circuitsWork to complete some of these exercises in lab today. I will demo their designs in lecture tomorrow, but I wanted to give you all a chance to create them on your own. Set upYou should already have downloaded Logisim Evolution and got it working by installing the Java Development Kit. The key thing you need is the JAR file for the program, which can be downloaded with this link: Once you’ve downloaded this file (and moved it into this
to run the program. THis program lets you devise and edit digital circuit designs,
represented as Sum of products methodToday you’ll practice building circuits that compute some elementary boolean functions, but ones that will be useful as part of our toolkit of circuits that make up a computer processor. To devise thse circuits, we’ll follow the method we covered in lecture, namely:
As an example, consider this truth table
Working from this table to devise an expression for the
Repeating this work for
(Here, we are using a If you load the circuit file For each of the exercises below, I’ll ask you to build a circuit for
a bunch of boolean functions. You should use the sum of products method
to devise each circuit. Using this method, you’ll end up with a “three
layer design” where the input variables feed to the outputs by passing
their information through wires to at most three gates. That is: if we
trace any wire path from an input to some output, we’ll pass through at
most three gates. They would appear in the order This three-layer circuit design is very standard, and it results from following the SOP method. Exercise 1: XOR and PARITYThe behavior of the We’ve provided a standalone 2-input XOR/PARITY circuit in the file
These two gate types (XOR and PARITY) can each be generalized to take
three or more inputs. When there are three inputs the behavior of the
XOR gate and the PARITY gate differ from each other, and so their logic
circuits must be different. Both circuits will output a Exercises 1a. Build a 3-input XOR circuit within the file
1b. Build a 3-input PARITY circuit within the file
These circuits should be built using only AND, OR, and NOT gates, and the circuits should be explainable as a sum of products. If you choose to also devise a circuit for either some other way, you can include it as an extra circuit that you submit, in addition to the two you submit in SOP form. Exercise 2. multiplexersWhen building larger digital circuits, we often have several different lines of output from a number of components feeding their input into some other part of the circuit, and where we want to select which component to “pay attention to” based on some computed condition. For example, we may be updating a value as a result of either an addition computation or a multiplication computation. So, in that case, we have a subcircuit that computes the addition, and maybe a different subcircuit that computes the multiplication, and so we can build a circuit that chooses which of those two results we want to use to perform an update. The standard circuit component that performs this kind of “signal selection” is called a multiplexer or MUX circuit. MUXs are characterized by the number of inputs that you can choose from (usually a power of two, say 2^k) and the width of the signal in number of bits of information. Here’ we’ll just focus on single-line inputs, ones of width 1. Such MUXs are called 2^k:1 MUXs and they have 2^k + k inputs, and 1 bit of output. At the end of lecture yesteday we built a 2:1 MUX. It has three inputs and one output.
So it has the truth table:
It has a behavior that mimics this Python function’s definition:
We worked a little in class and determined the logic for this behavior, namely that
If you load the file Exercise 2. A 4:1 MUX is similar. It has six inputs:
Hint: you can build this by mimicking the logic we invented
for the 2:1 MUX. Doing this, you should have a sum of four products, one
product for each input line. Alternatively, you can build this by using
three 2:1 MUXs, with no other logic. Its possible to cut-and-paste
circuits from one Exercise 3: Addition circuitsIt turns out that the truth table we gave above that computes the
bit vector
Since this is base 10 notation, we have the digit
In the rightmost sum, we write 2 as “binary ‘ten’”, but the result is
just binary code for the 1st power of two, namely, 2. (And binary
We could do longer additions in binary. Consider the “schoolbook” binary addition:
Above we computed sums over each column, moving from right to left.
We wrote, in the ones bit column, that To make this process more clear, here is the same sum with the carry bits displayed on an extra row at the top:
Or, even more carefully, we have this binary addition
So, in actuality, we are figuring out column sums that follow these patterns:
This could be more generally expressed as a function on three input
bits The general addition looks like
A single column of three input bits leads to two columns of output bits. Exercises 3a. Build a circuit that behaves like this single
column addition. It should take those three bits of “ones bit” input and
produce the “ones and twos bits” as output. This, by the way, is called
a 1-bit full adder circuit. The circuit we built before,
incidentally, is called a 1-bit half adder because it lacks the
ability to process a carry in bit. (It’s not fully functional,
I suppose.) Use the file 3b, as a BONUS. Build a 4-bit full adder circuit
using whatever method you like. (Part of this bonus has you figuring out
what I mean by that!) Build it as the file |