Karnaugh Maps. What are karnaugh maps? Boolean algebra can be represented in a variety of ways. These include: Boolean expressions Truth tables Circuit.

Slides:



Advertisements
Similar presentations
Programming Logic Gate Functions in PLCs
Advertisements

Digital Circuits.
Prof. Sin-Min Lee Department of Computer Science
I NTRODUCTION TO THE K ARNAUGH M AP 1 Alan Clements.
Gate-level Minimization
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapter 2 – Part 4.

EET 1131 Unit 5 Boolean Algebra and Reduction Techniques
Propositional Calculus Math Foundations of Computer Science.
Computer Organization and Assembly Language: Chapter 7 The Karnaugh Maps September 30, 2013 By Engineer. Bilal Ahmad.
Boolean Algebra and Logic Simplification
Digital Logic and Design Vishal Jethva Lecture No. 10 svbitec.wordpress.com.
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
1 Fundamentals of Computer Science Propositional Logic (Boolean Algebra)
Digital Logic Chapter 4 Presented by Prof Tim Johnson
Chapter 3.5 Logic Circuits. How does Boolean algebra relate to computer circuits? Data is stored and manipulated in a computer as a binary number. Individual.
1 Simplification of Boolean Functions:  An implementation of a Boolean Function requires the use of logic gates.  A smaller number of gates, with each.
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC. K-Map (1)  Karnaugh Mapping is used to minimize the number of logic gates that are required in a digital circuit.
1 The Chinese University of Hong Kong Faculty of Education Diploma in Education (Part-Time) Winter 1997 Educational Communications and Technology Assignment.
1 Digital Logic Design Week 5 Simplifying logic expressions.
Digital Circuits. Review – Getting the truth table The first step in designing a digital circuit usually is to get the truth table. That is, for every.
Computer Science 210 Computer Organization Introduction to Boolean Algebra.
Chapter 3: Digital Logic Dr Mohamed Menacer Taibah University
1 Lecture 6 BOOLEAN ALGEBRA and GATES Building a 32 bit processor PH 3: B.1-B.5.
CS1Q Computer Systems Lecture 7
February 2, 2004CS 2311 Karnaugh maps Last time we saw applications of Boolean logic to circuit design. – The basic Boolean operations are AND, OR and.
Computer Systems 1 Fundamentals of Computing Simplifying Boolean Expressions.
CS231 Boolean Algebra1 Summary so far So far: – A bunch of Boolean algebra trickery for simplifying expressions and circuits – The algebra guarantees us.
Karnaugh Mapping Digital Electronics. Karnaugh Mapping or K-Mapping This presentation will demonstrate how to Create and label two, three, & four variable.
CS151 Introduction to Digital Design Chapter Map Simplification.
Chapter 2 Boolean Algebra and Minimization Techniques.
Karnaugh Maps (K maps). What are Karnaugh 1 maps?  Karnaugh maps provide an alternative way of simplifying logic circuits.  Instead of using Boolean.
Sum-of-Products (SOP)
Chapter 3 Special Section Focus on Karnaugh Maps.
Karnaugh Maps (K-Maps)
BOOLEAN ALGEBRA AND LOGIC SIMPLIFICATION
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
THE K-MAP.
School of Computer and Communication Engineering, UniMAP DKT 122/3 - DIGITAL SYSTEM I Chapter 4A:Boolean Algebra and Logic Simplification) Mohd ridzuan.
NAND, NOR, and EXOR (more primitive logical gates) CS Computer Architecture David Mayer.
Lecture 21: Combinatorial Circuits II Discrete Mathematical Structures: Theory and Applications.
Karnaugh Maps The minimization method using Boolean Algebra, apart from being laborious and requiring the remembering all the laws, can lead to solutions.
K-maps and Decoders Prof. Sin-Min Lee Department of Computer Science.
Digital Logic & Design Dr. Waseem Ikram Lecture 09.
Mu.com.lec 9. Overview Gates, latches, memories and other logic components are used to design computer systems and their subsystems Good understanding.
EET 1131 Unit 5 Boolean Algebra and Reduction Techniques
Computer Science 210 Computer Organization
Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and
DeMorgan’s Theorem DeMorgan’s 2nd Theorem
Lesson Objectives Aims Be able to define problems using Boolean logic
Logic Gates, Boolean Algebra and Karnaugh Maps
Dr. Clincy Professor of CS
Karnaugh Maps.
Karnaugh Maps (K-Maps)
Computer Science 210 Computer Organization
Digital Circuits.
Dr. Clincy Professor of CS
Combinational Logic Design Process
Karnaugh Maps Topics covered in this presentation: Karnaugh Maps
Computer Science 210 Computer Organization
Dr. Clincy Professor of CS
Dr. Clincy Professor of CS
CS Chapter 3 (3A and ) – Part 3 of 5
Dr. Clincy Professor of CS
Chapter 3 Special Section
Karnaugh Maps (K maps).
Laws & Rules of Boolean Algebra
Digital Circuits.
Computer Architecture
Digital Circuits.
Presentation transcript:

