CS 151: Introduction to Digital Design Chapter 2-9 Exclusive-OR Gates
CS 151 Complex Digital Logic Gates
CS 151 Exclusive OR/ Exclusive NOR The eXclusive OR (XOR) function is an important Boolean function used extensively in logic circuits. The XOR function may be; implemented directly as an electronic circuit (truly a gate) or implemented by interconnecting other gate types (used as a convenient representation) The eXclusive NOR function is the complement of the XOR function By our definition, XOR and XNOR gates are complex gates.
CS 151 Exclusive OR/ Exclusive NOR Uses for the XOR and XNORs gate include: Adders/subtractors/multipliers Counters/incrementers/decrementers Parity generators/checkers Definitions The XOR function is: The eXclusive NOR (XNOR) function, otherwise known as equivalence is: Strictly speaking, XOR and XNOR gates do no exist for more that two inputs. Instead, they are replaced by odd and even functions. YXYXYX YXYXYX
CS 151 Truth Tables for XOR/XNOR Operator Rules: XOR XNOR The XOR function means: X OR Y, but NOT BOTH Why is the XNOR function also known as the equivalence function, denoted by the operator ? X Y X Y X Y or X Y (X Y)
CS 151 XOR/XNOR (Continued) The XOR function can be extended to 3 or more variables. For more than 2 variables, it is called an odd function or modulo 2 sum (Mod 2 sum), not an XOR: The complement of the odd function is the even function. The XOR identities: X1XX0X 1XX0XX XYYX ZYX)ZY(XZ ) YX( ZYXZYXZYXZYXZYX
CS 151 Symbols For XOR and XNOR XOR symbol: XNOR symbol: Symbols exist only for two inputs
CS 151 XOR Implementations The simple SOP implementation uses the following structure: A NAND only implementation is: X Y X Y X Y X Y
CS 151 Odd and Even Functions What about the case of more than 2 variables? A B C = (AB’ + A’B) C’ + (AB + A’B’) C = AB’C’ + A’BC’ + ABC + A’B’C Then, F is the logical sum of the four minterms having an index with an odd number of 1’s F is called an odd function The other four minterms not included are 000, 011, 101 and 110, they have an index with even number of 1’s F’ is called an even function. In general, an n-variable exclusive-OR function is an odd function defined as the logical sum of the 2 n /2 minterms whose binary index have an odd number of 1’s
CS 151 Odd and Even Functions
CS 151 Example: Odd Function Implementation Design a 3-input odd function F = X Y Z with 2-input XOR gates Factoring, F = (X Y) Z The circuit: X Y Z F
CS 151 Example: Even Function Implementation Design a 4-input even function F = (W X Y Z)’ with 2-input XOR and XNOR gates Factoring, F = ( (W X) (Y Z) )’ The circuit: W X Y F Z
CS 151 Parity Generators and Checkers Example: n = 3. Generate even parity code words of length 4: X Y Z P P=X Y Z
CS 151 Parity Generators and Checkers-Cont. X Y Z E P Check even parity code words of length 4 with odd parity checker: E should indicate an error (be true) when (X,Y,Z,P) have an odd number of 1’s. E = X Y Z P Example: operation (X,Y,Z) = (0,0,1) gives (X,Y,Z,P) = (0,0,1,1) and E = 0. If Y changes from 0 to 1 between generator and checker, then E = 1 indicates an error.