Copyright © 2007-2013 Curt Hill Minimization Arbitrary Truth Table to Minimal Function.

Slides:



Advertisements
Similar presentations
BOOLEAN ALGEBRA. A Mathematical notation used to represent the function of the Digital circuit. A notation that allows variables & constants to have only.
Advertisements

Digital Circuits.
ECE 238L Computer Logic Design Spring 2010
Cosc 2150: Computer Organization Chapter 3: Boolean Algebra and Digital Logic.
Boolean Algebra and Combinational Logic
Karnaugh Maps for Simplification
Copyright © Cengage Learning. All rights reserved. CHAPTER 2 THE LOGIC OF COMPOUND STATEMENTS THE LOGIC OF COMPOUND STATEMENTS.
Lecture 3. Boolean Algebra, Logic Gates
Chapter 2: Combinatorial Logic Circuits Illustration Pg. 32 Logic Circuit Diagrams - Circuit Optimization -2,3,4 level maps 48 elements Optimized to 25.
Propositional Calculus Math Foundations of Computer Science.
IKI a-Simplification of Boolean Functions Bobby Nazief Semester-I The materials on these slides are adopted from those in CS231’s Lecture.
Computer Programming Skills Revision Prepared by: Ghader Kurdi.
PHY 201 (Blum)1 Karnaugh Maps References: Chapters 4 and 5 in Digital Principles (Tokheim) Chapter 3 in Introduction to Digital Systems (Palmer and Perlman)
Logic Gates Circuits to manipulate 0’s and 1’s. 0’s and 1’s used for numbers Also to make decisions within the computer. In that context, 1 corresponds.
11.1 Boolean Functions. Boolean Algebra An algebra is a set with one or more operations defined on it. A boolean algebra has three main operations, and,
Matrices Square is Good! Copyright © 2014 Curt Hill.
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
Boolean Algebra – the ‘Lingua Franca’ of the Digital World The goal of developing an automata is based on the following (loosely described) ‘ideal’: if.
Copyright © Curt Hill Truth Tables A way to show Boolean Operations.
Copyright © Curt Hill Using Propositional Logic Several applications.
Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.
1 Digital Logic Design Week 5 Simplifying logic expressions.
1 Boolean Algebra & Logic Gates. 2 Objectives Understand the relationship between Boolean logic and digital computer circuits. Learn how to design simple.
CS1Q Computer Systems Lecture 6 Simon Gay. Lecture 6CS1Q Computer Systems - Simon Gay2 Algebraic Notation Writing AND, OR, NOT etc. is long-winded and.
Karnaugh Maps References:
1 © 2015 B. Wilkinson Modification date: January 1, 2015 Designing combinational circuits Logic circuits whose outputs are dependent upon the values placed.
Chapter 3: Digital Logic Dr Mohamed Menacer Taibah University
PRASAD A. PAWASKAR SPN. NO DETE 2 SEMESTER lec1-11.
Chapter 2 Two- Level Combinational Logic. Chapter Overview Logic Functions and Switches Not, AND, OR, NAND, NOR, XOR, XNOR Gate Logic Laws and Theorems.
Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and
LOGIC GATES & BOOLEAN ALGEBRA
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.
XOR Operator A short digression… … to introduce another Boolean operation: exclusive- OR (XOR) ABA + B XOR.
Karnaugh Maps (K-Maps)
CS231 Boolean Algebra1 Summary so far So far: – A bunch of Boolean algebra trickery for simplifying expressions and circuits – The algebra guarantees us.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
CS1Q Computer Systems Lecture 6 Simon Gay. Lecture 6CS1Q Computer Systems - Simon Gay2 Algebraic Notation Writing AND, OR, NOT etc. is long-winded and.
Sum-of-Products (SOP)
Chapter 3 Special Section Focus on Karnaugh Maps.
Karnaugh Map and Circuit Design.
June 12, 2002© Howard Huang1 Karnaugh maps Last time we saw applications of Boolean logic to circuit design. – The basic Boolean operations are.
BOOLEAN ALGEBRA AND LOGIC SIMPLIFICATION
Revision Mid 1 Prof. Sin-Min Lee Department of Computer Science.
BOOLEAN ALGEBRA LOGIC GATES. Introduction British mathematician George Boole( ) was successful in finding the link between logic and mathematics.
Logic Simplification-Using Boolean Laws Logic Design Laboratory EE 2121 Lectures By Manesh T EE2121-In Charge
Chapter 3 Boolean Algebra and Digital Logic T103: Computer architecture, logic and information processing.
Boolean Algebra and Computer Logic Mathematical Structures for Computer Science Chapter 7 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Boolean Logic.
CS231 Boolean Algebra1 Circuit analysis summary After finding the circuit inputs and outputs, you can come up with either an expression or a truth table.
Mu.com.lec 9. Overview Gates, latches, memories and other logic components are used to design computer systems and their subsystems Good understanding.
CHAPTER 3 Simplification of Boolean Functions
Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and
ECE 2110: Introduction to Digital Systems
Computer Organisation
ECE 3110: Introduction to Digital Systems
Boolean Algebra and Combinational Logic
Circuit analysis summary
Lecture 3 Gunjeet Kaur Dronacharya Group of Institutions
Karnaugh Maps References:
BASIC & COMBINATIONAL LOGIC CIRCUIT
Karnaugh Maps Topics covered in this presentation: Karnaugh Maps
Functions Computers take inputs and produce outputs, just like functions in math! Mathematical functions can be expressed in two ways: We can represent.
ECB2212-Digital Electronics Boolean algebra
Dr. Clincy Professor of CS
From now on: Combinatorial Circuits:
Chapter 3 Special Section
Karnaugh maps Last time we saw applications of Boolean logic to circuit design. The basic Boolean operations are AND, OR and NOT. These operations can.
Copyright © Cengage Learning. All rights reserved.
Circuit Simplification and
Presentation transcript:

