Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to make XOR gate using 2x1 multiplexer?

Status
Not open for further replies.

carrot

Full Member level 3
Joined
Feb 23, 2004
Messages
184
Helped
9
Reputation
18
Reaction score
4
Trophy points
1,298
Location
Bangalore, India
Activity points
1,532
Hi

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

checkmate

Advanced Member level 3
Joined
Feb 25, 2004
Messages
833
Helped
178
Reputation
356
Reaction score
125
Trophy points
1,323
Location
Toilet Seat
Activity points
7,815
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.
 

aryajur

Advanced Member level 3
Joined
Oct 23, 2004
Messages
793
Helped
124
Reputation
248
Reaction score
37
Trophy points
1,308
Location
San Jose, USA
Activity points
7,788
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 !!
 

Ace-X

Advanced Member level 2
Joined
Jan 25, 2002
Messages
529
Helped
41
Reputation
82
Reaction score
14
Trophy points
1,298
Location
Germany
Activity points
5,150
using mux to make xor gate

aryajur said:
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.
 

Fom

Advanced Member level 2
Joined
Mar 10, 2004
Messages
633
Helped
84
Reputation
168
Reaction score
31
Trophy points
1,308
Location
Taiwan
Activity points
4,456
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.
 

nand_gates

Advanced Member level 3
Joined
Jul 19, 2004
Messages
892
Helped
175
Reputation
350
Reaction score
51
Trophy points
1,308
Activity points
6,830
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!
 

checkmate

Advanced Member level 3
Joined
Feb 25, 2004
Messages
833
Helped
178
Reputation
356
Reaction score
125
Trophy points
1,323
Location
Toilet Seat
Activity points
7,815
how to make an xor gate with 2 muxes

Fom said:
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?
 

maharshi_qis

Full Member level 5
Joined
Feb 14, 2007
Messages
241
Helped
13
Reputation
26
Reaction score
6
Trophy points
1,298
Activity points
2,462
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 ..
 

mohammed.peer

Junior Member level 3
Joined
Oct 29, 2006
Messages
29
Helped
4
Reputation
8
Reaction score
3
Trophy points
1,283
Location
INDIA
Activity points
1,437
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
 

sivakumar_tumma

Full Member level 4
Joined
Jan 27, 2007
Messages
195
Helped
9
Reputation
18
Reaction score
2
Trophy points
1,298
Location
India
Activity points
2,311
xor by only nand gate

checkmate said:
Fom said:
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.
 

dbshailesh

Junior Member level 1
Joined
Feb 13, 2007
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Bangalore
Activity points
1,415
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
 

tronix

Advanced Member level 4
Joined
Jul 6, 2006
Messages
117
Helped
8
Reputation
16
Reaction score
1
Trophy points
1,298
Activity points
1,967
ways to build an xor gate out of nand gates

nand_gates said:
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:

mohammed.peer said:
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
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top