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 [7:0]y);
    wire not_s_0,not_s_1,not_s_2;
    not n1(not_s_0,s[0]);
    not n2(not_s_1,s[1]);
    not n3(not_s_2,s[2]);
    and a0(y[0],not_s_0,not_s_1,not_s_2);
    and a1(y[1],s[0],not_s_1,not_s_2);
    and a2(y[2],not_s_0,s[1],not_s_2);
    and a3(y[3],s[0],s[1],not_s_2);
    and a4(y[4],not_s_0,not_s_1,s[2]);
    and a5(y[5],s[0],not_s_1,s[2]);
    and a6(y[6],not_s_0,s[1],s[2]);
    and a7(y[7],s[0],s[1],s[2]);
endmodule

 

Was this helpful?
Upvote
Downvote