Reading and construction of logic gates A Boolean function is an expression formed with binary variables, a binary variable can take a value of 1 or 0. Boolean function may be represented as an algebraic expression or in a truth table. The algebraic expression uses binary operators such as AND, OR, NOT and their derivatives such as NAND, NOR and XOR gates. As we saw earlier to represent a function in a truth table, we need a list of 2 n combinations of 1s and 0s of the n binary variables and a column showing the combinations for which the function is either is equal to a 0 or 1. For a function with 2 binary variables for example we have 2 2 (= 4) number of distinct combinations. Consider the following logic function, we will plot a truth table and also implement the function in logic gates. Q = (A.B)+(A.B ) This function has two input variables, A and B. It is constructed by ORing two ANDed terms. At this point we must decide which logic symbols should be used to implement this function. The physical realization of the function can be implemented without simplifying the above function, we can also apply lows of Boolean algebra to try and simplify the function. But for now we will implement the circuit as represented by the logic function given. The circuit thus looks like: Note also that t is possible to derive the Boolean function from a logic circuit diagram such as the one shown above. The Universal gate Combinational circuits are more frequently constructed with a NAND or NOR gates rather than AND or OR gates. NAND and NOR gates are more common from hardware point of view because they are readily available in IC form. The NAND gate is said to be the universal gate because any digital system can be implemented with it. E.g. A = (a ) AB = ((A.B) ) AND gate implemented using NAND gates alone.
A+B = (A.B ) OR gate implemented using NAND gates alone. Simplification of logic circuits As we saw in the previous section, the complexity of the digital circuits that implement a Boolean function is directly related to the complexity of the algebraic expression from which the function is implemented. Boolean function may be simplified in two ways: 1. Algebraic simplification 2. Karnaugh method Boolean simplification (Algebraic simplification) Here minimization is carried out by following specific Boolean logic rules. The Boolean expression below can be simplified as follows: A. Q = (A.B.C)+A.(B +C ) = A(B.C+B +C ) = A(B.C+(B.C) ) = A(1) = A We can see that the circuit implementation will be much more simplified. Worked Example: Show that the logic expression Q = A.C.D+A.B.D+A.C.D+A.B.D can be simplified to D.(C+B). Give logic a diagram. Q = A.C.D+A.B.D+A.C.D+A.B.D = A D(C+B) +AD(C+B) =D(C+B)(A +A) =D(C+B)(1) =D(C+B)
Karnaugh map (K-map) method Algebraic Boolean simplification lacks specific rules to predict each succeeding step in the manipulation. The K-map method provides a simple procedure for minimizing Boolean functions. The K-map is a diagram made up of squares. Since a Boolean expression can be represented as a sum of miniterms, each square on the map represents one miniterm. By recognizing various patterns, we can derive simplified algebraic expressions for the same function. The most common algebraic expression used here are SUM OF PRODUCTS( SOP) or PRODUCT OF SUMS (POS). Sum of products (SOP) The construction of the K-map is such that it consists of 2 n squares, where n is the number of variables in the logic expression. Each square represents a miniterm. The 0 s and 1 s marked for each row and each column designate the posible values of the input variables. Example: Q = A.B and Q = A+B can be put into a k-map as shown below. There are two variables, thus we need a map with 4 squares. Example: Q = A BC +BCD. This expresion has 4 variables, thus the k map wil have 16 squares signifying the 16 possible binary input combinations as shown below.
. Note that the miniterms are arranged not in binary order, the characteristic of the sequence is that only one bit changes from 1 to 0 or 0 to 1. Worked Example: Simplify the Boolean function: Q = A BC+A BC +AB C +AB C First we note that we have three variables in the function, thus we need 8 squares in the map. Then 1 is marked in each square which corresponds to the above miniters and 0 in the remaining squares. The function is thus represented by the area containing four squares. These are indicated in the map circled enclosing the two 1 s.(adjacent squares of 1 are circled). The circle on the left side represents A B and the circle on the right represents AB. Note that we consider the variables that do not change states within the circle of two squares. Thus the simplified function is the sum of these two products: Q = A B+AB Worked Example: Simplify the Boolean function: Q = A BC +AB C +ABC+ABC As shown below, there are four squares with 1 s, i.e. one for each miniterm in the function. Note that the empty squares contain zeros. Two adjacent circles are combined to give the two miniterms in the final simplified function as shown below. terms are ci
MODULE EE1420 Worked Example: Simplify the Boolean function: Q = A C +A B + AB C+BC We have three variables, thus need 8 squares. We also notice that some of the terms in the function have less than three literals and are represented by more than one square. Eample to represent BC, we put 1 s in squares with miniters 111 and 011. It is also posible that two terms could be marked by just one 1 swhere the terms coincide. Product of Sums (POS) The minimized terms we have looked so far were expressed in the sum of products (SOP). We can also represent the same function as product of sums. The 1 s placed in the squares represent theminiterms of the function. The miniterms not included in the function (squares of 0 s) denote complement of the function. Thus if we combine the squares of 0 s into valied adjacent squares, we obtain the simplified expresion of the function s complement.by inverting the complement function, we can obtain out original function. Worked example: Simplify the logic function in the above worked example as POS. Q = A C +A B + AB C+BC
To Summarize: Each square in the Karnaugh map corresponds to a line in the truth table The coordinates of a square that contains a 1 corresponds to a miniterm in a Boolean expression A rectangular cluster of squares corresponds to a product term in a simplified Boolean expression. Practical Example: Designing a 7 Segment Display A seven segment display is used to display readable numbers using 7 illuminated segments such as those used in calculators, voltmeters digital clocks and so on. The seven segments are commonly labeled as a, b, c, d, e, f and g as shown in the figure below, which can be separately illuminated to form a recognizable denary numbers. For example to form 1 it is only necesary to iluminate b and c, to display 5, a, c, d, f, and g should be illuminated. Decimal Binary Segments A B C D a b c d e f g 0 0 0 0 0 1 1 1 1 1 1 0 1 0 0 0 1 0 1 1 0 0 0 0 2 0 0 1 0 1 1 0 1 1 0 1 3 0 0 1 1 1 1 1 1 0 0 1 4 0 1 0 0 0 1 1 0 0 1 1 5 0 1 0 1 1 0 1 1 0 1 1 6 0 1 1 0 1 0 1 1 1 1 1 7 0 1 1 1 1 1 1 0 0 0 0 8 1 0 0 0 1 1 1 1 1 1 1 9 1 0 0 1 1 1 1 1 0 1 1 10-15 X X X X X X X Truth Table
MODULE EE1420 Example: Design a logic circuit to implement a seven-segment driver to illuminate segment a. Solution: From the above truth table where the inputs are A,B,C and D with segment a as an output we can simplify the resulting logic with the use of Karnagh map. AB 0 0 0 1 1 1 1 0 CD 0 0 1 0 X 1 0 1 0 1 X 1 1 1 1 1 X X 1 0 1 1 X X