300 likes | 321 Views
This lecture module discusses conjunctive and disjunctive normal forms of boolean expressions and radix conversion techniques. It also covers sum-of-products expansions and functional completeness.
E N D
EEL 3705 / 3705LDigital Logic Design Fall 2006Instructor: Dr. Michael Frank Lecture Module #6: DNF/CNF Forms & Radix Conversion M. Frank, EEL3705 Digital Logic, Spring 2007
Topics for Today (Mon. 1/19) • Administrivia: • Don’t forget, “Reading Assignment #1” is due Tuesday. • Turn in your lab report from lab #1 this week. • Lab #2 due dates have been pushed back 1 week. • Use lab time this week to catch up & get an early start on lab #2. • YOU ARE STILL REQUIRED TO ATTEND THE LAB! • A HW#1 will hopefully be posted shortly! • Homeworks are generally due 1 week after they are assigned. • Today’s Lecture: • Conjunctive and Disjunctive Normal Forms of Boolean Expressions • Common Subexpression Elimination to simplify Logic Synthesis • Radix (Base) Conversion Techniques M. Frank, EEL3705 Digital Logic, Spring 2007
Topic 2.2.1.1.3: DNF and CNF representations M. Frank, EEL3705 Digital Logic, Spring 2007
Representing Boolean Functions • Sum-of-products Expansions • A.k.a. Disjunctive Normal Form (DNF) • Product-of-sums Expansions • A.k.a. Conjunctive Normal Form (CNF) • Functional Completeness • Minimal functionally complete sets of operators. M. Frank, EEL3705 Digital Logic, Spring 2007
Sum-of-Products Expansions • Theorem: Any Boolean function can be represented as a sum of products of variables and their complements. • Proof: By construction from the function’s truth table. For each row that is 1, include a term in the sum that is a product representing the condition that the variables have the values given for that row. Show an example on the board. M. Frank, EEL3705 Digital Logic, Spring 2007
Literals, Minterms, DNF • A literal is a Boolean variable or its complement. • A minterm of Boolean variables x1,…,xn is a Boolean product of n literals y1…yn, where yi is either the literal xi or its complement xi. • Note that at most one minterm can have the value 1. • The disjunctive normal form (DNF) of a degree-n Boolean function f is the unique sum of minterms of the variables x1,…,xn that represents f. • A.k.a. the sum-of-products expansion of f. • Written ∑i∏j yi,jwhere the ith minterm is ∏j yi,j= yi,1,yi,2,… M. Frank, EEL3705 Digital Logic, Spring 2007
Conjunctive Normal Form • A maxterm is a sum of literals. • CNF is a product-of-maxterms representation. • Or, product-of-sums. • To find the CNF representation for f, • take the DNF representation for complement f, f = ∑i∏j yi,j • and then complement both sides & apply DeMorgan’s laws to get: f = ∏i∑jyi,j Can also get CNF moredirectly, using the 0rows of the truth table. M. Frank, EEL3705 Digital Logic, Spring 2007
Another Notation for minterms/DNF • Express the minterm yi = yi,1yi,2…yi,n with the equation xn,xn−1,…,x2,x1 = bn−1,bn−2,…,b1,b0, where each bk is either 0 or 1; • Abbreviate this minterm as “m(Bi)” where Bi is the integer whose binary expansion is bn−1bn−2…b1b0. • Write the DNF formula as ∑m(B1,B2,…) where the Bi are the integer indices of all the minterms present in the original DNF formula • Use a similar technique to abbreviate CNF formulas as ∏M(B1,B2,…) for B’s of maxterms M. Frank, EEL3705 Digital Logic, Spring 2007
Example of Minterms/Maxterms for Arbitrary Boolean functions of 3 inputs M. Frank, EEL3705 Digital Logic, Spring 2007
Summary of Example • The steps on the preceding slide show that the function to the right can be represented as • DNF (SoP, sum-of-minterms): • Full form: • Abbreviated: • CNF (PoS, product-of-maxterms): • Full form: • Abbreviated: M. Frank, EEL3705 Digital Logic, Spring 2007
Functional Completeness • Since every Boolean function can be expressed in terms of ·,+,¯, we say that the set of operators {·,+,¯} is functionally complete. • There are smaller sets of operators that are also functionally complete. • We can eliminate either · or + using DeMorgan’s law. • NAND | and NOR ↓ are also functionally complete, each by itself (as a singleton set). • E.g., x = x|x, and xy = (x|y)|(x|y). M. Frank, EEL3705 Digital Logic, Spring 2007
Lecture Ended Here We ran out of time to cover the remaining slides and they will be presented later in the semester M. Frank, EEL3705 Digital Logic, Spring 2007
Reversible Boolean Logic Bonus research topic • A reversible Boolean function of degree n is a bijective function f:Bn↔Bn. • Also corresponds to a permutation of Bn. • Reversible unary and binary Boolean operators are bijective operators on B and B2, respectively. • Unary f:B↔B, binary f:B2↔B2. • It turns out that no set of reversible unary and binary Boolean operators is functionally complete! • However, there are many ternary reversible operators that are functionally complete, even as singletons. • One reason that reversible logic is interesting is that these operations theoretically require no energy dissipation! M. Frank, EEL3705 Digital Logic, Spring 2007
A little about Quantum Logic Bonus research topic • A quantum Boolean function is a bijective and linear function f:C2ⁿ↔C2ⁿ. • That is, it maps vectors of 2n complex numbers (one for each n-bit string of Boolean values) to new ones, reversibly and linearly. • Any reversible Boolean function corresponds to a quantum Boolean function where a string in Bn is represented by c=1 for that string, c=0 for all others. • Any quantum Boolean function can be built out of quantum operators operating on just C and C2. • Going to the quantum realm removes the need for ternary gates! M. Frank, EEL3705 Digital Logic, Spring 2007
Topic 2.2.1.2 Combinational Circuits & Boolean Formulas M. Frank, EEL3705 Digital Logic, Spring 2007
Breakdown of Topic • 2.2.1.2. Combinational circuits and Boolean formulas. • 2.2.1.2.1. Simple examples of combinational circuits. • 2.2.1.2.2. Converting formulas to circuits (“synthesis”). • 2.2.1.2.3. Converting circuits to formulas (“analysis”). • CIO 3. [SynAnal] Derive digital circuits from optimized Boolean equations and compute the Boolean equations of a digital circuit. M. Frank, EEL3705 Digital Logic, Spring 2007
Coverage of Topic • Topic is very simple to understand/explain, just go through a few arbitrary examples on the board. • Include sets of equations / circuits with multiple outputs • Be sure to mention how the circuit representation can be used to eliminate the redundancy of common subexpressions M. Frank, EEL3705 Digital Logic, Spring 2007
Subtopic #1.3 Base Conversion Methods M. Frank, EEL3705 Digital Logic, Spring 2007
Base Conversions • Some procedures for converting a number N from an old base b to a new base B: • Method 0: If one of the bases is a power of the other, can do direct substitution of (groups of) digits. • E.g., octal ↔ binary↔ hex conversions work like this • Otherwise: • Two methods for conversion using arithmetic in the new base B: • Method 1: Directly evaluate the polynomial expression for Nb. • Method 2: (Horner’s rule) Repeatedly multiply by b and add digits of N, reading from left to right. • Two methods for conversion using arithmetic in the old base b: • Method 3: Repeatedly divide N by B, the remainders are the new digits, reading from right to left. • Method 4: Repeatedly divide N by the largest power of B less than N; the quotients are the new digits, reading from left to right. Naturalif new baseis 10 Naturalif old baseis 10 M. Frank, EEL3705 Digital Logic, Spring 2007
Example of Method 0 • Convert 3F616 to octal. • We’ll first convert to binary, then binaryoctal. • Hex to binary groups of 4 bits: • 3 00112, F 11112, 6 01102. • The complete binary representation is: • 11111101102 • Binary groups of 3 bits to octal: • 1 1, 111 7, 110 6, 110 6 • The complete octal representation is: • 17668 M. Frank, EEL3705 Digital Logic, Spring 2007
Examples of Method 1 • Convert 1011010112 to base 10. • 1011010112 = (taking the sum from right to left) = 1×20 + 1×21 + 0×22 + 1×23 + 0×24 + 1×25 + 1×26 + 0×27 + 1×28 = 1·1 + 1·2 + 0·4 + 1·8 + 0·16 + 1·32 + 1·64 + 0·128 + 1·256 = 1 + 2 + 8 + 32 + 64 + 256 = 36310. • Convert 3D9616 to base 10. • 3D9616 = 3×163 + 13×162 + 9×161 + 6×160 = 3×4,096 + 13×256 + 9×16 + 6×1 = 12,288 + 3,328 + 144 + 6 = 15,76610 M. Frank, EEL3705 Digital Logic, Spring 2007
Examples of Method 2 • Convert 1011010112 to base 10. • 1×2 + 0 = 2, ×2 + 1 = 5, ×2 + 1 = 11,×2 + 0 = 22, ×2 + 1 = 45, ×2 + 0 = 90,×2 + 1 = 181, ×2 + 1 = 36310. • Convert 3D9616 to base 10. • 3×16 = 48; +13 = 61;×16 = 976; +9 = 985;×16 = 15,760; +6 = 15,76610. M. Frank, EEL3705 Digital Logic, Spring 2007
Example of Method 3 (Dec. Binary) • Convert 36310 to binary. • 363 ÷ 2 = 181 r 1181 ÷ 2 = 90 r 190 ÷ 2 = 45 r 045 ÷ 2 = 22 r 122 ÷ 2 = 11 r 011 ÷ 2 = 5 r 15 ÷ 2 = 2 r 12 ÷ 2 = 1 r 01 ÷ 2 = 0 r 1. 1011010112 M. Frank, EEL3705 Digital Logic, Spring 2007
Method 3 Variation: Tower Drawing Style • Same algorithm,but withoutrewriting ofquotients: 1011010112 0 r 1 2 1 r 0 2 2 r 1 2 5 r 1 2 11 r 0 2 22 r 1 2 45 r 0 2 90 r 1 2 181 r 1 2 363 M. Frank, EEL3705 Digital Logic, Spring 2007
Example of Method 3 (Dec. Hex) • Convert 15,76610 to hexadecimal. • 15,766 ÷ 16 = 985 r 6;985 ÷ 16 = 61 r 9;61 ÷ 16 = 3 r 13;3 ÷ 16 = 0 r 3. 3D9616 M. Frank, EEL3705 Digital Logic, Spring 2007
Example of Method 4 (Dec. Binary) • Convert 36310 to binary. • 363 ÷ 256 = 1 r 107107 ÷ 128 = 0 r 107107 ÷ 64 = 1 r 4343 ÷ 32 = 1 r 1111 ÷ 16 = 0 r 1111 ÷ 8 = 1 r 33 ÷ 4 = 0 r 33 ÷ 2 = 1 r 11 ÷ 1 = 1 r 0 1011010112 M. Frank, EEL3705 Digital Logic, Spring 2007
Method 4 Variation • When converting from binary, the divides in method 4 can be replaced by simple subtraction of the powers of 2. Example: • Convert 36310 to binary. • 363 256 = 107 • 107 64 = 43 • 43 32 = 11 • 11 8 = 3 • 3 2 = 1 • 1 1 = 0 256 128 64 32 16 8 4 2 1 1 0 1 0 1 1 1 0 1 M. Frank, EEL3705 Digital Logic, Spring 2007
Example Where Neither Base is 10 or a Power of the Other • Convert 2103 ___5 using each of methods 1-4. • Method 1: • N = 2·32 + 1·31 + 0·30 = 2·145 + 1·3 + 0 • 2·145 = 2·105 + 2·4 = 205 + 135 = 335 • N = 335 + 3 = 305 + 115 = 415. • Method 2: • 2 · 3 = 115, + 1 = 125, · 3 = 305 + 115 = 415. • Method 3: • 2103 / 123 = 113 r 1, 113 / 123 = 0 r 113 415 • Method 4: • 2103 / 123 = 113 r 1, 1 / 1 = 1 r 0 415 Doing additionand multiplicationin base 5 1112 21012020121 Doing division in base 3 M. Frank, EEL3705 Digital Logic, Spring 2007
Another Way (Method 5) • When converting between two bases neither of which is base 10 or a power of the other, you might find the following strategy easier than using any of methods 1-4 directly: • First, convert from the old base to base 10 using either method 1 or 2 • Next, convert from base 10 to the new base using either method 3 or 4. M. Frank, EEL3705 Digital Logic, Spring 2007
Example of Method 5 • Convert 2103 ___5 using method 5. • First use method 1 to convert to base 10: • 2103 = 2·32 + 1·31 + 0·30 = 2·9 + 3 + 0 =18+3= 2110 • Next use method 4 to convert to base 5: • 2110 ÷ 5 = 4 r 1 415 M. Frank, EEL3705 Digital Logic, Spring 2007