2009年12月28日 星期一

1228 期末考 4_in_1


module top;
system_clk #200 clk1(a);
system_clk #100 clk1(b);
system_clk #50 clk1(c);
system_clk #25 clk1(d);
a4_in_1 n1(f,a,b,c,d);
endmodule

module a4_in_1(f,a,b,c,d);
input a,b,c,d;
output f;
wire f1,f2,f3,f4,f5;
wire a1,b1,c1,d1;
not(a1,a);
not(b1,b);
not(c1,c);
not(d1,d);
and(f1,c,d);
and(f2,a1,b1,c);
and(f3,a1,b,d);
and(f4,a,b,c);
and(f5,a,b1,c1,d1);
or(f,f1,f2,f3,f4,f5);
endmodule

module system_clk(clk);
parameter PERIOD=100;
output clk;
reg clk;
initial
clk=0;
always
begin
#(PERIOD/2)clk=~clk;
#(PERIOD-PERIOD/2)clk=~clk;
end
always@(posedge clk)
if($time>1000)
#(PERIOD-1)$stop;
endmodule

2009年12月14日 星期一

4_in_1 結構

module top;
system_clk #200 clk1(a);
system_clk #100 clk2(b);
system_clk #50 clk3(c);
system_clk #25 clk4(d);
a4_in_1 n1(f,a,b,c,d);
endmodule

module a4_in_1(f,a,b,c,d);
input a,b,c,d;
output f;
wire c1,d1,x,y;
not(c1,c);
not(d1,d);
and(x,c1,d1);
and(y,c,d1);
or(f,x,y);
endmodule

module system_clk(clk);
parameter PERIOD=100;
output clk;
reg clk;
initial
clk=0;
always
begin
#(PERIOD/2)clk=~clk;
#(PERIOD-PERIOD/2)clk=~clk;
end
always@(posedge clk)
if($time>1000)
#(PERIOD-1)$stop;
endmodule

nanf201 11/30


module top;
wire o,a1;

system_clk #100 clk2(a1);
nanf201 c1 (o,a1);
endmodule


module nanf201(o,a1);
input a1;
output o;
not(o,a1);
specify
specparam
tpd_0_1=1.13:3.09:7.75,
tpd_1_0=0.93:2.5:7.34;
(a1=>o)=(tpd_0_1,tpd_1_0);
endspecify
endmodule


module system_clk(clk);
parameter period=100;
output clk;
reg clk;
initial
clk=0;
always
begin
#(48.7*period/50)clk=~clk;
#(period-48.7*period/50)clk=~clk;
end
always@(posedge clk)
if($time>1000)
#(period-1)
$stop;
endmodule




2009年10月19日 星期一

2009年10月5日 星期一

2009年9月28日 星期一

2009年9月21日 星期一