Prev Problem
Next Problem

50. 3-Way Selector

Back To All Submissions
Previous Submission
Next Submission

Solving Approach

How do you plan to solve it?

 

 

Code

/*Write solution code here*/
module selector3(
    input [7:0] a, b, c,
    input [1:0] sel,
    output [7:0] y
);
    assign y = (sel == 2'b00) ? a :
               (sel == 2'b01) ? b :
               (sel == 2'b10) ? c : 8'h00;
endmodule

 

Was this helpful?
Upvote
Downvote