Lab

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

CpE 272 Digital Logic Laboratory

Laboratory Report #1

Basic Logic Gates and Seven Segment


Displays

Mayra A. Cintora

January 15, 2019

1 Introduction
For this lab assignment the basic concepts of logic operations were intro-
duced. First, the logic gates and their truth tables were explained in order
to facilitate the comprehension of more complex logic circuits. Given a logic
diagram, the corresponding equation was obtained and then its truth table
was determined.
The results were verified making use of logic gates IC chips to build digital
circuits. Minterms were presented as a tool to obtain a logic expression that
corresponds to a desired output.
Also, seven segment display were introduced.

2 Part I – Building Logic Diagram Circuits


2.1 Experiment 1

Figure 1: Logic Diagram 1.

For the first experiment in this assignment we built a circuit on the


breadboard following the logic diagram shown in Figure 1. In order to use
the IC chips it is necessary to identify the corresponding tag for each logic
gate.

1
Three different logic gates were used:

• Gate 1: NOT (74LS04 IC)

• Gate 2: AND (74LS08 IC)

• Gate 3: OR (74LS32 IC)

To know the output Y corresponding to each of the possible combinations


of the three circuit inputs, it was necessary to determine the truth table of
our diagram. To verify the results in the circuit we used three push buttons
wired to +5 volts as the inputs, and one LED as the output.

2.2 Results

A B C G1 = A AB G2 = AB G3 = AB + C
0 0 0 1 0 1 1
0 0 1 1 0 1 1
0 1 0 1 1 0 0
0 1 1 1 1 0 1
1 0 0 0 0 1 1
1 0 1 0 0 1 1
1 1 0 0 0 1 1
1 1 1 0 0 1 1

Table 1: Logic Diagram 1 – Truth Table.

As shown in the last column of Table 1, the logic expression that results
from the first experiment is:

Y = AB + C

According to the results in the truth table, the LED used in the circuit will
be always on (logic 1 / +5 volts) for all the combinations except when inputs
A and C are off (logic 0 / GND) and input B is on.

2
2.3 Experiment 2
For the second experiment we did not build the logic circuit on the bread-
board, but we determined its truth table shown in Table 2.

Figure 2: Logic Diagram 2.

2.4 Results

A B C G1 = B G2 = B + C G3 = C G4 = Y = A(B + C)C
0 0 0 1 1 1 0
0 0 1 1 1 0 0
0 1 0 0 0 1 0
0 1 1 0 1 0 0
1 0 0 1 1 1 1
1 0 1 1 1 0 0
1 1 0 0 0 1 0
1 1 1 0 1 0 0

Table 2: Logic Diagram 2 – Truth Table.

The obtained logic expression for this experiment is:

Y = A(B + C)C

Making use of the Absorption Theorem we can reduce our previous equation
to:

Y = A.B.C

3
To verify this we computed the truth table of Y = A.B.C.

A B C B C A.B.C
0 0 0 1 1 0
0 0 1 1 0 0
0 1 0 0 1 0
0 1 1 0 0 0
1 0 0 1 1 1
1 0 1 1 0 0
1 1 0 0 1 0
1 1 1 0 0 0

Table 3: Truth Table of the expression Y = A.B.C.

3 Part II – Combinational Logic Networks


3.1 Experiment
Problem 1: Three inputs can be used to represent the numbers 0 to 7. If
you have A,B,C lines (inputs) which represent a number, design a circuit to
find whether the number it represent is divisible by 3. Thus, the output of
the circuit should be high whenever the input represents a number divisible
by 3 (Do NOT include zero as divisible by 3).

Binary Decimal
0 0 0 0
0 0 1 1
0 1 0 2
0 1 1 3
1 0 0 4
1 0 1 5
1 1 0 6
1 1 1 7

Table 4: Binary and Decimal representation of three inputs.

When a boolean expression (a.k.a function) results in a high output it


is called “minterm”. Minterms must involve all the inputs related to the
function, and from them we can derive the corresponding equation to the

4
logic diagram that produces the desire output. Thus, from the problem
above, we can deduce that when the binary combination of the three inputs
results in the decimal numbers three or six, the output must be a logic 1.
Our desire output then is:

Binary Decimal Y
0 0 0 0 0
0 0 1 1 0
0 1 0 2 0
0 1 1 3 1
1 0 0 4 0
1 0 1 5 0
1 1 0 6 1
1 1 1 7 0

Table 5: Desired output for Problem 1.

3.2 Results
Now that we have identified our minterms (high outputs from Table 5) we
can obtain the logic expression and the logic diagram.

