HDLBits Solution: 2 to 1 Multiplexer

This quiz required me to create 2 to 1 multiplexer. This is one of the easiest quiz on HDLBits website.

Here is my code for this quiz.

module top_module(
input a, b, sel,
output out );

always@(sel)begin
case(sel)
1’b0 : out =a;
1’b1 : out =b;
endcase
end


endmodule

Reference:https://hdlbits.01xz.net/wiki/Mux2to1

Leave a Reply

Your email address will not be published. Required fields are marked *