Electronic – How to write this circuit (returns 1 if the number of 1s in input is odd, otherwise returns 0) using a MUX

digital-logicmultiplexer

Here is the truth table:

enter image description here

The exercise is to write the SOP of this truth table using a multiplexer with 2 select lines and 4 inputs. I got the SOP expression:
$$(\lnot a\lnot b c)+(\lnot a b \lnot c) + (a \lnot b \lnot c) + (abc)$$

I assume that each expression in the parenthesis is one of those 4 inputs.

I understand how a multiplexer works I just don't understand exactly how I am supposed to apply it here. My professor wants us to use a 74151 chip. Here is the datasheet
enter image description here

I think I am only supposed to use one of those 2 outputs…

The question is: "Write the SOP expression so as to implement a multiplexer with 4 inputs and 2 selectors. Use the chip 74151 and NOT gates if necessary".

I don't understand the idea behind using a multiplexer here. Can someone explain? Thanks

Best Answer

It is absolutely trivial to implement a 3-input Boolean function using an 8-to-1 mux because, literally, an 8-to-1 mux's function is, given three bits of "select" input, choose one of its eight data inputs. What is a truth table, if not that precise definition, using a mux whose data inputs are degenerately connected to HIGH and LOW values?

Here's a visual that might help, mapping a 2x1 mux schematic symbol to it's truth table.

schematic

simulate this circuit – Schematic created using CircuitLab

But like I said, that is trivial. A more interesting question is, can you do the same thing with a smaller 4-to-1 MUX. Start with the truth table, and for a start consider the first two rows:

b2 b1 b0 v
0  0  0  0
0  0  1  1

When b2=0 and b1=0, v = b0... now map that to the behavior of a 4-to-1 multiplexer where b2 and b1 are your select bits. When b2 = 0 and b1 = 0, then multiplexer input 0 = b0. Carry on that reasoning for the subsequent three pairs of rows and you can implement any three input boolean function using a 4-to-1 mux, but you will, as I commented earlier, need access to an inverter and LOW and HIGH in many cases to pull this off.

A clever trick... you can use a similar reasoning to demonstrate for yourself that a 2x1 mux represents a universal gate, similar to NAND and NOR. The proof is left as an exercise to the reader.