Karnaugh Maps
Class: CSCE-312
Notes:
What is a Karnaugh Map?
- Special form of a truth table which enables easier pattern recognition
- Pictorial method of simplifying Boolean expressions
- Good for circuit designs with up to 4 variables
Grouping Rules for K-maps
- A group must only contain 1s, no 0s
- A group can only be horizontal or vertical, not diagonal
- A group must contain 2n 1s (1,2,4,8, etc.)
- Each group should be as large as possible
- Groups may overlap
- Groups may wrap around a table
- Every 1 must be in at least one group
- There should be as few groups as possible
K-map Examples
The Majority function
/CSCE-312/Visual%20Aids/Pasted%20image%2020250902132831.png)
/CSCE-312/Visual%20Aids/Pasted%20image%2020250902132919.png)
- Each row of the table represents a single combination of the inputs
bandc - Each column of the table represents either 0 or 1 for the input
a- So if b = 1, c = 1 and a = 1, the value that appears in the table aligned to this column and row is 1. This will be the value of the function.
/CSCE-312/Visual%20Aids/Pasted%20image%2020250902133327.png)
/CSCE-312/Visual%20Aids/Pasted%20image%2020250902133322.png)
/CSCE-312/Visual%20Aids/Pasted%20image%2020250902133429.png)
- This is the function for the Majority function!
- bc + ab + ac
- Things that are adjacent to each other in the K-map, are logically also adjacent to each other logically in a natural way
- Will you always group the 1s?
- Yes
- Groups might also be larger, you circle the larger group first.
- Then you go on and get smaller and smaller groups
The Prime function
/CSCE-312/Visual%20Aids/Pasted%20image%2020250902133658.png)
- List of first few numbers
- 0:000
- 1:001
- 2:010
- 3:011
- 4:100
- ...
- It turns out 1 is considered to be NOT a prime
/CSCE-312/Visual%20Aids/Pasted%20image%2020250902133826.png)
- This nice K-map, with some opportunities to circle in things
/CSCE-312/Visual%20Aids/Pasted%20image%2020250902133900.png)
- Gives you
bcachanges, but bothbandcare true here
/CSCE-312/Visual%20Aids/Pasted%20image%2020250902134008.png)
/CSCE-312/Visual%20Aids/Pasted%20image%2020250902134022.png)
awith a line on top of it is the complement ofa- Also written as not
a - Used basically when
ahas value 0- In this example
bhas two adjacent 1s whenais 0
- In this example
- Also written as not
The Parity function
/CSCE-312/Visual%20Aids/Pasted%20image%2020250902134320.png)
- Same process as for the other functions
/CSCE-312/Visual%20Aids/Pasted%20image%2020250902134340.png)
- Look at the table, there are no adjacent 1s!
/CSCE-312/Visual%20Aids/Pasted%20image%2020250902134406.png)
- Still can be written as a function
Chained OR function
/CSCE-312/Visual%20Aids/Pasted%20image%2020250902134434.png)
- In this table we have a lot to circle
/CSCE-312/Visual%20Aids/Pasted%20image%2020250902134444.png)
/CSCE-312/Visual%20Aids/Pasted%20image%2020250902134522.png)
/CSCE-312/Visual%20Aids/Pasted%20image%2020250902134531.png)
/CSCE-312/Visual%20Aids/Pasted%20image%2020250902134541.png)
- You can even circle the entire column
Prime function with 4-bit numbers
/CSCE-312/Visual%20Aids/Pasted%20image%2020250902134647.png)
- A 4-variable truth table requires a bigger K-map
/CSCE-312/Visual%20Aids/Pasted%20image%2020250902134721.png)
- Lets start circling
/CSCE-312/Visual%20Aids/Pasted%20image%2020250902134823.png)
not anot bc
/CSCE-312/Visual%20Aids/Pasted%20image%2020250902134855.png)
not anot bc+not abd
/CSCE-312/Visual%20Aids/Pasted%20image%2020250902135024.png)
- Tours = Shape of a donut
not anot bc+not abd+bnot cd
/CSCE-312/Visual%20Aids/Pasted%20image%2020250902135219.png)
not anot bc+not abd+bnot cd+not bcd- Not how these circles are connected from the outside
- This is when
bis 0,cis 1, anddis 1 achanges so it is not included
- This is when