Design problem: How can you convert an XOR gate into a buffer or an inverter?


Figure 1 above shows the truth table of a 2-input XOR gate. It has two inputs A, B and an output OUT. On looking closely, we observe that:

  • If one of the inputs (say B) is 0, OUT is equal to the other input. For instance, when B = 0,
    • OUT = 0 when A = 0
    • OUT = 1 when A = 1
  • Similarly, if one of the inputs is 1, OUT is equal to invert of the other input. For instance, when B = 1,
    • OUT = 1 when A = 0
    • OUT = 0 when A = 1
Using the above information, XOR gate can be easily converted to a buffer and an inverter.

Buffer using XOR gate: Simply connecting one of the inputs to logic '0' will convert XOR gate into a buffer. As shown in the truth table below, OUT is following the value of B.




Inverter design using XOR gate: Similarly, we can realize an inverter using an XOR gate by connecting one of the inputs to logic '1'. As shown in the truth table below, OUT is opposite to the value of B.


3 comments:

  1. Awesome post! Keep it up!

    ReplyDelete
  2. thank u for clearcut answer u r just awesome

    ReplyDelete
  3. I got this as an interview question from Intel!

    ReplyDelete

Thanks for your valuable inputs/feedbacks. :-)