module top;
wire a,b,c,d;
wire out;
system_clock #800 clock1(a);
system_clock #400 clock2(b);
system_clock #200 clock3(c);
system_clock #100 clock4(d);
not n0(nota,a);
not n1(notb,b);
not n2(notc,c);
not n3(notd,d);
and a0(f0,nota,notc,d);
and a1(f1,nota,c,notd);
and a2(f2,notb,notc,d);
and a3(f3,notb,c,notd);
or o0(out,f0,f1,f2,f3);
endmodule
module system_clock(clk);
parameter PERIOD=100;
output clk;
reg clk;
initial clk=0;
always
begin
#(PERIOD/2) clk=~clk;
end
always@(posedge clk)
if($time>2000)$stop;
endmodule
沒有留言:
張貼留言