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);
always @* begin
    y[0] = ~s[2] & ~s[1] & ~s[0];
    y[1] = ~s[2] & ~s[1] & s[0];
    y[2] = ~s[2] & s[1] & ~s[0];
    y[3] = ~s[2] & s[1] & s[0];
    y[4] = s[2] & ~s[1] & ~s[0];
    y[5] = s[2] & ~s[1] & s[0];
    y[6] = s[2] & s[1] & ~s[0];
    y[7] = s[2] & s[1] & s[0];
end
endmodule

 

Was this helpful?
Upvote
Downvote