# Multiplexer

Discussion in 'General Electronics Discussion' started by dwn, Mar 14, 2015.

1. ### dwn

7
1
Feb 22, 2015
Hello,

I am studying digital electronics and currently having a little difficulty constructing circuits based on a boolean statement. The circuit I am trying to build is one using an 8 to 1 multiplexer. I clearly understand the concept of the multiplexer, in that it directs the output based on certain inputs -- in my case, 3 switches. I have attached an image to help clarify the circuit I am trying to build.
What I don't understand is how do we determine where to hook up the input terminals (D0 to D7)? I have constructed a truth table from the boolean equation; however, I'm not sure if it is accurate, but if it is, how to then transfer that logic to the MUX.

Any explanation anyone can offer would be very helpful. Thank you.

File size:
44.4 KB
Views:
263
File size:
63 KB
Views:
193
2. ### hevans1944Hop - AC8NS

4,703
2,202
Jun 21, 2012
The 74151 will select one, and only one, of its D0, ... , D7 data inputs for presentation at the Y output on pin 5, based on the input-select bits A,B,C. This can be used to implement Boolean logic by connecting appropriate D0, ... , D7 inputs to either logic "1" (Vcc) or logic "0" (GND) levels. The Boolean equation you have given for Y resolves to D3 or D6 or D4 or D5. So connect those inputs to logic "1" and connect the remaining data inputs to logic "0". The Y output will then satisfy the specified Boolean equation for any combination of A, B, and C.

You should flll out an eight row truth table showing C, B, A at the top and highlight the rows that result in Y=1 for the given Boolean expression. For the example given: CBA = 011 or 110 or 100 or 101 all produce Y=1 so D3, D6, D4, and D5 are connected to logic "1" and the other data inputs are connected to ground.

dwn likes this.
3. ### dwn

7
1
Feb 22, 2015
hevans, thank you for clarifying all of this for me. After reading your explanation, the MUX makes much more sense to me now. I understand the purpose of it, but was having some difficulty with the implementation.

I've reconstructed my circuit however and my outputs are inaccurate. 001, 010, and 111 all light up when they shouldn't while 100 does not like up and it should. 011, 101, and 110 all light up.

File size:
18.7 KB
Views:
436
4. ### hevans1944Hop - AC8NS

4,703
2,202
Jun 21, 2012
Your circuit does not implement the Boolean equation Y = /CBA + CB/A + C/B/A + CBA, where the "/" prefix denotes complement (since I don't know how to put a bar on top of a letter). So, wherever there is a "/" prefix to a variable, substitute a 0 and where there is not a "/" prefix substitute a 1 for the variables in the Boolean equation. After doing this, Y = 011 + 110 + 100 + 101, where it is understood that each of the 3-bit sequences represents a particular value for CBA.in the order given and the value of Y = 1 when those bit patterns are applied to the multiplexor CBA inputs.

There are actually eight possible values for CBA, but we are only interested in the values that make Y = 1. See truth table below.

C B A Y=
0 0 0 D0
0 0 1 D1
0 1 0 D2
0 1 1 D3
1 0 0 D4
1 0 1 D5
1 1 0 D6

1 1 1 D7

Y = /CBA + CB/A + C/B/A + C/BA (Boolean equation)
= 011 + 110 + 100 + 101 (CBA values that make Y = 1)
= D3 + D6 + D4 + D5 (Multiplexor inputs that must be set to 1 to make Y = 1)

You are using an inverter, U1A to make D0, D1, D2, and D7 the logical complements of D3, D4, D5, and D6. Nothing wrong with that, but the inverter input is also connected to C, so whenever the corresponding switch on S1 makes C = 0 it also makes D3, D4, D5, and D6 also equal to zero. This is not in agreement with the Boolean equation! We want those inputs to always be at logic "1" level!

You can fix this problem by permanently disconnecting the U1A input connected to S1 and then connecting the U1A input to a logic "1" level through another pull-up resistor tied to +Vcc. However, that "wastes" a pull-up resistor where none is needed. Instead, connect U1A input to logic "0" or ground, which will force U1A output to logic "1" level. You will then need to connect D3, D4, D5, and D6 inputs to U1A output and connect D0, D1, D2, and D7 inputs to ground.

The multiplexor inputs C, B, and A are connected only to S1, with the pull-up resistors as you have shown.

5. ### Laplace

1,252
185
Apr 4, 2010
Could not grok this problem until hevans1944 posted his clarification. This is the equivalent of a look-up table with a 8x1 bit ROM except instead of programming the 8 ROM bits, in this case the 8 data inputs to the multiplexer are hardwired. For an explanation of look-up table logic see http://www.allaboutcircuits.com/vol_4/chpt_16/2.html

hevans1944 likes this.
6. ### hevans1944Hop - AC8NS

4,703
2,202
Jun 21, 2012
Using the 74151 as a Boolean equation "solver" is a perversion of its original intent: to select one of eight data inputs and transfer that input to the Y output. Sure, you can hardwire the data inputs to binary constants to create any arbitrary Boolean function of three variables, duplicating as @Laplace said, an 8x1 bit ROM. And the datasheet does indeed say you can use the IC in this manner.

But why bother? Well, maybe it is useful as a teaching aid. A handful of NAND and NOR gates can be also be wired to do the same thing, and along the way you will learn a lot more about things such as DeMorgan's Laws and how to reduce a truth-table to a minimal two-stage combinatorial logic using Karnaugh Maps.

One of my favorite uses of the 74151 was as a clock selector. The data inputs were connected to selected outputs of a binary divider chain (up to eight outputs, the binary divider can be any length) and the divided clock signals were then available at the Y output, as selected by "address" bit inputs ABC. Perhaps a more conventional use is to select one of eight serial data streams for further processing at the Y output. Or you can apply parallel data to the data inputs and convert this data to serial output at Y by sequencing through all eight combinations of ABC inputs. Good luck adding start, stop, and parity bits if your intention was to create a UART, but that is possible. This predates UART integrated circuits of course, which were, literally, universally used just as soon as they were invented. Want more ideas? How about using eight of these multiplexors as a byte selector? The number of applications will boggle the unprepared mind.