Converting English to Boolean Expressions: Logic Forms & Gate Symbols
350 likes | 455 Views
Learn how to convert English statements to Boolean expressions using logic forms and gate symbols. Understand bubble matching rules and functional completeness in Boolean algebra.
Converting English to Boolean Expressions: Logic Forms & Gate Symbols
E N D
Presentation Transcript
Gates – Part 2 ECEn 224
The air conditioner should be turned on if and only if: - the temperature is greater than 75, - the time is between 8a.m. and 5 p.m., - and it is not a holiday. ECEn 224
1. Identify phrases The air conditioner should be turned on if and only if: - the temperature is greater than 75, - the time is between 8a.m. and 5 p.m., - and it is not a holiday. F =air conditioner should be turned on A = temperature is greater than 75 B = time is between 8a.m. and 5 p.m C = it is a holiday ECEn 224
2. Identify connective words = The air conditioner should be turned on if and only if: - the temperature is greater than 75, - the time is between 8a.m. and 5 p.m., - and it is not a holiday. AND ECEn 224
3. Construct a Boolean Expression The air conditioner should be turned on if and only if: - the temperature is greater than 75, - the time is between 8a.m. and 5 p.m., - and it is not a holiday. F =air conditioner should be turned on A = temperature is greater than 75 B = time is between 8a.m. and 5 p.m C = it is a holiday F = A • B • C’ ECEn 224
4. Draw the Network The air conditioner should be turned on if and only if: - the temperature is greater than 75, - the time is between 8a.m. and 5 p.m., - and it is not a holiday. F = A • B • C’ A F B C ECEn 224
Converting English to Boolean 1. Identify phrases 2. Identify connective words 3. Construct a Boolean Expression 4. Draw the Network ECEn 224
Converting English to Boolean • Be careful: Boolean algebra is precise, English is not. The roads will be very slippery if it snows or rains and there is oil on the road. A C B F = A + BC or F = (A + B) C Which is it? ECEn 224
AND/OR vs. OR/AND Logic Forms ECEn 224
A B C f AND/OR Logic from Truth Table 1. Write the SOP by inspection for f f = A’B’C +AB’C + ABC’ + ABC ECEn 224
AND/OR Logic from Truth Table 2. Simplify the equation f = A’B’C +AB’C + ABC’ + ABC f = (A + A’) B’C + AB (C + C’) f = AB + B’C ECEn 224
AND/OR Logic from Truth Table 3. Draw the logic network f = AB + B’C A f B C “AND/OR” ECEn 224
A B C f OR/AND Logic from Truth Table • Write a POS by inspection from f f’= A’B’C’ + A’BC’ + AB’C’ f = (A’B’C’ + A’BC’ + AB’C’)’ f = (A + B + C)(A + B’ + C)(A’ + B + C) ECEn 224
OR/AND Logic from Truth Table 3. Simplify the equation: f = (A + B + C)(A + B’ + C)(A’ + B + C) f = (A + B)(A + B’)(A’ + B) + C f = (A)(A’ + B) + C f = (AA’ + AB) + C f = AB + C f = (A + C)(B + C) A + BCD = A + B(CD) = (A + B)(A + CD) = (A + B)(A + C)(A + D) (X + Y)(X + Y’) = X ECEn 224
OR/AND Logic from Truth Table 4. Draw the logic network f = (A+C)(B+C) A C f B C “OR/AND” ECEn 224
Types of Gates • Gates already studied • AND, NAND • OR, NOR • Inverter (NOT) • XOR (Exclusive-OR) • XNOR (Equivalence) ECEn 224
NAND/NAND and NOR/NOR Logic ECEn 224
AND/OR to NAND/NAND Algebra-based: AB+CD = [AB+CD]’’ = [(AB)’(CD)’]’ Preferred symbol in this context… Schematic-based: ECEn 224
OR/AND to NOR/NOR Algebra-based: (A+B)(C+D) = [(A+B)(C+D)]’’ = [(A+B)’ + (C+D)’]’ Preferred symbol in this context… Schematic-based: ECEn 224
Alternative Gate Symbols Which is easier to understand? A A B B Q = ? Q = ? C C D D A A B B Q = AB + CD Q = (A+B)(C+D) C C D D If you think of the bubbles as canceling each other out… ECEn 224
Bubble Matching How to make schematics readable, understandable, maintainable, … ECEn 224
Bubble Matching Rules • Choose alternative symbols • Match all interior bubbles • More than one solution • Makes reading of the function trivial A A F F B B C C D D F = [(AB)’(C+D)’]’ ??? F = AB + (C+D) = AB+C+D ECEn 224
More Bubble Matching A A F F B B C C D D This doesn’t work – has unmatched bubbles A F B C D This works. F = AB + C’D’ ECEn 224
Yet More Bubble Matching A A F F B B C C D D Same circuit as on previous slide… Alternative solution = convert top-left gate. F’ = (A’+B’)(C+D)F = AB+C’D’ Same result as on previous slide ECEn 224
Can Bubbles Always Be Matched? This is called reconvergent fanout • No… x A y B F E C D Nodes x and y both drive final gate and so both need same polarity (bubble or no bubble). Can’t satisfy that requirement because x also drives y’s input. ECEn 224
Bubble Matching Summary • Convert symbols to match bubbles • Two versions for each circuit • Inverted output • Non-inverted output • Good schematic style similar to good programming style • Convey meaning as well as function • Document the design ECEn 224
Functional Completeness ECEn 224
Functionally Complete • AND, OR, and NOT make a functionally complete set of operators • There is no truth table which cannot be implemented using AND, OR, NOT • Any set of gates which can implement AND, OR and NOT is also functionally complete ECEn 224
Functionally Complete • Is the set {AND, NOT} functionally complete? • If I could just build an OR gate… Success! or… X + Y = (X’Y’)’ ECEn 224
Functionally Complete • Is the set {OR, NOT} functionally complete? • If I could just build an AND gate… Success! or… XY = (X’ + Y’)’ ECEn 224
Functionally Complete • Is the set {AND, OR} functionally complete? • No! Can’t do a NOT ECEn 224
How About NAND Only? NOT AND OR Success! ECEn 224
How About NOR Only? NOT OR AND Success! ECEn 224
Functional Completeness • A few functionally complete sets: ECEn 224