Prev Problem
Next Problem

67. Decoder

Back To All Submissions
Previous Submission
Next Submission

Solving Approach

How do you plan to solve it?

 

Code

/*Write your code here*/
module decoder3to8(
    input [2:0] s,
    output reg [7:0] y
);
    // assign y = (8'b0000_0001 << s);
    always @* begin
        y = 8'b0000_0000;
        y[s] = 1'b1;
    end

endmodule

 

Was this helpful?
Upvote
Downvote