Lecture 2 Electronics ndreas Electronics oolean algebra and optimizing logic functions TF322 - Electronics Fundamentals ugust 24 Exercise ndreas ern University of pplied Sciences Rev. 946f32 2. of oolean lgebra We have seen that digital logic forms an algebra; the boolean algebra s each algebra, the boolean algebra has properties, we will review them quickly and without proof Elementary properties:. = 2. += 3. = bsorbtion properties:. (+)= 2. +( )= onstant properties:. = 2. = 3. += 4. += 5. = 6. = Electronics ndreas Exercise Rev. 946f32 2.2 of oolean lgebra omplement properties:. = 2. += 3. = 4. = ommutative properties:. = 2. +=+ 3. = Distributive properties:. (+)=( )+( ) 2. +( )=(+) (+) 3. ( )=( ) ( ) ssociative properties: ( )=( ) +(+)=(+)+ ( )=( ) Electronics ndreas Exercise Rev. 946f32 2.3
Exercise Show that =, using: a) truthtable. b) oolean algebra. Solution: We know that the XOR is defined by: = Electronics ndreas a) Truthtable = =. The truthtable for the XOR. 2. We take =. 3. We see directly that =. b) oolean algebra. =. 2. We rewrite the function in it s equivalent form. 3. = +. 4. We take =. 5. = +. 6. = +. 7. =. Exercise Rev. 946f32 2.4 Exercise Show that ( ) ( ) ( ) using oolean algebra: Solution:. We start with the left function: ( ). 2. Using the definition: D E = D E+D E. 3. Hence: ( ) = +.. Now we take the right function: ( ) ( ). 2. Using the definition: D E = D E + D E. 3. Gives us: ( + ) ( + ) 4. Multiplying it out gives: + + +. 5. Hence: ( ) ( ) = + nd: + + (Hint: make a truthtable). Electronics ndreas Exercise Rev. 946f32 2.5 of oolean lgebra The theorems of ugust de Morgan (86-87): = + Electronics ndreas NND gate + = NOR gate Exercise De Morgen postulated two theorems. We can draw the gate-equivalent. The NOT gates can be merged. nd the same for the second theorem. Rev. 946f32 2.6
of De Morgan (cont.) The theorems of ugust de Morgan (86-87): = + Electronics ndreas + = The theorems of De Morgan are very important as they show: ny logic expression can be formulated with only OR and NOT ny logic expression can be formulated with only ND and NOT Exercise Rev. 946f32 2.7 of De Morgan (Example) = + + Enumerating all terms for which = (minterms) leads to a sum of 7 products! etter: Enumerate all terms for which = (maxterms) and use De Morgan Electronics ndreas Exercise Rev. 946f32 2.8 of De Morgan (Example 2) = + + ( ) ( ) ( ) ( ) ( ) ( ) + + + + + + ( ) ( ) + + + + + + ( ) + + Electronics ndreas Exercise logic equation can be formulated in the disjunct form; this form is also called sum of products logic equation can be formulated in the conjunct form; this form is also called product of sums Rev. 946f32 2.9
of De Morgan (Example 2 gate) = Electronics ndreas + + ( ) ( ) ( ) * * ( ) ( ) ( ) + + + + + + + + ( ) ( ) ( ) + + + + + + + + + + Exercise + + + + + + + + Rev. 946f32 2. Optimizing Logic Functions = + Electronics ndreas The disjunct form does not always provide the smallest equation For this simple example, it can be seen in the truth table, but what about equations with five inputs? We can use the graphic optimizing method of Karnaugh, the Karnaugh diagram y selecting all groups of 2 m s we can eliminate variables: = Exercise Rev. 946f32 2. The Karnaugh diagram Electronics ndreas nd we can continue for 4+ variables Exercise Rev. 946f32 2.2
Optimizing Logic Functions with three Variables = + Electronics ndreas Exercise We start selecting the biggest group of s (minterms) We continue until all minterms are selected Rev. 946f32 2.3 Valid Karnaugh groups What is a valid group? In the Karnaugh diagram below we have a group of four minterms. We have 2 m minterms with m=2. = + + + = ( + + + ) = ( ( + ) + ( + )) = (( + ) ( + )) = (() ()) We can put outside of the brackets; the variable is important for this group! We can also put and outside brackets. s easily can be seen: there are exactly 2 m- minterms in the area where = and the other 2 m- minterms are in the area where = Finally we play with ( + ). oth and are don t care for this group as ( + ) = and ( + ) =! Electronics ndreas Exercise Rev. 946f32 2.4 Valid Karnaugh groups Hence we have a valid group when:. The group has exactly 2 m minterms or 2 m maxterms. 2. The group has exactly m-variables don t care. variable E is don t care when:. There are exactly 2 m- minterms/maxterms from the group in the region where E=. 2. There are exactly 2 m- minterms/maxterms from the group in the region where E= (E-region). variable F influences the function when either:. ll 2 m minterms/maxterms from the group are in the region where F=. 2. ll 2 m minterms/maxterms from the group are in the region where F= (F-region). ll m-variables have to be checked for the above rules. ny violation of the above rules renders the group invalid! Electronics ndreas Exercise Rev. 946f32 2.5
Valid Karnaugh groups Homework Given the group in the Karnaugh diagram below. Electronics ndreas Exercise Is this a valid group? Rev. 946f32 2.6 Optimizing Logic Functions with four Variables = + D D = + D D We start again with the biggest groups of minterms This group is redundant, as it is included in the other two! We are done We can also start with the biggest groups of maxterms This group is redundant, as it is included in the other two! We are done Electronics ndreas Exercise Homework: Show with boolean algebra that both functions are identical; what can you observe? Rev. 946f32 2.7 Incomplete Defined Functions = + D D We start again with the biggest groups of minterms When assuming a for the don t care we can find a group of 8! We continue until all s are covered We are done In mathematics logic functions are always completely defined: for each of the input combinations the function is always either or In practice a logic function can have input combinations where we as designer do not mind the outcome: the function is defined and shows one or multiple don t cares Electronics ndreas Exercise Rev. 946f32 2.8