ecasha
Junior Member level 2
Hey,I have written verilog code for the 1:2 demux,I want to activate the outputs one after the other without giving select inputs manually.When I run it ,its showing the only f2 output.I want to see both outputs i.e first when select =0 and select=1 one after the other.How to rectify it?
Above is the output what I am getting.
Code:
module trrrrr(FIS,f0,f1);
input FIS;
wire FIS;
output f0,f1;
reg f0,f1;
integer slct=0;
always @(FIS) begin
for(slct=0;slct <= 1'b1;slct = slct+1)begin
if (slct== 1'b0)begin
f0=FIS;
f1=0;
end
else begin
f0=0;
f1=FIS;
end
end
end
endmodule
Above is the output what I am getting.