Laboratory 6: Digital Logic I: COS 116 The Computational Universe
Laboratory 6: Digital Logic I: COS 116 The Computational Universe
In this lab you’ll construct simple combinational circuits with a “breadboard” and silicon
chips. You’ll use these circuits to experiment with digital logic.
If you get stuck at any point, feel free to discuss the problem with another student or a
TA. However, you are not allowed to copy another student’s answers.
Hand in your lab report at the beginning of lecture on Tuesday, April 4. Include
responses to questions printed in bold. (Number them by Part and Step.) When you
assemble the circuit for Majority-of-3, you need to show it to your TA. Otherwise
you will not get credit for the lab.
Also, at the end of the lab you must remove any wires or components that you added
to the breadboard and place them back in the plastic box you received. Return this
plastic box to the TA before leaving the lab.
Breadboards are used to build temporary circuits during prototyping. Their name derives
from little holes into which you insert electronic components and connecting wires. You
can quickly assemble and disassemble circuits. No soldering required! Here is a picture.
+ – a b c d e f g h i j + –
Some of these holes are wired together on the inside, as shown in the diagram on the left.
For example, if you insert two wires into the holes labeled “a” and “e” in the same row,
they will be electrically connected.
The breadboard has plugs at the top to accept power. Do not connect the power supply
until you reach the appropriate time in the experiment. Also, your breadboard will
come with some wires inserted into it already; please do not remove them at any
time.
Our silicon chips use a voltage of 5 volts to denote the binary value 1 and a voltage of
zero volts to denote 0. These two voltages are also called “power” and “ground”
respectively. Notice that the breadboard has two columns on each side marked with the
red and blue stripes (and the symbols + and –). All holes in the + columns are connected
to the power (red/+) terminal on top and all holes in the – columns are connected to the
ground (blue) terminal of your power supply.
You have been given a plastic box containing all supplies for today. The lab TA will
walk you through the parts that you will need.
Connect your breadboard to the power supply using the red and black power
supply leads. Connect the red terminal of the power supply to the red post on the
breadboard (and the black terminal to the black post). Each power supply can feed
multiple breadboards since the jacks can stack on top of each other. Switch the
power supply on, and verify that its voltage reading is 5 volts. If not, contact the TA.
Caution: For safety, before you insert or remove any components from the
breadboard, always disconnect the power by unplug the red power supply
connector from the breadboard’s connector post.
In this part you’ll implement a very simple circuit involving a single switch and a light
bulb (LED): the switch is used to turn the LED on and off.
3
Switch 4 output Switch 3 output
4
1. Disconnect the power by unplugging the red power supply wire from the
breadboard.
2. Insert the LED into the right half of the breadboard. Make sure the longer
lead is on the left, as shown above! The LED will not function if you connect it
in reverse. Use a red LED if possible, as it tends to be the brightest.
3. Use a short jumper wire to connect one of Switch 1’s output holes to a hole in
the row where you inserted the LED’s longer leg.
4. Connect a resistor between the row where you inserted the LED’s shorter leg
and one of the ground holes in the breadboard’s rightmost column. (Unlike
the LED, the resistor can be connected in either direction.) The voltage from
5. Reconnect the power supply to the breadboard. Toggle Switch 1, and verify
that the LED is on when the switch is to the left and off when the switch is to
the right.
6. Rewire your circuit to use Switch 2 instead of switch 1, and verify that it
works. Repeat for Switch 3 and Switch 4. If any of the switches do not
function correctly, ask your TA for assistance.
Now we understand the gates contained inside our silicon chips, and build a circuit with a
single gate. Each chip used today packages several identical gates:
NOT
AND OR
NOT
AND OR
NOT
Ground Ground Ground
Notice the small imprinted dot at the top of each chip—you’ll use this to orient the chip
correctly on the breadboard. The upper-right pin on each chip should be connected to
power (wire this to the + column on the breadboard), and the lower-left pin should be
connected to ground (wire this to the – column). The diagram above shows how the
remaining pins are assigned to the inputs and outputs of the gates.
1. Disconnect the power by unplugging the red power supply wire from the
breadboard, and remove all the components (except the switch) which you
inserted in the previous experiment.
2. Insert the LED, resistor, and 74LS08 (AND gate) chip into the right half of
the breadboard, as shown in the picture below. Make sure the notch in the
LED Resistor
a. Connect the outputs for switches 1 and 2 to the inputs of the AND
gate.
c. Connect the chip’s power and ground inputs to the + and – columns of
the breadboard, respectively.
4. Complete the following truth table. Does it match the correct behavior for
an AND gate?
6. Carefully remove the 74LS08 chip using the chip extractor tool. (Ask your
TA if you need help.)
9. Complete another truth table for the modified configuration. Does your new
circuit match the correct behavior for an OR gate?
10. Repeat steps 5–9 with the 74LS04 chip (NOT gates). This time, you’ll need to
rewire the breadboard, since a NOT gate has only one input instead of two
like AND and OR gates. Connect a single switch to the input of the NOT gate,
and connect the NOT gate’s output to the LED.
11. Test your NOT gate circuit until it behaves correctly. Draw a picture of the
working design in your notes.
As you saw in the lecture, you can use AND, OR, and NOT gates to build a circuit to
compute any Boolean function. One simple example is the majority function. Given n
inputs, the majority function is true if more than half the inputs are true; otherwise it is
false.
The diagram below shows one way to use AND and OR gates to build the majority
function for 3 inputs. Complete the truth table on the right by examining the circuit
diagram. Make sure your results match the majority function.
0 0 0
AND AND AND
0 0 1
0 1 0
OR 0 1 1
1 0 0
1 0 1
OR
1 1 0
Result 1 1 1
1. Disconnect the power by unplugging the red power supply wire from the
breadboard, and remove all the components you inserted in the previous
experiment.
2. Insert the LED, resistor, 74LS08 (AND gate) chip, and 74LS32 (OR gate)
chip into the right half of the breadboard. Make sure the chip notches are to
the top. Wire the power and ground connections for the chips, as shown:
(AND gates)
74LS08 chip
3
74LS32 chip
(OR gates)
LED Resistor
3. Make connections from Switches 1, 2, and 3 to the inputs of three AND gates:
(AND gates)
74LS08 chip
3
74LS32 chip
(OR gates)
LED Resistor
4. Connect the outputs from two of the AND gates to the inputs of one of the
OR gates. Wire the output from that OR gate, and the output of the third
AND gate, to the input of the second OR gate. Connect the second OR gate’s
output to the LED:
(AND gates)
74LS08 chip
3
4
74LS32 chip
(OR gates)
LED Resistor
5. Reconnect the power supply to the breadboard.
1. Write the truth table for the majority-of-4 function and represent it with a
Boolean expression. Simplify the Boolean expression as well as you can and
report the simplest expression you came up with.
74LS32 chip
(OR gates)
3
(AND gates)
74LS08 chip
LED Resistor
3. Using the chips from this lab, approximately how many gates can fit on a
single breadboard? (Ignore the space used for wiring.) Intel’s Pentium 4
processor contains approximately 10 million gates. How many breadboards
would it take to contain this many gates? Estimate the number of football
fields this many breadboards would cover. (State any assumptions you
make.)