Digital Logic Design Dr Ali Abdallah Logic Gates
Digital Logic Design Dr Ali Abdallah Logic Gates
The Modest Switch • • Manual Switch A switch is pushed manually, raised to a high voltage • Which makes the current flow through the bulb • Auto Switch or Controllable Switch • No hands • High voltage at input: switch on Otherwise it is off input output • Output=Input Digital Logic Design - Dr Ali Abdallah 1
Using the switch Input Output is high (voltage) if and only if the input is high Output Now we can make one circuit control another switch… Input Output Digital Logic Design - Dr Ali Abdallah 2
Lets use them creatively Output is high if both the inputs input 1 AND input 2 are high Input 1 Output If either of the inputs is low, the output is low. This is called an AND gate Input 2 Now, can you make an OR gate with switches? Digital Logic Design - Dr Ali Abdallah 3
OR Gate Input 1 Output Input 2 Output is low iff both inputs are low I. e. Output is high if either of the inputs (or both) are high (input 1 OR input 2) Digital Logic Design - Dr Ali Abdallah 4
Basic Gates • There are three basic kinds of logic gates Operation: AND of two inputs OR of two inputs NOT (complement) on one input Logic gate: Digital Logic Design - Dr Ali Abdallah 5
Describing Circuit Functionality: Inverter Truth Table A Y Symbol Input • • • A Y 0 1 1 0 Output Basic logic functions have symbols. The same functionality can be represented with truth tables. – Truth table completely specifies outputs for all input combinations. The above circuit is an inverter. – An input of 0 is inverted to a 1. – An input of 1 is inverted to a 0. Digital Logic Design - Dr Ali Abdallah 6
The AND Gate A Y B • • This is an AND gate. So, if the two inputs signals are asserted (high) the output will also be asserted. Otherwise, the output will be deasserted (low). Digital Logic Design - Dr Ali Abdallah Truth Table A B Y 0 0 1 1 1 7
The OR Gate A B • • This is an OR gate. So, if either of the two input signals are asserted, or both of them are, the output will be asserted. Y A B Y 0 0 1 1 1 0 1 1 Digital Logic Design - Dr Ali Abdallah 8
Describing Circuit Functionality: Waveforms • • • Waveforms provide another approach for representing functionality. Values are either high (logic 1) or low (logic 0). Can you create a truth table from the waveforms? Digital Logic Design - Dr Ali Abdallah 9
Consider three-input gates 3 Input OR Gate Digital Logic Design - Dr Ali Abdallah 10
Ordering Boolean Functions • • • How to interpret A B+C? – Is it A B ORed with C ? – Is it A ANDed with B+C ? Order of precedence for Boolean algebra: AND before OR. Note that parentheses are needed here : Digital Logic Design - Dr Ali Abdallah 11
Boolean Algebra • • • A Boolean algebra is defined as a closed algebraic system containing two or more elements and the two operators, . and +. Useful for identifying and minimizing circuit functionality Identity elements – a+0=a – a. 1=a 0 is the identity element for the + operation. 1 is the identity element for the. operation. Digital Logic Design - Dr Ali Abdallah 12
Commutativity and Associativity of the Operators • • The Commutative Property: For every a and b in K, – a+b=b+a – a. b=b. a The Associative Property: For every a, b, and c in K, – a + (b + c) = (a + b) + c – a. (b. c) = (a. b). c Digital Logic Design - Dr Ali Abdallah 13
Distributivity of the Operators and Complements • • • The Distributive Property: For every a, b, and c in K, – a+(b. c)=(a+b). (a+c) – a. (b+c)=(a. b)+(a. c) The Existence of the Complement: For every a in K there exists a unique element called a’ (complement of a) such that, – a + a’ = 1 – a. a’ = 0 To simplify notation, the. operator is frequently omitted. When two elements are written next to each other, the AND (. ) operator is implied… – a+b. c=(a+b). (a+c) – a + bc = ( a + b )( a + c ) Digital Logic Design - Dr Ali Abdallah 14
Duality • • • The principle of duality is an important concept. This says that if an expression is valid in Boolean algebra, the dual of that expression is also valid. To form the dual of an expression, replace all + operators with. operators, all. operators with + operators, all ones with zeros, and all zeros with ones. Form the dual of the expression a + (bc) = (a + b)(a + c) Following the replacement rules… a(b + c) = ab + ac Take care not to alter the location of the parentheses if they are present. Digital Logic Design - Dr Ali Abdallah 15
Involution • • • This theorem states: a’’ = a Remember that aa’ = 0 and a+a’=1. – – Therefore, a’ is the complement of a and a is also the complement of a’. As the complement of a’ is unique, it follows that a’’=a. Taking the double inverse of a value will give the initial value. Digital Logic Design - Dr Ali Abdallah 16
Absorption • • This theorem states: a + ab = a a(a+b) = a To prove the first half of this theorem: a + ab = a. 1 + ab = a (1 + b) = a (b + 1) = a (1) a + ab = a Digital Logic Design - Dr Ali Abdallah 17
De. Morgan’s Theorem • A key theorem in simplifying Boolean algebra expression is De. Morgan’s Theorem. It states: (a + b)’ = a’b’ (ab)’ = a’ + b’ • Complement the expression a(b + z(x + a’)) and simplify. (a(b+z(x + a’)))’ = a’ + (b + z(x + a’))’ = a’ + b’(z’ + (x + a’)’) = a’ + b’(z’ + x’a’’) = a’ + b’(z’ + x’a) Digital Logic Design - Dr Ali Abdallah 18
Additional gates • • We’ve already seen all the basic Boolean operations and the associated primitive logic gates. There a few additional gates that are often used in logic design. – They are all equivalent to some combination of primitive gates. – But they have some interesting properties in their own right. Digital Logic Design - Dr Ali Abdallah 19
Additional Boolean operations Operation: Expressions: NAND (NOT-AND) (xy)’ = x’ + y’ NOR (NOT-OR) XOR (e. Xclusive OR) (x + y)’ = x’ y’ x y = x’y + xy’ Truth table: Logic gates: Digital Logic Design - Dr Ali Abdallah 20
NAND/OR Gates Illustrations NAND in the form of AND NAND (NOT-AND) NOR (NOT-OR) NAND in the form of OR NOR in the form of AND Digital Logic Design - Dr Ali Abdallah 21
Interpretation of the two NAND gate symbols (AB)’ A’+B’=(AB)’ • Determine the output expression for circuit via De. Morgan’s Theorem Digital Logic Design - Dr Ali Abdallah 22
XOR gates • A two-input XOR gate outputs true when exactly one of its inputs is true: x y = x’ y + x y’ • Several fascinating properties of the XOR operation: Digital Logic Design - Dr Ali Abdallah 23
More XOR tidbits • • The general XOR function is true when an odd number of its arguments are true. For example, we can use Boolean algebra to simplify a three-input XOR to the following expression and truth table. x (y z) = x (y’z + yz’) = x’(y’z + yz’) + x(y’z + yz’)’ = x’y’z + x’yz’ + x((y’z)’ (yz’)’) = x’y’z + x’yz’ + x((y + z’)(y’ + z)) = x’y’z + x’yz’ + x(yz + y’z’) = x’y’z + x’yz’ + xyz + xy’z’ • [ Definition of XOR ] [ Distributive ] [ De. Morgan’s ] [ Distributive ] XOR is especially useful for building adders (as we’ll see on later) and error detection/correction circuits. Digital Logic Design - Dr Ali Abdallah 24
XNOR gates • • Finally, the complement of the XOR function is the XNOR function. A two-input XNOR gate is true when its inputs are equal: (x y)’ = x’y’ + xy Digital Logic Design - Dr Ali Abdallah 25
- Slides: 26