A B C A C ABC ABC Y = ABC + ABC


0 0 0 1 1 0 0 0
0 0 1 1 0 0 0 0
0 1 0 1 1 0 0 0
0 1 1 1 0 1 0 1
1 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0
1 1 0 0 1 0 1 1
1 1 1 0 0 0 0 0

Table 6: Truth Table for Problem 1.

Using minterms, the resulting logic expression is:

Y = ABC + ABC

Simplifying the previous expression we obtain:

Y = B(AC + AC) = B(A ⊕ C)

5
And the corresponding logic diagram is shown below:

Figure 3: Logic Diagram 3.

4 Part III – Seven Segment Display


4.1 Experiment
In this section we used a seven segment display, which is a pack of LED’s
distributed in a certain order to represent specific characters when a combi-
nation of LED’s is turned on. In this case we used a common anode display,
which means that the anode of each of the LED’s are connected to the same
pin that must go to 5 volts.
In order to display the number 5 we wired the seven segment display along
with a pack of resistors. To turn on the specific LED’s that will show the
number five we needed the information from the datasheet so we could find
the right combination. It is important to keep in mind that in an common
anode display, a LED will turn on when receives a logic 0 (GND).

4.2 Results

Figure 4: Seven segment display.

6
Using the datasheet we found the corresponding pin for each LED on
the display and got the correct combination to display number five. Pins
10, 2, 3, 8, 5 were wired to a logic low.

5 Post-lab Question
1. Draw a truth table (similar to the last experiment) to represent number
0-7 divisible by 2. Again, don’t include zero. Find the output minterm
logic expression.

Binary Decimal Y
0 0 0 0 0
0 0 1 1 0
0 1 0 2 1
0 1 1 3 0
1 0 0 4 1
1 0 1 5 0
1 1 0 6 1
1 1 1 7 0

Table 7: Desired output to represent numbers divisible by 2.

And the truth table is:

Decimal A B C C A+B Y = (A + B)C


0 0 0 0 1 0 0
1 0 0 1 0 0 0
2 0 1 0 1 1 1
3 0 1 1 0 1 0
4 1 0 0 1 1 1
5 1 0 1 0 1 0
6 1 1 0 1 1 1
7 1 1 1 0 1 0

Table 8: Truth Table to represent numbers divisible by 2.

The Sum of Products form would be:

Y = ABC + ABC + ABC

7
Simplifying,

Y = C(AB + AB + AB)
Y = (A + B)C

2. Draw a logic diagram to show how you could construct an AND gate
using only NAND gates. Label your inputs and outputs

Figure 5: AND gate using only NAND gates.

Where C = D = AB and Y = CD

3. Comparing the two expressions of the divisible by 3 experiment (i.e.


Part II: 2a and 2b), what was the overall benefit of manipulating the
expression if they both give you the same exact output and why the
effort was useful?
Simplifying functions to their minimum expression, using the theorems
of Boolean Algebra, allows us to reduce the complexity of logical cir-
cuits, and therefore reduce costs in terms of time and resources when
trying to build more complex digital systems.

4. When using a common anode seven segment display, does applying a


logic high or logic low signal light up a segment? Why does it function
that way or why wouldn’t it be the opposite logic signal of what you
stated?
For a common anode display is required a logic low signal to light up
the LED’s. Since a LED is a light-emitting diode, it is composed of two
fundamental parts: anode and cathode. We could say that the anode
is the positive part of the diode, and the cathode the negative part.
To turn on a LED it is necessary to have a constant flow of electrons,
and therefore we need to close the circuit. To have a proper circuit

8
that allows the current flow across the LED, we require a positive
voltage, in our case +5 volts connected to the anode, and a reference
(GND)connected to the cathode. That is why the common pin was
connected to the +5 volts and the cathode to ground or logic low.
Connecting the LED in the opposite would not allow the current flow,
thus the LED would not light up.

6 Pre-lab Question
1. What is a binary subtractor?
It is an arithmetic circuit which output corresponds to the subtraction
of two logic inputs, normally binary numbers.

7 Conclusion
In this practice we learned the basic operation of logic gates to understand
how they can be used later to develop more complex digital systems. In the
experiments we could observe that the output of our system can only be
represented in two ways, high or low. Therefore we must assume that these
systems are used to generate, process and transmit only digital signals. The
outputs of the system correspond only to the state of the inputs at a specific
time.
Boolean algebra is a very useful tool to reduce complex logic functions to
simpler expressions that allow us to reduce resources.

You might also like