Tuesday, 2 August 2016

Dmux

Dmux: 1x2


module demux1x2(y,s,i);
    output [1:0] y;
    input s;
    input i;

assign y[0] = (~s) & i;
assign y[1] = s & i;

endmodule


Dmux: 1x4:


module demux1x4(y,i,s);
    output [3:0] y;
    input i;
    input [1:0] s;
assign y[0] = (~s[1] & ~ s[0] & i);
assign y[1] = (~s[1] & s[0] & i);
assign y[2] = (s[1] & ~s[0] & i);
assign y[3] = (s[1] & s[0] & i);

endmodule

0 comments:

Post a Comment

if you have any doubt please let me know