Multiplexer design in Verilog
The multiplexer is an essential digital circuit to select one of different inputs, we are going to illustrate the different methods of implementing multiplexers in verilog, the same codes can be used for more number of inputs by increasing the select input width to cover all input numbers
1- using assign statement :
2- using if statement :
​
3- using case statement :
​
All of the 3 coding styles will results in the implementation of the 2x1 multiplexer, the following figure shows the RTL view for the code in the 3 cases