Simplification of Boolean Functions Contents: Why simplification? The Map Method Two, Three, Four and Five variable Maps. Simplification of two, three, four and five variable Boolean function by Map method. Product of sums and Sum of products simplification. NAND and NOR implementation. Course Instructor Mohammed Abdul kader Assistant Professor, EEE, IIUC
The complexity of the digital logic gates that implement a Boolean function is directly related to the complexity of the algebraic expression from which the function is implemented. Simplification of Boolean Functions 110101 101010 Although the truth table representation of a function is unique but the algebraic expression appears in many different form. Before implementation of logic circuit, the choice of simplest boolean expression from different representation results the minimum number of gates and less complexity in the digital circuit. There are different ways of simplification of Boolean function. In this section we will discuss the Map Method of simplifying Boolean function. 2
The map method provides a simple straight forward procedure for minimizing Boolean functions. The map method, first proposed by Veitch and slightly modified by Karnaugh, is also known as the Veitch diagram or the Karnaugh map. Karnaugh maps provide an alternative way of simplifying logic circuits. Instead of using Boolean algebra simplification techniques, you can transfer logic values froma Boolean statement or a truth table into a Karnaugh map. The arrangement of 0's and 1's with in the map helps you to visualize the logic relationships between the variables and leads directly to a simplified Boolean statement. The Map Method 110101 101010 3
Two Variable Map 110101 101010 There are four minterms for two variables; hence the map consists of fours quares, one of each minterm. Representation of functions in two variable map. 4 F=xy F=x+y = x y+xy +xy = m1+ m2 + m3
Three Variable Map 110101 101010 There are eight minterms for three variables, i.e. the map consist of eight squares. Minterms are not arranged in binary sequence but in a sequence similar to gray code/reflected code. There are four squares where each variable is equal to 1 and four where each is equal to 0. 5
Three Variable Map 110101 101010 Understanding the usefulness of map for simplification of Boolean function Isolated 1 in map F = m1 + m7 = x y z + xyz Adjacent Pair/ 1 s in two adjacent square F = m5 + m7 = xy z + xyz = xz (y +y) = xz 6
Three Variable Map 110101 101010 Understanding the usefulness of map for simplification of Boolean function Adjacent Quad/ 1 s in four adjacent square F = m1 + m3 + m5 + m7 = x y z + x yz+ xy z + xyz = x z (y +y) +xz (y +y) = x z +xz = z (x +x) = z Adjacent Octet/ 1 s in eight adjacent square F = 1 7
Three Variable Map: Examples 110101 101010 Example 3-2: Simplify the Boolean function F= x yz + xy z + xyz + xyz Solution : yz xz So, after simplification, F = yz+ xz 8
Three Variable Map: Examples 110101 101010 Example 3-3: Simplify the Boolean function F= A C+ A B+ AB C+BC Solution : F = A C+ A B+ AB C+BC =A BC+ A B C +A BC+ A BC + AB C+ABC+A BC A B C So, after simplification, F = C+ A B 9
Three Variable Map: Examples 110101 101010 Example 3-4: Simplify the Boolean function F (x,y,z)= (0, 2, 4, 5, 6) Solution : z xy So, after simplification, F = z + xy 10
Four Variable Map 110101 101010 11
Four Variable Map 110101 101010 The map for Boolean function of four binary variables has 16 minterms and the squares assigned to each. The rows and columns are numbered in a reflected code sequence, with only one digit changing value between two adjacent rows and columns. The minterm corresponding to each square can be obtained from the concatenation of the row number with the column number. The combination of adjacent squares that is useful during the simplification process is easily determined from inspection of the four variable map- One square represents one minterm, giving a term of four literals. Two adjacent squares represent a term of three literal. Four adjacent squares represent a term of two literals. Eight adjacent squares represent a term of one literals. Sixteen adjacent squares represent the function equal to 1. wxyz: 1010 (10 in binary), so this square represent m10 12
Four Variable Map: Examples 110101 101010 Example 3-5: Simplify the Boolean function F (x,y,z)= (0, 1,2, 4, 5, 6, 8, 9, 12, 13, 14) Solution : So, after simplification, F = y + w z +x z 13
Four Variable Map: Examples 110101 101010 Example 3-6: Simplify the Boolean function F = A B C +B CD + A BCD +AB C Solution : So, after simplification, F = B D + B C +A C D 14
Five Variable Map 110101 101010 15
Five Variable Map: Examples 110101 101010 Example 3-7: Simplify the Boolean function F (A, B, C, D, E) = (0, 2, 4, 6, 9, 11, 13, 15, 17, 21, 25, 27, 29, 31) Solution : A B E So, after simplification, F = BE+AD E + A B E AD E BE 16
Product of Sums Simplification 110101 101010 All previous examples are in sum-of-products form [F = BE+AD E + A B E ] How to obtain the product-of-sum form * Simplify F in the form of sum of products. [If we mark the empty squares by 0 s and combine them into valid adjacent squares, we obtained a simplified expression of the complement of the function, i.e. of F ] * Apply DeMorgan's theorem F = (F ') * F': sum of products => F : product of sums 17
Example 3-6: Simplify the Boolean function in (a) sum of products and (b) product of sums F (A, B, C, D, E) = (0, 1, 2, 5, 8, 9, 10) Solution : Product of Sums Simplification (Cont.) 110101 101010 (a) Sum of products simplification (b) product of sums simplification 18 F = B D + B C + A C D F = AB + CD + BD So, F = (A +B ) (C +D ) (B + D ) by DeMorgan theorem
Product of Sums Simplification (Cont.) 110101 101010 Gate implementation of the function Example 3-8 Sum of products product of sums (a) F = B D + B C + A C D (b) F = (A +B ) (C +D ) (B + D ) Simplify the Boolean function F(A,B,C,D)=Π(0,1,2,3,4,10,11) 19
Product of Sums Simplification (Cont.) 110101 101010 Example: Simplify the Boolean function F(A,B,C,D)=Π (0,1,2,3,4,10,11) AB CD From Map we get, F = A B + B C + A C D Using DeMorgan theorem- F = (A B + B C + A C D ) = (A + B ) ( B +C ) ( A + C + D ) 20
NAND and NOR Implementation 110101 101010 Why NAND and NOR implementation? Digital circuits are frequently constructed with NAND/NOR rather than with AND/OR gates. NAND and NOR gates are easier to fabricate with electronic components than AND/OR. Cheaper(lower cost) and faster(less delay). Any Boolean function can be constructed using only NAND or only NOR gates. That s why NAND and NOR are known as universal gates. 21
NAND and NOR Implementation 110101 101010 Implementation of basic gates by NAND gate NOT gate by NAND gate x x AND gate by NAND gate x y (xy) ((xy) ) = xy x x OR gate by NAND gate y y (x y ) = x+y 22
NAND and NOR Implementation 110101 101010 Implementation of basic gates by NOR gate NOT gate by NOR gate x x OR gate by NOR gate x y (x+y) ((x+y) ) = x+y x x AND gate by NOR gate y y (x +y ) = xy 23
NAND and NOR Implementation 110101 101010 Two graphic symbols for NAND gate Two graphic symbols for NOR gate 24
NAND Implementation 110101 101010 Implementation F=AB+CD+E by NAND gate only. 25
NAND Implementation 110101 101010 Rules for obtaining the NAND logic diagram from a Boolean function 1. Simplify the function and express it in sum of products. 2. Draw a NAND gate for each product term of the function that has at least two literals. The inputs to each NAND gate are the literals of the term. This constitutes a group of first-level gates. 3. Draw a single NAND gate (using the AND-invert or invert-or graphic symbol) in the second level, with inputs coming from outputs of the 1 st level. 4. A term with a single literal requires an inverter in the first level or may be complemented and applied as an input to the second-level NAND gate. Note: If we simplify the function combining 0 s in a map, we obtain the simplified expression of the complement of the function in sum of product. The complement of the function can then be implemented with two levels of NAND gates using the rules stated above. If the normal output is desired, it would be necessary to insert a one-input NAND gate. 26
NAND Implementation 110101 101010 Example 3-9: Implement the following function with NAND gates F(x,y,z) = (0, 6) 27
NOR Implementation 110101 101010 Implement the function F= (A+B) (C+D) E with NOR gates 28
NOR Implementation 110101 101010 Example 3-9: Implement the following function with NAND gates F(x,y,z) = (0, 6) Sum of Product Product of sums Sum of Product Product of sums 29
30 Don t-care Conditions 110101 101010 You don t always need all 2 n input combinations in an n-variable function. If you can guarantee that certain input combinations never occur. If some outputs aren t used in the rest of the circuit. A four bit decimal code, for example, has six combinations which are not used. Any digital circuit using this code operates under the assumption that these unused combinations will never occur as long as the system is working properly. The unused combinations is known as don t care conditions and can be used on the map to provide further simplification of the boolean expression. It should be realized that a don t care minterm is a combination of variables whose logical value is not specified. It cannot be marked with a 1 or, 0 in the map as it is not specified as 0 or 1. To distinguish the don t care condition from 1 s and 0 s, an X is used. Thus, an X inside a square in the map indicates that we don t care whether the value of 0 or 1 is assigned to F for the particular minterms.
NAND Implementation 110101 101010 Example 3-12: Simplify F(w,x,y,z) = Σ(1,3,7,11,15) which has the don t care conditions d(w,x,y,z) = Σ (0,2,5) 31
NAND Implementation 110101 101010 Exercise. 3-18 : Implement the following function with either NAND or NOR gates. Use only four gates. F = w xz+w yz+x yz +wxy z and d= wyz NAND Implementation yz wx Sum of products: Combine 1 s and some of X s F= x y+xz x x (x y) y F z (x z) 32
NAND Implementation 110101 101010 NOR Implementation wx yz Products of sums: Combine 0 s and some of X s F = x y +xz So, F= (x+y) (x +z) x x (x +z) z F y (x +y ) 33