Copyright © Curt Hill Minimization Arbitrary Truth Table to Minimal Function

Copyright © Curt Hill Introduction In the last half of the twentieth century logic had a new use: –Construction of digital computers Engineers become involved where only mathematicians had been before Every form of mathematics is useful in practical matters –The use has not always been discovered –Logic is discovered for computing

Copyright © Curt Hill Adequacy Example The whole notion of adequacy was worked out by logicians in the early part of the century In the latter part of the century some computer companies stocked only NAND gates –Because with this one gate made any logic function possible –Even a computer, which is a very complicated function Some did use NORs instead

Copyright © Curt Hill Approach This is an engineering sort of approach The object is that we have a series of Boolean variables that we wish to manipulate in some way Usually we want to find the minimal gate sequence that we can use to implement

Copyright © Curt Hill Goal Three steps –We start with an arbitrary truth table –Next we generate the function for it –Finally we minimize that function The first step is done based on the logic function we need –Such as an adder Recall the second step

Copyright © Curt Hill Function Generation Take any truth table with N variables Consider the result column For each column with a true –Combine all the variables with conjunctions –Those that are true remain unchanged –Those that are false are negated Each column that is false is ignored Combine all of these expressions with disjunctions

Copyright © Curt Hill Example p q T T T T F F F F T T T F p  q  p  q p   q (p  q)  (  p  q)  ( p   q)

Copyright © Curt Hill The Problem We have a simple operator and we produced a very large expression Thus p  q May be replaced by: (p  q)  (  p  q)  ( p   q) This is no bargain Thus we need to minimize this for economic reasons

Copyright © Curt Hill Minimization If each And/Or/Not may be implemented by a single gate We want to minimize the number of gates we need to implement the function Here we are not proving that one is equivalent to another Instead we are finding the minimized equivalent

Copyright © Curt Hill Notation In theorems we have used a notation that involves special symbols for And Or etc The engineers cannot leave well enough alone They typically use yet another new notation Mathematicians do their work on paper or blackboard Engineers need something both precise and easy to reproduce

