# How to make XOR gate using 2x1 multiplexer?

1. ## How to make XOR gate using 2x1 multiplexer?

Hi

Is it possible to make XOR gate using 2x1 multiplexer?
if yes how? if no why?

2. ## 2x1 mux using nand gates

Let me take a shot.
Below is the truth table of a 2x1 multiplexer.

A B S | O
======
0 0 0 | 0
0 0 1 | 0
0 1 0 | 0
0 1 1 | 1
1 0 0 | 1
1 0 1 | 0
1 1 0 | 1
1 1 1 | 1

I can't seem to find any combination of 2-inputs and one fixed-input giving an XOR gate.

•

3. ## realize nand gate as xor gate

Well if you have more than 1 2x1 Multiplexer it can be done. If you have 2 2x1 Multiplexers you can make a NAND gate. And then by 4 Nand Gates you can make a XOR Gate.

2x1 to AND:
Tie A to 0, then the Mux is a AND Gate with Inputs B and S. Make an Inverter of the 2nd Mux by tying A, B to say 1, 0. And cascade the 2, you have a NAND. Use 4 such NANDs to get a XOR. Thus to make a XOR by this way u need 8 2x1 MUX !

Hope this helped !!

4. ## using mux to make xor gate

Originally Posted by aryajur
Thus to make a XOR by this way u need 8 2x1 MUX !
3 2x1 MUXes should be enough to build ANY 2-inputs gate.

First of all, you can build 4x1 MUX from those 3 2x1 MUXes. And then use the same approach as LUT in FPGA, by providing constant 1s and 0s on MUX inputs, that correspond to output column of truth table for desired gate.

•

5. ## xor gate from 2 to 1 mux truth table

You can build any logic using 2x1 MUX. The only reason why we don't use that it will be not optimal design.

•

6. ## build a +nand gate using a +multiplexer

Here it goes...

Code:
+-----+
b ---|0    |
|     |---> Y = a xor b
b_bar ---|1 S  |
+--+--+
|
a------+
Here you need an inverter which can be build using another 2:1 mux!

7. ## how to make an xor gate with 2 muxes

Originally Posted by Fom
You can build any logic using 2x1 MUX. The only reason why we don't use that it will be not optimal design.
This is generally true because you can build an entire look-up table using them. But why the enthusiasm on multiplexers?

8. ## xor by nand gate

With single 2*1 mux u may not get X-0r gate..........but by using more than 1 mux and by using additional gates u can realize x-or gate ..

9. ## xor gate with two mux

Hi..
Yes It is Possible to make Xor gate using single 2:1 Mux.
Here is the way

Lets say inputs of xor gate are A and B and output=y

connect select line to A
Connect 0 -> B
and 1 -> B_bar

10. ## xor by only nand gate

Originally Posted by checkmate
Originally Posted by Fom
You can build any logic using 2x1 MUX. The only reason why we don't use that it will be not optimal design.
This is generally true because you can build an entire look-up table using them. But why the enthusiasm on multiplexers?
I think in FPGAs there will be muxes ,and we have to route properly so that we can get the logic what we want. so there is lot of enthusiasm in muxes.

11. ## xor gate from two mux

Hi,
You can design any logic using mux in two ways,using Levevls and/or using interconnection between differernt nodes.

For XOR implementation..interconnection without using Levels

(A)i0------!\
! !__Y
i1 !---! !
! !/
!__ !
!
!
(B)Sel

Refer www.asic-world.com for many VLSI stuff, it is a nice website by Deepak Kumar Tala ..Thanks Deepak

•

12. ## ways to build an xor gate out of nand gates

Originally Posted by nand_gates
Here it goes...

Code:
+-----+
b ---|0    |
|     |---> Y = a xor b
b_bar ---|1 S  |
+--+--+
|
a------+
Here you need an inverter which can be build using another 2:1 mux!
I think perfectly okay a solution

Added after 1 minutes:

Originally Posted by mohammed.peer
Hi..
Yes It is Possible to make Xor gate using single 2:1 Mux.
Here is the way

Lets say inputs of xor gate are A and B and output=y

connect select line to A
Connect 0 -> B
and 1 -> B_bar
similar to what nand_gates wrote and perfectly okay

--[[ ]]--