etc...
Good morning, Rik. Thanks for looking first. I'm assuming you've got
5V digital logic signals you're switching, and that you're not particularly concerned about obtaining the fastest switching speed. Given these assumptions, there is a one-chip solution. A small EPROM will do the job quite nicely with inputs to spare. The problem is, if you had an EPROM burner, you certainly wouldn't be asking -- you'd have it done by now.Well, there is a two-chip solution for you. It's called a data selector, and does exactly what you ask. For a 74HC157, it will switch between two sets of four data signals, depending on what the control signal says. Look at the data sheet:
and then look at this diagram (view in fixed font or M$ Notepad):
1 2 3 4 5 6 7 8 9 o o o o o o o o o | | | | | | | | | | | | | .----------------------------------o | | | | | | | | | | o----------------------------------------------------------. | | | | | | | | | | | | | o----------------------------------------------------. | | | | | | | | | | | | | | | | o----------------------------------------------. | | | | | | | | | | | | | | | | | | | o----------------------------------------. | | | | | | | | | | | | | | | | | | | | | | .----------o | | | | | | | | | | | | | | | | | | | | | | | | | | | .----------------o | | | | | | | | | | | | | | | | | | | | | | | | | | | .----------------------o | | | | | | | | | | | | | | | | | | | | | | | | | | | .----------------------------o | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | .--o--o--o--o-----o--o--o--o--. | .--o--o--o--o-----o--o--o--o--. | | A1 A2 A3 A4 B1 B2 B3 B4 |1| | A1 A2 A3 A4 B1 B2 B3 B4 |1| | Selo-' | Selo-' | 74HC157 | | 74HC157 | | Strobe o-. | Strobe o-. | Y1 Y2 Y3 Y4 | | | Y1 Y2 Y3 Y4 | | '----------o--o--o--o---------' | '----------o--o--o--o---------' | 4| | | | | 4| | | | | o o o o === o o o o === GND GND created by Andy´s ASCII-Circuit v1.24.140803 BetaThe above of course assumes you've got Vcc and GND connected to the appropriate pins on the ICs. I've left figuring out the pin numbers to you. The logic of the chip is as follows:
If STROBE is high, the outputs are Tri-State (not connected to anything, act like open ckt). So, we'll tie both low to make the chip "always on".
Assuming STROBE is low, then if Sel (your logic signal 9) is low, Y will have the same logic level as A. If Sel is high, Y will have the same logic level as B. So, if you wire up the chips with your logic signals 1-2-3-4-5-6-7-8 as shown above, when 9 is low, the output will be 1-2-3-4-5-6-7-8. When 9 is high, your output will be
8-7-6-5-4-3-2-1. I guess that's pretty much what you want.You can make the logic signal at pin 9 with your switch like this:
VCC + | .-. | |10K SW1 | | '-' _/ | 9 .--o/ o--o---->
| === GND created by Andy´s ASCII-Circuit v1.24.140803 Beta
The HC family is made for 5V logic. If your requirements are different, this solution might not work for you. In that case, a quad DPDT analog switch or some 4000-series logic or something else might be a better solution.
So, look at these questions to see if this is OK. If any of your answers are different than these, you'll have to describe your problem a little better to get another answer:
5V power supply: YES 5V logic: YES Digital signals: YES High speed requirements: NOGood luck Chris