Copyright © Curt Hill New Notation And is represented as a multiply –Like multiplication symbol omitted Or as an add Negation is usually a bar over the top or an accent that follows Zeros represent falses, ones trues So the expression (p   q)  (s  r) becomes pq’ + sr or p ǭ + sr

Copyright © Curt Hill Precedence is different as well In the axiomatic approach Conjunction and Disjunction have the same precedence –So we always parenthesize them when they are together Here And has higher precedence than Or –Just as multiply has higher precedence than addition

Copyright © Curt Hill Numbering Since binary is a perfectly fine number system we can also represent rows by their binary numeric value Thus row x = 1, y = 0, z = 1 is 5 –101 in binary is 5 Because of this engineers are more likely to have the first row as all falses, which becomes 0

Copyright © Curt Hill Example p q pq p’q pq’ The trues are {1,2,3}

Copyright © Curt Hill Normal Forms A normal form is a standard way to write an expression or equation –You may recall slope intercept form of the linear equation or standard form for a polynomial Two common ones in this context are: Disjunctive Normal Form Conjunctive Normal Form

Copyright © Curt Hill Disjunctive normal form A form that we may use in minimization Each expression is a series of terms connected by disjunctions Each term is a product of conjunctions No parentheses are needed Also known as sum of products because the AND corresponds to multiply and OR to addition

Copyright © Curt Hill Example This is the form we get from the process described earlier In old notation: (p  q)  (  p  q)  ( p   q) In new notation: pq + p’q + pq’ This is Disjunctive normal form

Copyright © Curt Hill Conjunctive normal form Each term is a series of disjunctions These are parenthesized and result uses conjunctions to connect This is also known as product of sums form For example: (p+q)(q+r’)(p’+q’+r’) which is same as (p  q)  (q   r)  (  p   q   r)

Copyright © Curt Hill Another process There is also a way to get conjunctive normal form out of an arbitrary truth table Here you find each false in result column Compose a sum of each false in the operand columns Use conjunction to connect all of these sums

Copyright © Curt Hill First Example p q (p’+q) or  p  q

Copyright © Curt Hill Second Example p q  p   q or (p’+q’) p  q or (p+q) (  p   q)  (p  q) or (p’+q’) (p+q)

Copyright © Curt Hill Minimization Once we have an expression we then want to minimize One of the tools to solve this kind of problem is a Karnaugh map A Karnaugh map is a modified truth table that makes simplification easier Once in the Karnaugh map, adjacent rectangular areas are subject to minimization

Copyright © Curt Hill What it does The point of a Karnaugh map is to make obvious two expressions that have the form: –xyz or xy’z These two terms are the same except for the negation of y We can rearrange that to xz(y + y’) With the law of excluded middle and true as the unit of conjunction we get xz

Copyright © Curt Hill Truth Tables Truth tables only show this when it is the rightmost variable that changes Other variables tend not to be near the corresponding expression that is similar except for a single negated variable Consider the following:

Copyright © Curt Hill Example: {0,1,3,5,7} xyzf 0001X’Y’Z’ 0011X’Y’Z X’YZ XY’Z XYZ

Copyright © Curt Hill Discussion It is easy to see x’y’z and x’y’z’ may be minimized What is not so easy is that xyz and x’yz may be minimized –They are not close to one another A Karnaugh map makes this easier by forcing adjacent squares to only have one difference

Copyright © Curt Hill Karnaugh maps Arrange the values in a rectangle of 8 slots for three variables and a square of 16 slots for four The numbering of the rows and columns is peculiar Not numbered sequentially Numbered so that only one bit changes at a time

Copyright © Curt Hill Example: {0,1,3,5,7} xyzf 0001X’Y’Z’ 0011X’Y’Z X’YZ XY’Z XYZ

Copyright © Curt Hill Example as Karnaugh Map X YZ = 0Z =

