0% found this document useful (0 votes)
155 views7 pages

Lab 6 - Combinational Logic Modules - Decoders

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 7

CPE 301 – Logic Circuit

Experiment 6: Combinational Logic Modules – Decoders

Objective/s:

1. To study the basic operation and design of decoder circuits.


2. To describe the concept of active low and active high logic signals.
3. To learn how to use the n-to-2n type decoders to implement a given Boolean function.
4. To learn how to use 7-segment LED display along with a seven-segment decoder to create
decimal digits.

Equipment Required

1. Software simulation: The Logisim software package

Theory

1) Decoders
Decoder is a combinational circuit that converts certain coded inputs to another coded outputs.
Famous examples of decoders are binary n-to-2n decoders and seven-segment decoders. A binary
decoder has n inputs and a maximum of 2n outputs. As we know, an n-bit binary number provides 2n
minterms. This type of decoder produces one of these 2n minterms at the outputs, based on the
input combinations. The following table shows the block diagram and the truth table of an example
2-to-4 decoder.

From the truth table, you can observe the basic operation of n-to-2n decoders. For each input
combination, there is only one active output Di, which is an acronym of the minterm (mi). The module
has an active high Enable. Accordingly, it will not work unless the Enable is connected to logic 1.
An example of a commercial n-to-2n line decoder is the 74139 chip. This chip has two 2-to-4 decoders
with active low enable for each.

2.) Implementation of Boolean Functions using Decoders

Any Boolean function can be expressed as a sum of products (or sum of minterms). A binary decoder
provides all the minterms as outputs. Therefore, any Boolean function could be implemented by ORing
its minterms (Di), which are generated by a decoder. For example, consider the full-adder circuit that
we discussed and designed in lab (4). The Boolean expressions for the outputs S and Cout (in terms of
the inputs x, y, and Cin) are:

The above expressions can be implemented by ORING the appropriate combination of output
minterms of a 3-to-8 decoder.

3.) Seven-Segment Decoder and Seven-Segment Display


Another common type of decoder is the seven-segment decoder. This decoder is used along with
seven segment LED display to create a decimal or hexadecimal digits. The seven-segment LED
display is commonly used as a numerical display in multimeters, calculators …etc. It contains seven
independent LEDs arranged as shown in the following figure.

Prepared by: Rodolfo G. Doromal, Jr. Ph.D. Page 1


There are two main types of seven-segment LED displays: the common cathode (CC) and the
common anode (CA). In the CC type, the cathodes of all segments (i.e., LEDs) are internally joined in
a single node. In contrary, in the CA type, the anodes are internally joined together in a single node.
The other sides of LEDs (a, b, c …etc.) are left for the designer to connect them externally. CC display
is said to be active high, as a connection of logic 1 causes the designated segment to be ON. On the
other side, a connection of logic 0 to a segment in the active low CA display causes that segment to
turn ON. The following figure shows the internal connection of both types.

All decimal or hexadecimal numbers can be displayed by controlling the state of the appropriate
segments ON or OFF. This can be done using a seven-segment decoder. A seven-segment decoder
accepts four binary inputs. According to these inputs, it provides seven outputs that determines
which segments of the seven-segment LED display should be ON in order to create the
corresponding decimal or hexadecimal digits.

A widely used commercial common anode 7-segment decoder is the 7447 chip. This chip changes a
BCD number to its corresponding CA seven-segment code. The generated seven-segment code could
be used for displaying numbers from 0 to 9, based on the corresponding input BCD number. The
circuit that displays any input BCD number on a common anode 7-segment display is shown in the
following figure. Similar connection could be used for common cathode display. However, the 7447
decoder should be replaced by the 7448 one.

Equipment Required:

1) Software simulation: The Logisim software package is installed on every PC in the lab.
2) Hardware implementation: The following equipment are needed to perform all the procedures:
- IC Training Kit
- Jumper wire kit
- 1x 7447 BCD-TO-SEVEN SEGMENT DECODERS/DRIVERS

Prepared by: Rodolfo G. Doromal, Jr. Ph.D. Page 2


- 1x Common Anode (CA) Seven-Segment LED Display
- 4x Toggle Switches
- 7x Carbon-film Resistors (470Ω)

Procedures/Lab Work:

