Create Multiplexer Inputs In0 7 0 In1 7 0 Sel Output O 7 0 Output O 7 0 In0 7 0 Sel 0 In1 Q37062781

Create multiplexer with inputs in0[7:0], in1[7:0], sel andoutput o[7:0].
The output o[7:0] is in0[7:0] if sel=0 and in1[7:0] when sel=1.Verilog code


Solution


the input is 8 bit and the output is 8 bit too.. It is a 2:1 muximplementation with 8 bit values. The only logic required is switchvalue of select if it is 0 output is in0 if it is 1 output isin1.

The code is always put in a always @ block

verilog code for the mux as below with comments

/*
* module to work with in0 in1 sel and 0
*no need of specifying the bits here
*/
module main(
in0, , // Mux first

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.