Lab5 KarnaughMaps
Lab5 KarnaughMaps
Digital Electronics
Using the Digilent Digital Electronics Board for NI ELVIS III
National Instruments respects the intellectual property of others, and we ask our readers to do
the same. This resource is protected by copyright and other intellectual property laws. Where
the software referred to in this resource may be used to reproduce software or other materials
belonging to others, you should use such software only to reproduce materials that you may
reproduce in accordance with the terms of any applicable license or other legal restriction.
All other trademarks or product names are the property of their respective owners.
Additional Disclaimers: The reader assumes all risk of use of this resource and of all information,
theories, and programs contained or described in it. This resource may contain technical
inaccuracies, typographical errors, other errors and omissions, and out-of-date information.
Neither the author nor the publisher assumes any responsibility or liability for any errors or
omissions of any kind, to update any information, or for any infringement of any patent or other
intellectual property right.
Neither the author nor the publisher makes any warranties of any kind, including without
limitation any warranty as to the sufficiency of the resource or of any information, theories, or
programs contained or described in it, and any warranty that use of any information, theories, or
programs contained or described in the resource will not infringe any patent or other intellectual
property right. THIS RESOURCE IS PROVIDED “AS IS.” ALL WARRANTIES, EITHER
EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY AND ALL
IMPLIEDWARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
AND NON-INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, ARE DISCLAIMED.
No right or license is granted by publisher or author under any patent or other intellectual
property right, expressly, or by implication or estoppel.
IN NO EVENT SHALL THE PUBLISHER OR THE AUTHOR BE LIABLE FOR ANY DIRECT,
INDIRECT, SPECIAL, INCIDENTAL, COVER, ECONOMIC, OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THIS RESOURCE OR ANY INFORMATION, THEORIES, OR PROGRAMS
CONTAINED OR DESCRIBED IN IT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES, AND EVEN IF CAUSED OR CONTRIBUTED TO BY THE NEGLIGENCE OF THE
PUBLISHER, THE AUTHOR, OR OTHERS. Applicable law may not allow the exclusion or
limitation of incidental or consequential damages, so the above limitation or exclusion may not
apply to you.
2
Lab 5: Karnaugh Maps
The Karnaugh map (K-map) is a tool and procedure used for minimizing Boolean
functions. It is a graphical method that can be used for the manual design of simple
logic functions having a small number of variables. K-mapping usually requires fewer
steps than algebraic simplification and it always produces a minimum expression.
The Karnaugh map of a function is actually its truth table written as a grid. The rows and
the columns of the map correspond to the possible values of the inputs and each cell
represents the outputs of the function for the correlated inputs.
The simplified expressions are always in one of the two standard forms:
Sum-of-Products
Product-of-Sums
The cells are formed in a square or rectangle fashion and arranged such that
neighboring cells have a single variable difference, otherwise known as Gray code
ordering. For simplicity, the input values are placed as column and row labels. Each cell
corresponds to a row in the truth table.
3
Learning Objectives
4
Required Tools and Technology
Platform: NI ELVIS III View User Manual:
http://www.ni.com/en-
us/support/model.ni-elvis-
iii.html
View Tutorials:
https://www.youtube.com/playl
ist?list=PLvcPIuVaUMIWm8zi
aSxv0gwtshBA2dh_M
Navigate to:
C:\NIFPGA\programs\Vivado2
014_4\data\xicom\cable_driver
s\nt64\digilent
Install: install_digilent.exe
5
Expected Deliverables
Boolean expressions
Analysis of gates for Combinational Logic Circuits
Truth tables
Conclusion questions
Your instructor may expect you to complete a lab report. Refer to your instructor for
specific requirements or templates.
6
1.1 Theory and Background
Video Summary
After transferring the truth table to a Karnaugh map, cells with common output values,
either all 0s or all 1s, are grouped into the largest possible rectangles. Cells are grouped
in functions of 2n either horizontally or vertically. Cells can be used more than once only
if this generates the least number of groups. Also, all cells sharing the chosen common
output must be contained within a grouping.
7
When choosing the POS form, the variable combination is supposed to equal 0, as is
the case when deriving a POS from a truth table. Therefore, the variable’s inverse (1) is
used when determining a maxterm.
Karnaugh maps are useful for minimizing the number of logic gates needed in a circuit.
In a practical sense, this reduction also results in a decrease in cost for a manufacturer
since fewer components are needed to create an equivalent circuit.
A common way we work with Karnaugh maps is the Seven Segment Display (SSD). An
SSD is an electronic device used for displaying numerical values. The device typically
consists of seven segments arranged in a figure 8. Any digit, as well as some alphabet
letters, can be displayed when the correct segments are activated. An example of an
SSD as well as possible outputs can be seen in the image shown.
8
Truth Tables
The truth table for an SSD consists of four inputs and seven outputs:
The numerical outputs of 0-9 are necessary in an SSD, but outputs 10-15 are said to be
illegal. In a Karnaugh map, don’t care conditions can be treated either as 0 or a 1,
depending on which one produces a larger block. See below for an example.
9
Figure 1-6 Karnaugh Map
Note: Similar Karnaugh maps can be created for all other segments.
1-1 Create Boolean expressions (SOP and POS) from the Karnaugh map.
_____________________________________________________________________
_____________________________________________________________________
10
1-2 Identify how many and which gates are needed to create the simplified
Combinational Logic Circuit for the SOP expression.
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
1-3 Identify how many and which gates are needed to create the simplified
Combinational Logic Circuit for the POS expression.
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
11
1.2 Exercise: Creating a Karnaugh Map from a Combinational Logic Circuit
PLD Design
12
1-4 Vary the inputs as per the truth tables and fill in the output.
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
Simplify the Output using Karnaugh maps. Take a screen shot, take a picture, or
draw a sketch of your Karnaugh map and include it with your completed lab.
Set up the simplified expression on Multisim. Take a screenshot, take a picture,
or draw a sketch of the expression and include it with your completed lab.
_____________________________________________________________________
_____________________________________________________________________
13
1.3 Implement: Using Karnaugh Maps in Seven Segment Displays
Using the truth table for a Seven Segment Display in the introduction, create
Karnaugh maps for segments a, b, and c.
Take a screenshot, take a picture, or draw a sketch of the maps and include it
with your completed lab.
Create the simplified circuit for the ‘a’ segment in Multisim. Take a picture or
screenshot and include it with your completed lab.
Run the simulation in Multisim.
1-6 Does the behavior of the simplified circuit match the expected result? If not, make
sure your Karnaugh map is simplified correctly, and the circuit matches the K-map.
_____________________________________________________________________
_____________________________________________________________________
14
1.4 Exercise: Simplified Circuits
Simplified Circuits
Instructions:
Create the simplified circuit for the ‘b’ segment and repeat your test.
Finally, create the simplified circuit for the ‘c’ segment and confirm its behavior.
Take pictures or screenshots of these two circuits and include them with your
completed lab.
1-7 How would you connect the 3 circuits simultaneously to produce the number 7?
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
Create a circuit which will output 3 values to control the a, b, and c segments.
Take a picture or screenshot and include this with your completed lab.
_____________________________________________________________________
_____________________________________________________________________
15
1.5 Conclusion
1-9 Did you find it easier to create a combinational logic circuit from a truth table or a
Karnaugh map? Explain.
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
1-10 Is there another device that can be used to create a seven-segment display? (Hint:
Consider a BCD to Binary Decoder).
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
1-12 How many cells can be grouped together in the simplification of Karnaugh maps?
A. No more than 4
B. 2
C. 2^n
D. As many as possible
16
1-13 Creating Boolean expressions from Karnaugh maps typically leads to ______ in
the number of logic gates needed in a circuit.
A. An increase
B. A decrease
C. No change
D. None of the above
17