Logic Design 1 Goal: to become literate most common concepts and termology of digital electronics Important concepts: - use abstraction and composition to implement complicated functionality with very simple digital electronics - keep thgs as simple, regular, and small as possible Thgs we will not explore: - physics - chip fabrication - layout - tools for chip specification and design 2005-2012 McQua
Motivation Consider the external view of addition: 2 x y Adder??? x + y What kd of circuitry would go to the "black box" adder to produce the correct results? How would it be designed? What modular components might be used? 2005-2012 McQua
Basic Logic Gates 3 Fundamental buildg blocks of circuits; mirror the standard logical operations: NOT gate AND gate OR gate A Out 0 1 1 0 A B Out 0 0 0 0 1 0 1 0 0 1 1 1 A B Out 0 0 0 0 1 1 1 0 1 1 1 1 Note the outputs of the AND and OR gates are commutative with respect to the puts. Multi-way versions of the AND and OR gates are commonly assumed design. 2005-2012 McQua
Additional Common Logic Gates 4 XOR gate NAND gate NOR gate A B Out 0 0 0 0 1 1 1 0 1 1 1 0 A B Out 0 0 1 0 1 1 1 0 1 1 1 0 A B Out 0 0 1 0 1 0 1 0 0 1 1 0 XNOR gate A B Out 0 0 1 0 1 0 1 0 0 1 1 1 2005-2012 McQua
Combational and Sequential Circuits 5 A combational circuit is one with no "memory". That is, its output depends only upon the current state of its puts, and not at all on the current state of the circuit itself. A sequential circuit is one whose output depends not only upon the current state of its puts, but also on the current state of the circuit itself. For now, we will consider only combational circuits. 2005-2012 McQua
From Function to Combational Circuit 6 Given a simple Boolean function, it is relatively easy to design a circuit composed of the basic logic gates to implement the function: z: x y + x y This circuit implements the exclusive or (XOR) function, often represented as a sgle logic gate: 2005-2012 McQua
Sum-of-Products Form 7 A Boolean expression is said to be sum-of-products form if it is expressed as a sum of terms, each of which is a product of variables and/or their complements: a b+ a b It's relatively easy to see that every Boolean expression can be written this form. Why? The summands the sum-of-products form are called mterms. - each mterm contas each of the variables, or its complement, exactly once - each mterm is unique, and therefore so is the representation (aside from order) 2005-2012 McQua
Sum-of-Products Form 8 Given a truth table for a Boolean function, construction of the sum-of-products representation is trivial: - for each row which the function value is 1, form a product term volvg all the variables, takg the variable if its value is 1 and the complement if the variable's value is 0 - take the sum of all such product terms x y z F 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 1 x y z x y z x y z x y z F = x y z+ x y z+ x y z+ x y z 2005-2012 McQua
Equivalence 9 F( x, y, z) = x y z+ x y z+ x y z+ x y z Given = x y z+ x y z+ x y z+ x y z+ x y z+ x y z ( x y z x y z) ( x y z x y z) ( x y z x y z) ( x x) y z ( y y) x z ( z z) x y = + + + + + = + + + + + Idempotence, twice = 1 y z+ 1 x z+ 1 x y Boundedness Commutativity, Associativity Commutativity, Distributivity = x y+ x z+ y z Boundedness, Commutativity = Gxyz (,, ) 2005-2012 McQua
Efficiency of Expression 10 While the sum-of-products form is arguably natural, it is not necessarily the simplest way form, either : - number of gates (space) - depth of circuit (time) F( x, y, z) = x y z + x y z + x y z + x y z Gxyz (,, ) = x y+ yz + xz 2005-2012 McQua
1-bit Half Adder 11 Let's make a 1-bit adder (half adder) we can thk of it as a Boolean function with two puts and the followg defg table: A B Sum 0 0 0 0 1 1 1 0 1 1 1 0 Here's the resultg circuit. It's equivalent to the XOR circuit seen earlier. But the fal row of the truth table above, we've ignored the fact that there's a carry-out bit. 2005-2012 McQua
Dealg with the Carry 12 The carry-out value from the 1-bit sum can also be expressed via a truth table. However, the result won't be terribly useful unless we also take to account a carry-. A B C Sum C out 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 The resultg sum-of-products expressions are: Sum = A B C B C B C B C C = A B C B C B C B C out ( ) = ABC + ABC + AB C + C = ABC + ABC + AB = AC + BC + AB 2005-2012 McQua
1-bit Full Adder 13 The expressions for the sum and carry lead to the followg unified implementation: Sum = A Cout = A B C + B C 2005-2012 McQua
1-bit Full Adder as a Module 14 When buildg more complex circuits, it is useful to consider sub-circuits as dividual, "black-box" modules. For example: Sum = A Cout = A B C + B C 2005-2012 McQua
Chag an 8-bit Adder An 8-bit adder build by chag 1-bit adders: 15 This has one serious shortcomg. The carry bits must ripple from top to bottom, creatg a lag before the result will be obtaed for the fal sum bit and carry. 2005-2012 McQua