Karnaugh Maps

What are karnaugh maps? Boolean algebra can be represented in a variety of ways. These include: Boolean expressions Truth tables Circuit diagrams Another method is the Karnaugh Map (also known as the K-map) K-maps are particularly useful for simplfying boolean expressions

2 variable K-Map Starting with the Expression: A ∧ B As a Truth Table this would be: As a Circuit Diagram this would be: A K-Map, will be a small grid with 4 boxes, one for each combination of A and B. Each grid square has a value for A and a value for B. To complete the K-Map for the expression, you find the box in the row where A is true and the column where B is true, put a 1 in the box that is in both rows. AB A ∧ B

2 variable K-Map One way to view a K-Map is to figure out what the ‘address’ is for each box: what its A and B values are for each position These have been written in the format (A, B) (0,0) (0,1) (1,0) (1,1)

2 variable K-Map To create a K-map for the expression: A Place 1s in all the boxes in the row where A is true 1

2 variable K-Map To create a K-Map for the expression B Place 1s in all the boxes in the column where B is true 1

2 variable K-Map Expression: ~A ∧ B Find the row where A is false and the column where B is true Place a 1 in the overlapping position 1

2 variable K-Map Try working backwards! Starting with the K-Map, interpret the results and write an expression Highlight the row that contains the 1 Is it A or ~A? Highlight the column that contains the 1 Is it B or ~B? Write down your two variables and join them with an AND ( ∧ ) 1

2 variable K-Map Try working backwards! Starting with the K-Map, interpret the results and write an expression Highlight the row that contains the 1 Is it A or ~A? Highlight the column that contains the 1 Is it B or ~B? Write down your two variables and join them with an AND ( ∧ ) 1

3 variable K-Map In a 3 variable K-Map, we need to accommodate 8 possible combinations of A, B and C We’ll start by figuring out the ‘address’ for each position (A, B, C) (0,0,0)(0,0,1) (0,1,0)(0,1,1) (1,1,0)(1,1,1) (1,0,0)(1,0,1)

3 variable K-Map If we had a K-Map where the expression was B We would place 1s in every box where B is true We ignore the values of A and C, because they are not written in our expression

3 variable K-Map Create a K-map for the expression: ~A ∧ C Highlight rows where A is false Highlight columns where C is true Place 1s in all the overlapping boxes Note: We can ignore the values of B, because they are not mentioned in the expression

3 variable K-Map To create the K-Map for the expression A ∧ B ∧ ~C Highlight rows where A is true Highlight rows where B is false Highlight columns where C is false Place 1s in all the overlapping boxes 1

3 variable K-Map This time we’ll start with a K-map and find the expression. Identify any groupings (in this case we have a pair) What is the value of A for both items in the pair? What is the value of B for both items in the pair? What is the value of C for both items in the pair? 1111

3 variable K-Map This time we’ll start with a K-map and find the expression. Identify any groupings (in this case we have a pair) What is the value of A for both items in the pair? What is the value of B for both items in the pair? What is the value of C for both items in the pair? Because B is both true and false, it does not affect the answer and can be ignored 1111 ~A ∧ C

3 variable K-Map Determine the expression represented by this K-map Identify any groupings What is the value of A for both items in the pair? What is the value of B for both items in the pair? What is the value of C for both items in the pair? 1111

3 variable K-Map Working backwards to build an expression Identify any groupings (I see a pair) What is the value of A for both items in the pair? What is the value of B for both items in the pair? What is the value of C for both items in the pair? Because A is both true and false, it does not affect the answer and can be ignored This leaves: 1111 B ∧ ~C

3 variable K-Map Determine the expression represented by this K-map Identify any groupings (I see two pairs) What is the value of A for both items in the first pair? What is the value of B for both items in the first pair? What is the value of C for both items in the first pair? First Pair: What is the value of A for both items in the second pair? What is the value of B for both items in the second pair? What is the value of C for both items in the second pair? Second Pair: Put brackets around each pair and combine them with an OR

3 variable K-Map Determine the expression represented by this K-map Identify any groupings (I see two pairs) What is the value of A for both items in the first pair? What is the value of B for both items in the first pair? What is the value of C for both items in the first pair? First Pair: ~A ∧ ~B What is the value of A for both items in the second pair? What is the value of B for both items in the second pair? What is the value of C for both items in the second pair? Second Pair: A ∧ ~C Put brackets around each pair and combine them with an OR (~A ∧ ~B) ∨ (A ∧ ~C)

3 variable K-Map Working backwards to build an expression Identify any groupings (I see two pairs) What are the value of A, B, C values for the first pair? What are the value of A, B, C values for the second pair? First Pair: Second Pair: Put brackets around each pair and combine them with an OR

