1: 4 디멀티플렉서를 Verilog코드로 구현 후 Simulation 까지 진행해보도록 하겠습니다.

위 회로도를 참고하여 코드를 짜보겠습니다.

`timescale 1ns / 1ps
module demux_1_4(
input D,
input [1:0] S,
output [3:0] F
);
wire [1:0] Sbar;
not ( Sbar[0], S[0]);
not ( Sbar[1], S[1]);
and (F[0], D, Sbar[1], Sbar[0]);
and (F[1], D, Sbar[1], S[0]);
and (F[2], D, S[1], Sbar[0]);
and (F[3], D, S[1], S[0]);
endmodule
simulation을 돌려보겠습니다.
D의 Force Clock은 100ns의 값을 주었으며
S는 10000ns, 20000ns까지의 값을 주었습니다.
그 후 10us만큼 RUN 하였습니다.
출력이 잘 나온것을 확인하였습니다.
