CS 14 -- Lab 1
Welcome to the digital design lab! Today's task is to build a
half-adder -- a simple adding circuit that will be
presented during the lab time. You should begin small by
constructing the pieces needed, and build your way to the entire
half-adder.
Knowing what the toys are
Don't do anything yet! We're going to spend a few minutes
going over the various chips, boards, power supplies, and other
devices that you'll need to use for this and other labs. Here's
a list of the devices you'll be using, and some key information
about them:
-
Power supplies: There are two kinds of power supplies
in the lab. Each power supply has a positive (red) contact
and a ground (black) contact. On some of the black power
supplies, it's a bit hard to tell which is which, but each is
marked unambiguously. If there's a red wire soldered on, its
positive. If there's a black or blue wire soldered on, it's
ground.
-
Breadboards: These look like clipboards will lots of
little holes in them. These are going to allow us to
structure our circuits, as we'll have to plug all of the parts
into them to make them work. Each breadboard has several
posts at the top, where you can make a connection from
the power supply. Red and black have the same meaning as
above, for the power supplies themselves.
-
Alligator clips: You use wires with alligator clips to
connect between the power supply and the posts on the
breadboards. It's essential to ensure that you are not
getting positive and ground reversed. This can destroy
chips and make them very, very hot. You should only should
only connect your board to the power supply after you've built
your circuit. Beware of short circuits.
-
Power channels: There are several power channels on
each board, marked by red or blue/black lines. The colors
respectively mean positive and ground. There should be wires
from the posts to two of the power channels. Each power
channel is electrically connected inside the board, meaning
that once a channel is connected to a post, power is available
at each post in the channel. There should be wires connecting
all of the red channels together and all of the blue/black
channels together. If these wires are not already on your
board, you can add them as you go. Again, don't get red
and black reversed.
-
Capacitors: There should be a capacitor on your board
connecting the two power channels that are connected to the
posts. The capacitor helps smooth out fluctuations in the
current.
-
Chips: We'll use three kinds of chips today: 7404
(NOT gates), 7408 (AND gates), and 7432
(OR gates). Data sheets describing the operation of
these chips are attached. As the semester goes on, you'll be
using lots of other chips. Data books on the shelf in the lab
describe their operation. When possible, data sheets will
also be posted on the class web pages, under the
Documents section. Some important notes on the chips
and their use:
-
Orientation: Each chip has a mark, either a small
hole or a small cutout, to indicate the top end. The top
pin on the left is pin 1. The pin numbers go down the
left side and up the right side. Most of our chips have
14 pins, but some will have more.
-
Power and ground pins: Two pins on each chip must
be connected to power channels. The pin marked
Vcc on the data sheet should be connected to the
red channel. The pin marked GND should be
connected to the black/blue channel. Don't get them
backwards, and don't install the chip upside down.
-
Installing chips: Chips must be laid on the board
with the right end up and with the pins straddling the
groove. Each row of five pins is electrically connected
within the board. By placing the chip so it straddles the
groove, you are ensuring that there are separate sets of
holes for each pin of the chip. Be sure to press each
chip in gently and evenly, without letting one end or the
other twist up or down. This will help you avoid breaking
pins.
-
Removing chips: Remove chips carefully and evenly,
by using a chip extractor and pulling straight up.
Do not try to remove the chips with your fingers, as
you'll probably bend or break the pins in the process.
Return each chip to the place you got it.
-
Wires: There are bins of wires available for your use.
When you make a connection on the board, try to do it neatly
and try to avoid using wires that are too long for the
purpose. Your work will be far easier to test and correct if
the wires are short and well organized. When you need a wire
of a certain length, you can either look for one or you can
make one from a longer wire, using wire strippers to cut and
remove insulation. You may even want to devise for yourself a
wire-color scheme, such that each color implies something
about the purpose to which the wire is being put.
-
Switches: There are two kinds of switches, press
buttons or long chip-like sets of switches. One side of each
switch should be connected to ground and the other side to
whereever you need it in the circuit. For most chips, an
input from an open switch is equivalent to a positive input.
-
LEDs: Light-emitting diodes are used to show the output
of your circuits. You can connect an LED from the output of a
gate to a 100-ohm resistor (these have a
brown-black-brown stripe pattern on them). The other
side of the resistor must go to ground. LEDs have a
direction: the short leg of the LED should face the resistor.
On some LEDs there is a flat edge to indicate the side facing
the resistor.
-
Logic probes: Logic probes are great debugging tools.
If you connect them to power you can insert the probe tip into
holes to determine if there is a positive voltage (a red light
and a high-pitched sound), a ground connection (a green light
and a low-pitched sound), or an open connection (no light or
sound). One of the probes doesn't have sound. Probes
don't always work in locations that are connected to LEDs.
We may not use all of these parts in the first lab, but you will
need a number of them, and eventually you will use all of them.
What to build
Just as with programming, it is unwise to construct a complete
solution without testing its parts along the way. With a large
circuit, you want first to construct the smaller circuits that
will later compose the large one. With each smaller circuit,
you should debug it thoroughly before connecting it to other
smaller circuits.
Today, we'll move one part at a time through constructing the
half-adder:
-
Set up a single AND gate by using a 7408 chip. Set
up an LED so that you can see the output of this gate. Try
all four possible inputs to be sure that it's operating
correctly. You've just constructed the circuit the generate
the carry bit for your half-adder, where one input is
your A value, and the other your B value.
-
Begin constructing an XOR circuit by using the
NOT gates in the 7404 chip. You will want use two
gates, one to produce NOT A, and the other to produce
NOT B.
-
Use two more of the AND gates from the same 7408 chip
as you used above. To one gate, connect A and
NOT B, and to the other NOT A and
B.
-
Finally, bring the outputs of the two AND gates used
in the previous step, and connect them as inputs to an
OR gate on your 7432 chip. The output of this
particular gate is A XOR B, also known as the
result bit.
-
Wire the outputs of these two circuits so that they appear
adjacent to other another on an LED. Once you've done that,
you have a half-adder!
Finishing up
Be sure to leave yourself a little time to complete the lab!
Every week, there are some things you'll have to do whether or
not you've completed the assignment.
-
Demonstrating your work: If you've finished the lab,
then you need to show it to the professor or the TA. You
won't get credit unless we've seen it work!
-
Saving your work for another day: If you need to save
your work to finish another day, put your name on a label on
the board, and place it in on of the lower drawers.
Unlabelled work may be dismantled!
-
Cleaning up: When you're done, put away everything and
clean up your area. If you do not clean up and put your board
away (if needed), your work may be dismantled!
Scott F. Kaplan
Last modified: Tue Jan 29 09:28:16 EST 2002