3 variable K-Map Working backwards to build an expression Identify any groupings (I see two pairs) What are the value of A, B, C values for the first pair? What are the value of A, B, C values for the second pair? First Pair: ~A ∧ ~C Second Pair: C ∧ B Put brackets around each pair and combine them with an OR (~A ∧ ~C) ∨ (C ∧ B)

3 variable K-Map Working backwards to build an expression Identify any groupings (I see two pairs) When I look more closely, I can see they are both ~B, so perhaps I can view it as a group of 4 What are the value of A, B, C values for the group? 1

3 variable K-Map Working backwards to build an expression Identify any groupings (I see two pairs) When I look more closely, I can see they are both ~B, so perhaps I can view it as a group of 4 What are the value of A, B, C values for the group? A is both true and false, so it can be ignored B is false C is both true and false, so it can be ignored This leaves: ~B 1

K-Map Notes Some notes to add at this point: Groupings can only be exact binary values: 1, 2, 4, 8 You cannot have a groupings of 3 Groups can overlap The bigger the groupings, the simpler the resulting expression/circuit When converting from a truth table to a K-Map, simply use the values in the TT to find the position values within the K-Map

4 variable K-Map In a 4 variable K-Map, we need to accommodate 16 possible combinations of A, B, C and D We’ll start by figuring out what the ‘address’ for each position (A, B, C, D) (0,0,0,0) (0,0,0,1) (0,0,1,1) (0,0,1,0) (0,1,0,0) (0,1,0,1) (0,1,1,1) (0,1,1,0) (1,1,0,0) (1,1,0,1) (1,1,1,1) (1,1,1,0) (1,0,0,0) (1,0,0,1) (1,0,1,1) (1,0,1,0)

4 variable K-Map If we had a K-Map where the expression was D We would place 1s in every box where D is true We ignore the values of A, B and C, because they are not written in our expression 1

4 variable K-Map If we had a K-Map where the expression was: A ∧ ~B ∧ ~C ∧ ~D We would highlight the Rows where A is true Rows where B is false Columns where C is false Columns where D is false place 1s in all the overlapping boxes (When you have all 4 variables in your expression, it will only result in a single value in the K-Map) 1

4 variable K-Map If we had a K-Map where the expression was: (A ∧ D) We highlight the: Rows where A is true Columns where D is true Put 1s in all overlapping boxes 1

4 variable K-Map If we had a K-Map where the expression was: (A ∧ B) ∨ (B ∧ C ∧ ~D) We would work with one pair at a time. For each part of the expression: Identify the overlapping boxes Place 1s in them We have resulted in a: Group of 4 Pair 1 1 1

4 variable K-Map Working backwards Identify any groupings (I see a group of 4) What is the value of A for the items in the group? What is the value of B for the items in the group? What is the value of C for the items in the group? What is the value of D for the items in the group? 1 1

4 variable K-Map Working backwards Identify any groupings (I see a group of 4) What is the value of A for the items in the group? False What is the value of B for the items in the group? False What is the value of C for the items in the group? True/False What is the value of D for the items in the group? True/False ~A ∧ ~B 1 1

4 variable K-Map Working backwards Identify any groupings (I see a group of 4 and a pair) What are the values of A, B, C and D for the group? What are the values of A, B, C and D for the pair? Solution

4 variable K-Map Working backwards Identify any groupings (I see a group of 4 and a pair) What are the values of A, B, C and D for the group? (C ∧ ~D) What are the values of A, B, C and D for the pair? (A ∧ B ∧ ~C) Solution: (C ∧ ~D) ∨ (A ∧ B ∧ ~C)

K-Maps & Truth Tables Often we are asked to write an expression based on a truth table, this can result in pretty complicated expressions that require simplification using logic laws Using a K-Map can aid the simplification process

K-Maps & Truth Tables Let’s start with a Truth Table To build an expression we would normally write an expression (using AND’s) for each row resulting in true and combine those with ORs This produces a really big expression that will be difficult to simplify using the logic laws ABCSolution (~A ∧ ~B ∧ C) ∨ (~A ∧ B ∧ C) ∨ (A ∧ ~B ∧ C) ∨ (A ∧ B ∧ ~C) ∨ (A ∧ B ∧ C)

K-Maps & Truth Tables Rather than converting straight to an expression, let’s try placing the values in a Karnaugh Map. Place 1s in the appropriate positions, according to the Truth Table This highlights a group of 4 and a pair From this we can write a simpler expression ABCSolution

K-Maps & Truth Tables Rather than converting straight to an expression, let’s try placing the values in a Karnaugh Map. Place 1s in the appropriate positions, according to the Truth Table This highlights a group of 4 and a pair From this we can write a simpler expression ABCSolution C ∨ (A ∧ B)

Practise, Practise, Practise The best way to learn how to work with K-Maps, is to apply your new knowledge to some Karnaugh Maps worksheets