110 likes | 133 Views
Discrete Mathematics CS 2610. February 19, 2009. X. X+Y. Y. Logic Gates: the basic elements of circuits. Electronic circuits consist of so-called gates connected by wires. x. x. Inverter (NOT gate ). OR gate. x. xy. AND gate. y. Half Adder. x. y. sum. carry. Full Adder.
E N D
Discrete Mathematics CS 2610 February 19, 2009
X X+Y Y Logic Gates: the basic elements of circuits • Electronic circuits consist of so-called gates connected by wires x x Inverter (NOT gate) OR gate x xy AND gate y
Half Adder x y sum carry
Full Adder sum Half Adder Carry in x Half Adder Carry out y
Add Three Bits x0 Half Adder s0 y0 c0 Full Adder s1 x1 y1 c1 s2 Full Adder x2 y2 c2=s3
Circuit Minimization • We have seen that a function can be represented by many different equivalent expressions • Before building our circuit, we want to find a simple expression for the function • When building circuits, we want to use the minimum possible number of gates (why?) • For example, instead of xyz + xyz, we can use xz • How do we find the minimum expression?
Adjacent Minterms • To minimize circuits, start by writing your function in DNF (sum of products) • Two minterms are adjacent if they differ by one variable, which is negated in one minterm and not negated in another • The sum of two adjacent minterms is equivalent to the single term that results when this variable is removed • E.g., xyz + xyz = xz
Why Adjacent? • We can represent functions by using Karnaugh maps y y x x y x y x x y x y
Example • xy + xy + xy = x + y y y x 1 1 x 1
Three Variable Karnaugh Maps • With the three variables x, y, z, we can let x and x be on the vertical side as before • The table will now have 4 columns: yz, yz, yz, and yz • Order is important! Columns must be adjacent to each other • We also consider the first and last columns to be adjacent • Picture the table as a flattened cylinder • A block of 2 cells cancels out 1 variable • A block of 4 cells cancels out 2 variables • What if we have a block of 8 cells?
3-Variable Example • xyz + xyz + xyz + xyz + xyz = z + xy yz yz yz yz x 1 1 1 1 1 x implicant, prime implicant, essential prime implicant