TEAHLAB NEW ADDITION
BUILD. SAVE. SHARE.
The world's first and only Integrated Simulator Community.

Four to One Line Multiplexer

The interactive 4 to 1 Line Multiplexer digital logic circuit, with Boolean function and Truth Table
Click on the board to energize the circuit.VHDL Program
FUNCTION TABLE
Input Output
S1 S0 Y
0 0 D0
0 1 D1
1 0 D2
1 1 D3

Introduction

Many of us enjoy the convenience of vending machines. They provide us a snack on the go, and they are not difficult to use. Some vending machines come with keypads requiring us to type the address of the snack or drink that we desire, some come with large pushbuttons. Regardless, all vending machines operate basically the same way. We put in our money and make a selection, and then a treat pops out at the dispenser.

X Y Z F
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1

Table 1: Three input XOR truth table

S1 S0 DATA F
X Y Z F
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1

Table 2: XOR mapped to multiplexer

It is customary to assume that the signal Z is available in both true and complemented forms. Nonetheless, we show the inverter in our design in Figure 2.

The interactive Mux as XOR gate digital logic circuit, with Boolean function and truth table.
Figure 2: Mux as XOR gate

Three input majority function

As shown in Table 3 below, a majority function is a logic circuit whose output is true if more than 50% of the inputs are true. The output is false otherwise.

X Y Z F
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1

Table 3: majority function truth table

There is no specific rule for choosing the most significant bit when building the truth table from the Boolean expression. However, once you build the table, the significance of the bits must coincide with the significance of the selector switches of the multiplexer. We show the mapping in Table 4.

S1 S0 DATA F
X Y Z F
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1

Table 4: majority function mapped to multiplexer

From a multiplexer’s perspective, it is customary to show the relationship between the output F and the input data lines as a function of the selector switches. We do so in Table 5 below. Table 5 is really just a collapsed version of Table 4. In Table 4 each permutation of S1S0 is repeated twice (i.e. 00, 00; 01, 01; etc). Table 5 shows each permutation once.

S1 S0 F
X Y F
0 0 0
0 1 Z
1 0 Z
1 1 1

Table 5: modified truth table

rom Table 5 (or Table 4) we can see that the value of F does not depend on Z when S1S0 = 00 or S1S0 = 11. Figure 3 below shows the circuit implementation of the majority function.

The interactive Majority digital logic circuit, with Boolean function and truth table.
Figure 3: majority circuit

Observation

The procedure we use to implement the two examples with the 4–to–1 multiplexer is straightforward. You can follow the same method to implement any three input function with a 4x1 mux. Indeed the general rule is true: you can implement any n input function with a multiplexer that has n–1 selector switches. The first n–1 inputs are assigned to the selector switches; the last input is treated as the source of data to the multiplexer.


Teahlab on LinkedIn     Teahlab on Facebook