Prev Problem
Next Problem

66. Demultiplexer

Back To All Submissions
Previous Submission
Next Submission

Solving Approach

How do you plan to solve it?

 

Code

/*Write your code here*/
module demux1to4 (d,s,y);
input d;
input [1:0]s;
output reg [3:0]y;
always@*
begin
case(s)
2'b00:begin y[0]=d;y[1]=0;y[2]=0;y[3]=0; end
2'b01:begin y[0]=0;y[1]=d;y[2]=0;y[3]=0; end
2'b10:begin y[0]=0;y[1]=0;y[2]=d;y[3]=0; end
2'b11:begin y[0]=0;y[1]=0;y[2]=0;y[3]=d; end
endcase
end
endmodule

 

Was this helpful?
Upvote
Downvote