# Creating a two input two way digital switch [closed]

I'm very much a beginner here, so bear with me.

I'm looking to create a digitally controlled switch that has two inputs and two outputs. (Update: The signals are 0V-1V analog.) Here are the two states (excuse the crappy ASCII):

     _____
A----|---|---X
|   |
B----|---|---Y
-----

_____
A----|\ /|---X
| x |
B----|/ \|---Y
-----


So, basically in one state, A is connected to X and B is connected to Y, but in the other state, A is connected to Y and B is connected to X.

I spent some time googling around and reading answers seem to be pointing me towards using a mux, but that would only switch one of the outputs. What would I use to get the other output to be routed to the opposite of what the mux selects?

Or...I'm sure there's another way to do what I'm trying to get at? (The beginner terms for googling this kind of thing (switch, cross, flip), aren't the best, as you can imagine.)

• What kind of signal [or power] are you routing? Do you need a dry connection (kind of relay?) Or perhaps some digital logic will suffice? – Eugene Sh. Jul 31 '18 at 15:30
• @EugeneSh. The signals are 0V-1V analog. – user5265147 Jul 31 '18 at 15:48
• I would say use 2-1 two analog MUXes. – Eugene Sh. Jul 31 '18 at 15:52
• You can buy analogue switches and multiplexers in all different sizes and shapes. Some four channel some 8 channel some single channel. Some with c/o contacts some with just n/o contacts. I use the word "contact" loosely of course. – Andy aka Jul 31 '18 at 15:58
• @user5265147: "... so bare with me" is an invitation to undress together. You mean "... so bear with me" as in "to bear one another's burdens". – Transistor Jul 31 '18 at 16:30

What you want is called a Bus Exchange Switch. As an example, the logic diagram from the Onsemi 7WB383 is shown below. It connects either straight through, swapped, or not at all, depending on the control inputs.

The switches are available in different logic families and voltages. Googling the term "bus exchange switch" will find you many possibilities.

• Basic DPDT config using single FETs or CMOS quad switches here can be used. – Tony Stewart Sunnyskyguy EE75 Jul 31 '18 at 22:40

You said that the signals are 0...1 volt analog. The proper practical solution depends much on several other things, too:

• is that 0...1V an amplitude of an AC signal or is it the absolute momentary voltage range?
• what frequency range should be covered?
• wanted switching speed?
• allowed leakage?
• have the signals common ground?
• what is the digital control signal for changing the states?

Without knowing those things one can give only guesses. I give a couple of them.

Guess1: use an electromechanical relay or 2 of them, one for each signal (assuming your control signal is a proper voltage for the relay coil)

Guess2: use a mechanical switch (assuming your digital control signal is a manual pressing or turning the switch)

Guess3: use analog 2 to 1 multiplexers assuming your control is a bit of a parallel output of a computer

A common approach is to use a DPDT relay like this:

simulate this circuit – Schematic created using CircuitLab

• Or hire a switchboard operator and tell them to swap the connectors every time you need it ;) – Dmitry Grigoryev Aug 4 '18 at 9:09