Lab 3

Building a 7-Segment Display Decoder

Here is the grading form that will be used to grade your lab.

Goal

In this lab you will use NOT, OR, AND gates to implement a 7 segment decoder for two binary digits. By pressing two input switches in different combinations, the 7-segment display will display a 0, 1 2, or a 3.

A 7-segment Display

A 7-segment display is a display of numeric digits (and limited alphabetic characters) that is made of 7 LEDS in the following way:

7-segment display
Each segment corresponds to a pin in the base of the display.

 IMPORTANT: To power each segment you need to connect a 470ohm resistor in series with the segment. Otherwise, if you power the segment with +5V straight from the power supply, you can permanently damage your display. See the note below.


You can build digits 0 to 9 by powering the different segents:

Example:

7-segment

The Initial Protoboard

You will reuse some of the work that you did from lab1.

From lab1 remove the cables that go to the AND and OR gates.

Before:

protoboard before

After
Protoboard after

IMPORTANT: Most LED's use a voltage of 2 to 3V. Before connecting one of these LEDs to a 5 V source, a resistor has to be added in series to reduce the voltage and to limit the current that flows through them. Without this resistor the LED will burn out. The red and green LEDs given in the kit are the exception since they have already an internal resistor so they can be powered directly from a 5V source. However, your 7-segment display does not have this internal resistor and it can be burn if you place by mistake the 5V straight into the LED segments.

To prevent burning the 7-segment display by accident, disconnect the battery. Before placing the battery again, add first the resistors that limit the current to the display's LED segments.

Place the 7-segment display at the end of the protoboard so the last pin is aligned to the last column in the protoboard. See the ilustration: Notice that the decimal points are located closer to you. Notice that pin 1 is in E56 and pin 8 is in E63 in the protoboard.

Connecting 7-segment display

In the other side, pin 9 is at location G63, and pin 16 is at location G56. Pins are counted counter-clockwise starting at pin 1 at the lower-left corner.

7-seg display back

7-segment display connected

The datasheet of the 7-segment display with the location of the pins is located here. Here is also a summary of the pin location and coordinates in the protoboard:

Segment
Coordinates
Pin
a
G58
14
b
G56
16
c
G59
13
d
E58
3
e
E60
5
f
G61
11
g
G57
15

Common Cathode
Coordinates
Pin
Digit 1
E56
1
Digit 2
E57
2
Digit 3
E61
6
Digit 4
E63
8

Connect first  the Common Cathod pins  for all the digits  to ground. Make sure that the battery is not connected.

Connected cathodes

Now connect the resistors from the segments to pins E45 to E52 that will be used to drive the segments.
Choose the 470ohm resistors that come in a tape like the one in the image below. The colors for these resistors should be yellow-violet-brown.

470ohm resistor

Since the resistors will be very close to each other, you will have to put plastic isolation around the resistor terminals so they do not touch each other. Cut a 4 inch cable and then pull the wire out of the plastic. Use the cutter in the pliers to pull the cable but do not press too hard so the cable is not broken.

pulling plastic 2

pullcable

Cut the plastic to the size of a resistor terminal leaving about 1/4 of an inch of the terminal. Slide the plastic around the resistor terminal like the resistor in the picture below.

Here is the list of the resistors and the coordinates of where the resistors have to be connected.

Segment Resistor
From
To
R-a
H58
E45
R-b
H56
E46
R-c
H59
E47
R-d
C58
E48
R-e
C60
E49
R-f
H61
E50
R-g
H57
E51

Here is the resistor R-a connected with the plastic isolation in place.

R-a

Here are the resistors for segments a, b, and c connected.

segments a and b

Here are the resistors for all the segments connected.

all segments connected

Connect all the resistors to the corresponding sockets. At ths point ask your instructor or other experimented student to check your work. Here we are testing segment a using a wire connected to +5V and the resistor that connects segment a.

turnon seg a

You can test every segment in the same way.

test segment e

Testing segment g

If you have problems turning on one of the segments and all connections are correct, push the display a little against the protoboard. If you still have problems, see your instructor. At this point I recommend you to put a tape above and below the display to prevent accidental connections that may damage your display.

display with tape

Implementing the 7-Segment-Display Decoder

We want you to implement a circuit that display the digits 0, 1, 2, and 3 in the display when the switches x and y are pressed. x=0, y=0 should produce the digit 0. x=0, y=1 should produce the digit 1, x=1, y=0 should produce the digit 2 and x=1, y=1 should produce the digit 3. To produce them, each segment will have its own circuit that implements the corresponding boolean expression.

The following table summarizes the truth table for all the segments for digits 0 to 3. Only the truth table for the segment a and the segment g are provided. You will have to fill in the values for all the other segments:

7-segment

Table 1
x
y
a
b
c
d
e
f
g
0
0
1



1


0
1
0



0


1
0
1



1


1
1
1



0



Using the "product of sums" technique, we can find out that a can be implemented by the function a=x+y' .
Using the "sum of products" we can find out that e=x'y'+xy'=y'(x'+x')=y'. Reducing this function we find that e=y'.

Table 2 summarizes the bolean expressons for each segment. Only the expressions for a and e are given. You have to fill in the table.

Table 2
Segment
Boolean Expression
a
x+y'
b

c

d

e
y'
f

g


The following picture shows the implementation of the boolean expression for segment a.
segments a and g implemented

The following pictures shows the implementation of segments a and e.

Segment G boolean expression
test17-seg test2
7seg test3


FIll in Table 1 and also complete Table 2. Use the simplest boolean expressions you can find. Then implement them with the chips. Here are the pin assignment for reference:

notandor

For Next Lab

For next lab you will have to bring:
  1. Your protoboard implementing the 7-segment decoder. Make sure that 0 is shown in the display when no switch is pressed, 1 is shown when only y is pressed, 2 is shown when only x is pressed, and 3 is shown when both switches x and y are pressed. Your instructor will verify that your implementation works correctly.
  2. Also bring a  printout of Table 1 and Table 2 filled in with all the values and expressions.