Copyright © Curt Hill Discussion Notice the odd numbering of the rows –Change only one position at a time Any numbering will work as long as only one bit changes at a time –Thus adjacent cells have all but one bit the same A Karnaugh map wraps left to right and top to bottom A group of three is two different minimizations with a leftover

Copyright © Curt Hill Process Create the numbered rectangle Mark only the true squares with ones Wherever there are adjacent slots of ones that means that you have something like pqr or pqr’ which means the r can be eliminated from the expression

Copyright © Curt Hill The minimization Look for rectangles where a side is a power of two It does not matter if the rectangles overlap, because of idempotency –Often you get one minimization or the other

Copyright © Curt Hill Example Truth Table contains {2,6,8,9,12,13} Draw the truth table Calculate the disjunctive normal form Now draw the Karnaugh Map Circle the adjacent items Eliminate those variables that can be eliminated to combine expressions

Copyright © Curt Hill Truth Table: {2,6,8,9,12,13} wxyz wxyz

Copyright © Curt Hill Disjunctive normal form wxyz wxyz w’x’yz’+ w’xyz’+ wx’y’z’+ wx’y’z+ wxy’z’+ wxy’z

Copyright © Curt Hill Karnaugh Map {2,6,8,9,12,13} W X /Y Z

Copyright © Curt Hill Adjacents W X /Y Z

Copyright © Curt Hill Elimination W X /Y Z w’yz’ + wy’

Copyright © Curt Hill Example 2: Truth table contains: {1,4,6,9,12,14} This should reduce to two terms

Copyright © Curt Hill Truth Table: {1,4,6,9,12,14} wxyz wxyz

Copyright © Curt Hill Disjunctive normal form w’x’y’z+ w’xy’z’+w’xyz’+ wx’y’z+ wxy’z’+ wxyz’ wxyz wxyz

Copyright © Curt Hill Karnaugh Map {1,4,6,9,12,14} W X /Y Z

Copyright © Curt Hill Adjacents {1,4,6,9,12,14} W X /Y Z

Copyright © Curt Hill Elimination {1,4,6,9,12,14} W X /Y Z xz’ + x’y’z

Copyright © Curt Hill One More Example Consider the truth table with the following values {0,4,5,7,8,9,13,15} There are at least two different coverings for this

Copyright © Curt Hill Truth Table:{0,4,5,7,8,9,13,15} wxyz wxyz

Copyright © Curt Hill Disjunctive Normal Form wxyz wxyz w’x’y’z’ + w’xy’z’ + w’xy’z + w’xyz + wx’y’z’ + wxyz’ + wxy’z + wxyz

Copyright © Curt Hill Map {0,4,5,7,8,9,13,15} W X /Y Z

Copyright © Curt Hill Adjacents (1) W X /Y Z x’y’z’ + w’xy’ + wy’z + xz

Copyright © Curt Hill Adjacents (2) W X /Y Z w’y’z’ + wx’y’ + xz

Copyright © Curt Hill Notes There are two separate ways to cover this –x’y’z’ + w’xy’ + wy’z + xz –w’y’z’ + wx’y’ + xz The second is the unique minimum

Copyright © Curt Hill Larger maps Karnaugh maps are fairly easy with fewer than five variables since they are either squares or rectangles It gets complicated when five or more variables are used These need to be more than two dimensional Five is a three dimensional rectanguloid The dimensions are 4, 4, 2

Copyright © Curt Hill Continued Usually written as two adjacent squares Identical values in the two squares are now adjacent and minimizable Six is a cube with dimensions 4, 4, 4 Usually written with four squares of 4 by 4 Adjacent values are those that are the same up and down and right and left

Copyright © Curt Hill Five Variable Map WX/YZ WX/YZ V = 0 V = 1 x’y’z’ + v’xz + vw’yz’ + wx’y’z

Copyright © Curt Hill Computer You can see why computer minimization is helpful at this and higher levels There are numerous computer programs that allow you to do this –An applet is on the web site However do not use them for the exercise