Thursday, 19 November 2015 Questions about project and/or labs? Last time: Full adders; Karnaugh maps Today: Karnaugh maps again-- in-class exercise DeMorgan’s Law
Karnaugh Maps Used to design circuits for up to four inputs. Alternate representation of a truth table: c: a b c output 0 1 0 0 0 0 0 0 0,0 0 0 1 0 1 1 0,1 0 1 0 1 a, b: 0 1 1 1 1 1 1,1 1 0 0 1 1 0 1,0 1 0 1 0 1 1 0 1 1 1 1 1
Karnaugh Maps This is the boolean function b + ac c: c: 0 1 0 1 0 0 0 0 0,0 0,0 1 1 1 1 0,1 0,1 a, b: a, b: 1 1 1 1 1,1 1,1 1 0 1 0 1,0 1,0 This block of 1’s represents the This block represents ac -- these expression b -- these are all the places are all the places in the grid where in the grid where b = 1. a = 1 and c = 0.
Karnaugh Maps Cover all the ones with a set of (possibly overlapping) rectangles. Each rectangle must have dimensions that are a power of 2 (e.g., 2x1, 2x2, 4x2, 1x4, etc.). Each rectangle represents one term of the function represented.
Karnaugh Maps c,d: ac + ad + bc + cd 0,0 0,1 1,1 1,0 0 0 1 1 0,0 Note that the box for bc “wraps cd 0 0 1 0 0,1 around” bc a,b: from top to bottom. 1,1 0 1 1 1 ac 1,0 0 1 1 1 ad
Karnaugh Maps c,d: 0,0 0,1 1,1 1,0 The four corners 1 0 0 1 0,0 bd wrap around to form a 2- 0 0 0 0 0,1 ad by-2 a,b: rectangle 1,1 0 1 1 0 1,0 1 1 1 1 ad + bd
Karnaugh Maps In-class Exercise: Find formulas for three different Karnaugh maps. (Solutions will be handed out next week.)
Boolean Algebra So far we have been concerned merely with finding valid expressions for boolean functions. Most of these have been of the following form: (“and-expr”) + (“and-expr”) + … + (“and-expr”) where “and-expr” just indicates an “and” of several variables or their negations. Example: abc + bd + acd
Boolean Algebra Using logic gates, an “or” of “ands” resembles: A final “or” Inputs: gate 0 or more “not” gates Any number of “and” gates
Boolean Algebra But there are many other ways to express a circuit besides an “or” of “ands”. Some of these may require fewer gates (less circuitry). For example, the expression ab + bc (an “or” of “ands”) can be built with two “not” gates, two “and” gates, and an “or” gate. But the equivalent expression b(a+c) requires one fewer “and” gate.
Boolean Algebra Some rules of boolean algebra are listed in Appendix B on page B-6. Some of them look like things from arithmetic, such as “factoring”: a(b+c) = ab + ac The values “0” (false) and “1” (true) behave sort of like arithmetic values zero and 1: 0 + a = a 1a = a
Boolean Algebra However, some of them look different: ab + c = (a+b)(a+c) a + 1 = 1 a + a = 1 aa = 0 One very important law is “DeMorgan’s Law”: a + b = ab ab = a + b
Boolean Algebra We can use Karnaugh maps and DeMorgan’s law to create circuits in an “and of ors” fashion as follows: c: c: 0 1 0 1 0,0 0 0 0,0 1 1 1 1 0 0 0,1 0,1 a, b: a, b: 1 1 0 0 1,1 1,1 (1) Negate the entries in 1 0 0 1 1,0 1,0 the Karnaugh map
Boolean Algebra c: 0 1 1 1 0,0 ab + bc 0 0 0,1 a, b: (2) Find the 0 0 1,1 expression for the 0 1 1,0 negated table
Boolean Algebra (a+b) (b+c) ab + bc (ab) (bc) (3) Negate c: and apply 0 1 DeMorgan’s Law 0 0 0,0 1 1 0,1 a, b: 1 1 1,1 1 0 1,0
Recommend
More recommend