# 4×1 multiplexer design in labview: tutorial 33

In this tutorial I will help you build a 4×1 multiplexer. By the application of control logics to switch one of several input lines to a single common output line, we will design a combinational logic circuit known as a multiplexer. A VI will be designed which will pass one of the input lines to the output depending upon the value give on the selector switch. A 4-to-1 multiplexer will select one value from the 4 input values depending upon the value given to the selector switches and will display the selected input to the output. At the end of the tutorial you are provided with an exercise to do it by yourself, and in the next tutorials I will assume that you have done those exercises and I will not explain the concept regarding them.

### 4×1 multiplexer design in labview

• Now lets’ design a VI performing the operation described above. First of all, create a VI as we have done in tutorial 1 and save it for future use as we have been doing in the entire previous tutorial. From the control palette select Boolean and then select push button as shown in the figure below,

Figure 1: Boolean control

• This push button will be used as a control to give the input to the multiplexer. As we are designing 4×1 multiplexer the number of inputs will be 4 and hence the number of controls needed. Place 4 similar push buttons on the front panel and name them as I0, I1, I2, I3 as shown in the figure below,

Figure 2: Control inputs

• To differentiate the selector switch controls from the input controls we will use toggle switch instead of push button for selector switches. From the control palette on the front panel select Boolean and then select Toggle switch as shown in the figure below,

Figure 3: Toggle switches

• Place two such toggle switches for two selector switches and label them properly as shown in the figure below,

Figure 4: Selector switch

• As a 4×1 uses multi input AND gate and a multi input (more than 2) OR gate and LabView do not have more than 2 input gates, but LabView have a block named as Compound that will be used as a multi input AND and OR gate. On the block diagram panel click right and from the function palette select Boolean and then select compound arithmetic as shown in the figure below,

Figure 5: Compound block placement

• Place four compound blocks next to four input controls as shown in the figure below,

Figure 6: Blocks placed on block diagram window

• In order to change the mode of compound block to AND right click on the block and select change mode and then select AND as shown in the figure below,

Figure 7: Changing compound mode

• This mux will need the input from the selector switches as it is and also the NOT version of the input from the selector switches. Therefore we will need a NOT gate also to do the NOT operation required. From the function palette select Boolean and then select NOT as shown in the figure below,

Figure 8: NOT blocks

• Connect the NOT gate to the selector switches as shown in the figure below,

Figure 9: Not blocks placed

• Now at the input of 1st AND (compound) block connect the NOT S0 wire , NOT S1 wire and the input from I0 as shown in the figure below,

Figure 10: 1st AND block

• At the input of 2ndAND (compound) block connect the S0 wire, NOT S1 wire and the input from I1 as shown in the figure below,

Figure 11: 2nd AND block

• At the input of 3rd AND (compound) block connect the NOT S0 wire, S1 wire and the input from I2 as shown in the figure below,

Figure 12: 3rd AND block

• At the input of 4th  AND (compound) block connect the  S0 wire, S1 wire and the input from I3 as shown in the figure below,

Figure 13: 4th AND block

• Now to OR the output of all the AND gates we will need a four input OR gate, which is not present in LabView, for this purpose we will again use the compound block and change its mode to OR as shown in the figure below,

Figure 14: Changing compound mode to OR

• At the input of this block connect the outputs from the four AND gates and at the output of it create an indicator as shown in the figure below,

Figure 15: Or compound

• The complete block diagram of a 4×1 mux is shown in the figure below,

Figure 16: Complete block diagram

• Run the VI by using the run arrow or by pressing <Ctrl+R> the output is shown in the figure below,

Figure 17: Output 1

• Now set the value of selector switch to 10 in binary which is equal to 3 in decimal numbers and the value at the 3rd input i.e. I2 will be transferred to the output as shown in the figure below,

Figure 18: Output 2

Exercise:

• Evaluate the remaining states of the 4×1 multiplexer.

Design a VI that will undergo the operation done by 8×1 multiplexer

<<Previous tutorial                                         Next tutorial>>