You are on page 1of 9

# XOR gates

 XOR gates are expensive to implement in silicon, but they are very useful for circuits like parity checkers and arithmetic circuits (e.g., adders, subtractors, and so forth). Sometimes, we can find an XOR gate “hidden” or “buried” inside of a lot of AND, OR and NOT gates. If we can “find” and “extract” the XOR gate, we can take advantage of it to get a large savings in circuit size. Recall truth tables for XOR and NXOR… These gates perform the odd and even functions, respectively (with 2-inputs, they perform the difference or equivalence functions, respectively).

ECE124 Digital Circuits and Systems

Page 1

4-input XOR and NXOR truth tables (for illustration purposes) ECE124 Digital Circuits and Systems Page 2 .

OR and NOT gates: ECE124 Digital Circuits and Systems Page 3 . OR and NOT gates  Notice that we can implement XORs using AND.XOR and XNOR functions using AND.

x1x2 x3x4 00 01 11 10 00 0 1 0 1 01 1 0 1 0 11 0 1 0 1 10 1 0 1 0 x1x2 x3x4 00 01 11 10 00 1 0 1 0 01 0 1 0 1 11 1 0 1 0 10 0 1 0 1 ECE124 Digital Circuits and Systems Page 4 .K-Maps for 4-Input XOR and XNOR  XOR and XNOR gates have “checker-board” patterns in their K-Maps.

4-input. 4. it might be true that XORs are “hidden” inside of other logic. we might get a very simple circuit. x1x2 x3x4 00 01 11 10 00 0 1 0 1 01 1 0 1 0 11 0 1 0 1 10 0 1 0 1  The first equation above is the minimum Sum-Of-Products… 6 AND gates (2. ECE124 Digital Circuits and Systems Page 5 . By finding and “extracting” an XOR.How can XORs Sometimes Reduce Implementation Size?  Sometimes. 3-input) and 1 OR gate (6 inputs).

Continuing Our Example… x1x2 x3x4 00 01 11 10 00 0 1 0 1 01 1 0 1 0 11 0 1 0 1 10 0 1 0 1 ECE124 Digital Circuits and Systems Page 6 .

x4 and overlaying them… We are taking advantage of the XOR “odd” property. x3. x1x2 x3x4 00 01 11 10 x1x2 x3x4 00 01 11 10 x1x2 x3x4 00 01 11 10 x1x2 x3x4 00 01 11 10 00 0 0 1 1 01 0 0 1 1 11 0 0 1 1 10 0 0 1 1 00 0 1 1 0 01 0 1 1 0 11 0 1 1 0 10 0 1 1 0 00 0 0 0 0 01 1 1 1 1 11 0 0 0 0 10 0 0 0 0 00 0 1 0 1 01 1 0 1 0 11 0 1 0 1 10 0 1 0 1 ECE124 Digital Circuits and Systems Page 7 . x2.Finishing Our Example…  We can draw a circuit…  We can see what is happening with the XOR by drawing the K-Maps for x1.

we are finding not Sum-Of-Products. but rather Exclusive Sum-Of-Products (ESOP). finding and extracting XOR gates is a complicated and hard problem. When we can write a function as the XOR of a bunch of Product Terms (ANDs).XOR Summary   In general. ECE124 Digital Circuits and Systems Page 8 .

ECE124 Digital Circuits and Systems Page 9 .Another XOR Example  Just another example of finding an XOR (but not an ESOP)… The K-Map appears to have an XOR pattern… x1x2 x3x4 00 01 11 10 00 0 1 0 0 01 1 0 0 0 11 0 1 0 0 10 1 0 0 0  The input x3 is acting like a “gating signal”. preventing the XOR from affecting the output when it shouldn’t (we can “gate” signals with ANDs).