2007年12月28日 星期五

Time scales Ex.3

`timescale 1ns/1ps
module The_first_module(y,x1,x2);
input x1,x2;
output y;

nand #(3.213:3.225:3.643,4.112:4.237:4.413) (y,x1,x2);
endmodule


`timescale 10ns/10ns
module The_second_module();
reg x1,x2;
wire y;

The_first_module K1(y,x1,x2);

initial begin
$timeformat(-12,1," ps",10);
$monitor($time,,"%f x1=%b x2=%b y=%b",$realtime,x1,x2,y);
end

initial #30 $finish;

initial begin
#5 x1=0;x2=0;
#5 x2=1;
#5 x1=1;
#5 x2=0;
#5 $stop;
end
endmodule

沒有留言: