Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Copyright © 2007-2013 Curt Hill Minimization Arbitrary Truth Table to Minimal Function."— Presentation transcript:

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

2 Copyright © 2007-2013 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

3 Copyright © 2007-2013 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

4 Copyright © 2007-2013 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

5 Copyright © 2007-2013 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

6 Copyright © 2007-2013 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

7 Copyright © 2007-2013 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)

8 Copyright © 2007-2013 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

9 Copyright © 2007-2013 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

10 Copyright © 2007-2013 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

11 Copyright © 2007-2013 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

12 Copyright © 2007-2013 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

13 Copyright © 2007-2013 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

14 Copyright © 2007-2013 Curt Hill Example p q 1 1 1 1 0 0 0 0 1 1 1 0 pq p’q pq’ The trues are {1,2,3}

15 Copyright © 2007-2013 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

16 Copyright © 2007-2013 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

17 Copyright © 2007-2013 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

18 Copyright © 2007-2013 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)

19 Copyright © 2007-2013 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

20 Copyright © 2007-2013 Curt Hill First Example p q 1 1 1 1 0 0 0 0 1 1 1 0 (p’+q) or  p  q

21 Copyright © 2007-2013 Curt Hill Second Example p q 0 0 0 0 1 1 1 1 1 0 1 0  p   q or (p’+q’) p  q or (p+q) (  p   q)  (p  q) or (p’+q’) (p+q)

22 Copyright © 2007-2013 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

23 Copyright © 2007-2013 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

24 Copyright © 2007-2013 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:

25 Copyright © 2007-2013 Curt Hill Example: {0,1,3,5,7} xyzf 0001X’Y’Z’ 0011X’Y’Z 0100 0111X’YZ 1000 1011XY’Z 1100 1111XYZ

26 Copyright © 2007-2013 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

27 Copyright © 2007-2013 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

28 Copyright © 2007-2013 Curt Hill Example: {0,1,3,5,7} xyzf 0001X’Y’Z’ 0011X’Y’Z 0100 0111X’YZ 1000 1011XY’Z 1100 1111XYZ

29 Copyright © 2007-2013 Curt Hill Example as Karnaugh Map X YZ = 0Z = 1 0 11 11 10101 0 11

30 Copyright © 2007-2013 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

31 Copyright © 2007-2013 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

32 Copyright © 2007-2013 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

33 Copyright © 2007-2013 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

34 Copyright © 2007-2013 Curt Hill Truth Table: {2,6,8,9,12,13} wxyz 0000 0001 00101 0011 0100 0101 01101 0111 wxyz 10001 10011 1010 1011 11001 11011 1110 1111

35 Copyright © 2007-2013 Curt Hill Disjunctive normal form wxyz 0000 0001 00101 0011 0100 0101 01101 0111 wxyz 10001 10011 1010 1011 11001 11011 1110 1111 w’x’yz’+ w’xyz’+ wx’y’z’+ wx’y’z+ wxy’z’+ wxy’z

36 Copyright © 2007-2013 Curt Hill Karnaugh Map {2,6,8,9,12,13} W X /Y Z 0 0 1 0 1 1 0 1 0 1 0 11 1 11 1 011

37 Copyright © 2007-2013 Curt Hill Adjacents W X /Y Z 0 0 1 0 1 1 0 1 0 1 0 11 1 11 1 011

38 Copyright © 2007-2013 Curt Hill Elimination W X /Y Z 0 0 1 0 1 1 0 1 0 1 0 11 1 11 1 011 w’yz’ + wy’

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

40 Copyright © 2007-2013 Curt Hill Truth Table: {1,4,6,9,12,14} wxyz 0000 00011 0010 0011 01001 0101 01101 0111 wxyz 1000 10011 1010 1011 11001 1101 11101 1111

41 Copyright © 2007-2013 Curt Hill Disjunctive normal form w’x’y’z+ w’xy’z’+w’xyz’+ wx’y’z+ wxy’z’+ wxyz’ wxyz 0000 00011 0010 0011 01001 0101 01101 0111 wxyz 1000 10011 1010 1011 11001 1101 11101 1111

42 Copyright © 2007-2013 Curt Hill Karnaugh Map {1,4,6,9,12,14} W X /Y Z 0 0 1 0 1 1 0 1 0 1 0 111 1 11 1 01

43 Copyright © 2007-2013 Curt Hill Adjacents {1,4,6,9,12,14} W X /Y Z 0 0 1 0 1 1 0 1 0 1 0 111 1 11 1 01

44 Copyright © 2007-2013 Curt Hill Elimination {1,4,6,9,12,14} W X /Y Z 0 0 1 0 1 1 0 1 0 1 0 111 1 11 1 01 xz’ + x’y’z

45 Copyright © 2007-2013 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

46 Copyright © 2007-2013 Curt Hill Truth Table:{0,4,5,7,8,9,13,15} wxyz 00001 0001 0010 0011 01001 01011 0110 01111 wxyz 10001 10011 1010 1011 1100 11011 1110 11111

47 Copyright © 2007-2013 Curt Hill Disjunctive Normal Form wxyz 00001 0001 0010 0011 01001 01011 0110 01111 wxyz 10001 10011 1010 1011 1100 11011 1110 11111 w’x’y’z’ + w’xy’z’ + w’xy’z + w’xyz + wx’y’z’ + wxyz’ + wxy’z + wxyz

48 Copyright © 2007-2013 Curt Hill Map {0,4,5,7,8,9,13,15} W X /Y Z 0 0 1 0 1 1 0 1 0 1 0 1111 1 11 1 011

49 Copyright © 2007-2013 Curt Hill Adjacents (1) W X /Y Z 0 0 1 0 1 1 0 1 0 1 0 1111 1 11 1 011 x’y’z’ + w’xy’ + wy’z + xz

50 Copyright © 2007-2013 Curt Hill Adjacents (2) W X /Y Z 0 0 1 0 1 1 0 1 0 1 0 1111 1 11 1 011 w’y’z’ + wx’y’ + xz

51 Copyright © 2007-2013 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

52 Copyright © 2007-2013 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

53 Copyright © 2007-2013 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

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

55 Copyright © 2007-2013 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


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

Similar presentations


Ads by Google