a) Software Simulation
1. Implementation of Boolean Functions using Decoders
2. Consider the following Boolean function. It is required to implement it using 3x8 decoder.
F (A, B, C) = A' B' C + A B' C' + A B C

3. Draw the circuit that implements the Boolean function in the area below. If necessary, have
your TA to check your implementation.
Answer:

4. Start a new Logisim project.


5. From the Plexers folder, select a decoder and insert in onto the canvas
6. In the attribute table, change the Select Bits attribute to 3 and the Include Enable to No

7. Insert three input pins and name them A, B, and C, respectively.


8. From the Wiring folder, select a Splitter and insert it onto the canvas.
9. Use the splitter to collect the three inputs A, B, and C in a bus. Ensure that inputs A, B, and C are
connected to bits 2, 1, and 0 of the bus, respectively. Connect this bus to the input of the
decoder.

Prepared by: Rodolfo G. Doromal, Jr. Ph.D. Page 3


10. The decoder has 8 outputs. According to the circuit you draw, implement the
Boolean function using proper decoder outputs. Use the poke tool to check the circuit for
proper operation. Have your TA to check your work.

b) Seven-Segment Decoder and Seven-Segment Display

1. Start a new Logisim project. Save the project with the name "7 segment display"
2. The 7-segment decoder is not a part of the built in Logisim modules. Therefore, we have to add
it to Logisim first. The 7 segment decoder is already implemented for you. You could find it
in the desktop under the name "7 segment decoder"
3. From the Project menu, select Load library/Logisim Library

4. Browse to the file "7 segment decoder" on the desktop, select it, and click Open. You will see
a new folder added to your explorer pane named "7 segment decoder"

5. From the "7 segment decoder" folder, select main and insert it into the canvas
6. From the Input/Output folder, select "7-segment display" and insert it into the canvas.
7. Insert 4 input pins to the canvas, to the left of the decoder, and name them A, B, C, and D,
respectively.
8. Connect A, B, C, and D to I3, I2, I1, and I0 of the decoder, respectively. To know the name of
any decoder input, stop the mouse over that input. A hint box will appear with the name of that
input. For example, the following figure shows the hint of decoder input I0.

Prepared by: Rodolfo G. Doromal, Jr. Ph.D. Page 4


9. The 7 segment display has 8 inputs corresponding to the 7 segments, a to g, and the dot in the
bottom right. If you start from the top right and go counter-clockwise, the order of these inputs
is: b, a, f, g, e, d, c, and the dot. You could verify that yourself by connecting every input to
logic 1 and see which segment will be ON.
10. Connect every output of the decoder to its corresponding input of the display. Leave the input
of the dot unconnected.

11. Use the poke tool to verify the operation of the circuit. Enter different BCD numbers and
monitor the corresponding decimal digits on the 7 segment display. Fill in the following table
(i.e., color the segments that are ON)

Prepared by: Rodolfo G. Doromal, Jr. Ph.D. Page 5


c) Hardware Implementation

1. Construct the circuit that shows BCD numbers on a 7-segment display


2. Verify the operation of the circuit. Enter different BCD numbers and monitor the corresponding
decimal digits on the 7-segment display. Fill in the following table (i.e., color the segments that
are ON). Have your TA to check your work.

Questions/Exercises:
1. Implement the following Boolean function using 3x8 decoder. Draw the circuit diagram and
simulate your design using Logisim to ensure its proper operation. Snapshots from Logisim
should be included in your report.

F(A, B, C) = A' B' C' + A B' C + A B'

Reference(s)
1. Introduction to Logic Circuits & Logic Design with Verilog, 1st Edition, Brock J. LaMeres
2. Digital Design, 3rd Edition, M. Morris Mano
3. Digital Principles and Logic Design, A. Saba & N Manna

Prepared by: Rodolfo G. Doromal, Jr. Ph.D. Page 6


Laboratory Report Format

CPE 306 – Introduction to HDL

Name: _____________________________________ Yr. & Sec. ____________ Date: ______________

Experiment Title
Experiment No. _

I. Introduction

II. Objectives

III. Materials and Components

IV. Procedure (include screenshots/images)

V. Results and Discussion

VI. Conclusion

Prepared by: Rodolfo G. Doromal, Jr. Ph.D. Page 7

You might also like