Digital Circuits Lab PDF
Digital Circuits Lab PDF
Combinational Logic
To build any digital device, all you need are these three logic gates (not really,
but we will get to that soon):
In fact, you already have the skills to build such logic gates from your
investigations into analog electronics. Can you figure out which of the circuits
below correspond to the three logic functions above? Recall, inputs for digital are
either “high” (say, +5V) or “low” (ground or 0V).
While most circuit schematics may not include it, you do need to provide power
for the ICs to function. This occurs at the Vcc pin (look up the datasheet for you IC
to see what the limitations and requirements are for your IC). You should also
ground the GND pin.
When initially building your circuit, and when swapping out ICs, you should keep
the breadboard turned off.
This chip (or Integrated Circuit or IC) has several gates on it, as do most logic
ICs. Use one of the AND gates to construct a simple AND logic circuit, i.e.,
performs the Boolean algebra operation of A.B . Vary the input (remember, vary
in digital talk means just low or high input, i.e., 0 and +5V) to obtain all possible
combinations and complete a truth table for the 2-input AND gate.
Use the other 2-input AND gates on the chip to build a 4-input AND gate, i.e.,
performs the Boolean algebra operation of A.B.C.D . Test all input combinations
and complete a truth table for this 4-input AND gate. Can you think of a way to
turn this 4-input AND gate into a 3-input AND gate?
2
Associative and Commutative Laws
Build the AND gate circuit shown below. This circuit will allow you to test the
multiplicative Associative Law, i.e., A.(B.C) = (A.B).C .
Vary the inputs to obtain all combinations and construct a truth table.
How could you prove the Commutative Law, i.e., A.B = B.A, with a couple AND
gates?
The OR Gate
Use this IC to construct and test a simple 2-input OR gate, i.e., performs the
Boolean algebra operation A+B. Vary the inputs over all combinations and
construct a truth table.
3
Distributive Law
To prove the Distributive Law, i.e., A.(B+C) = A.B + A.C, connect AND and OR
gates as shown in the circuit below. Vary the inputs A, B and C and verify that
the outputs F and G are identical. Construct a truth table.
Now you have the tools to solve some simple Boolean logic problems. Consider
the statement: ”If Mary obtains permission from her mother or her father and if
Joe or Tom picks her up, she may go to the movies.” So the Boolean variables
are:
F = Mary may go to the movies
A = Her mother gives her permission
B = Her father gives her permission
C = Joe picks her up
D = Tom picks her up
Sidenote: given that Joe or Tom picking her up includes the case of both picking
her up…probably not going to turn out well!...we could put in the realistic logic of
Exclusive OR (XOR) here instead of OR. The symbol and truth table for XOR are
shown below. Can you see the difference as compared to just OR? By the way,
the Boolean operation symbol for XOR is just the standard OR “+” with a circle
around it.
4
The NOT Gate
Connect one of the NOT gates to test its output versus input. Construct a truth
table.
Connect a NOT gate to one input of an AND gate to show the Boolean operation
A./A = 0
DeMorgan’s Theorem
5
A practical operational way to look at DeMorgan's Theorem is that the inversion
bar of an expression may be broken at any point and the operation at that point
replaced by its opposite (i.e., AND replaced by OR or vice versa).
For the circuit below, connect inputs A and B and their complements /A and /B to
AND and OR gates as shown below. You will have to use NOT gates to obtain
these complement states. By the way, the upper circuit is the equivalent of the
NOT AND(NAND) logic gate.
Vary A and B to determine the output states and record in a truth table. What is
the Boolean equation for F and G in terms of A and B?
The Boolean expressions for these two circuits are: (top) /(A.B) and (bottom)
/A+/B. Can you see how DeMorgan’s theorem allows for the transformation
between these two different expressions and that they lead to the same result?
The NAND gate is exactly what it sounds like…the output of a normal AND gate
goes through a NOT gate. You may wonder why we have a separate IC just for
NAND when we could just use AND and NOT ICs. It turns out that all logic gates
can be constructed from NAND gates (via DeMorgan’s Theorem) so many
devices only use NAND ICs to save space and make component tracking
easy…“NAND is all you need.”
6
Use this IC to construct and test a simple 2-input NAND gate, i.e., performs the
Boolean algebra operation /(A.B). Vary the inputs over all combinations and
construct a truth table.
Now try to design and construct an OR gate made only with NANDs.
There are three useful states: set, reset and “no change”. The figure above
shows the “no change” state with both inputs high. This is the quiescent resting
state and the output could be either high or low depending on whether the
previous state was set or reset. The set state is when /S is low and /R is high.
The reset state is when /R is low and /S is high. There is a fourth state, both
inputs low, that results in an indeterminant output. When setting or resetting, only
a momentary state change is required, i.e., like pressing and releasing a button.
Build the flip-flop circuit above and test the inputs vs outputs. Construct a truth
table for this flip-flop.
7