module top;
wire a,b,c;
wire sum1,sum2,c_out;
system_clock #100 clock1(a);
system_clock #50 clock1(b);
system_clock #25 clock1(c);
Add_1 myAdd1(sum1,sum2,c_out,a,b,c);
endmodule
module Add_1(sum1,sum2,c_out,a,b,c);
input a,b,c;
output sum1,sum2,c_out;and (sum1,a,~c);
and (sum2,~a,b,c);
or (c_out,sum1,sum2);
endmodule
module system_clock(clk);
parameter PERIOD=100;
output clk;
reg clk;
initialclk=0;
alwaysbegin#(PERIOD/2)clk=~clk;
#(PERIOD-PERIOD/2)clk=~clk;
end
always@(posedge clk)if($time>1000)#(PERIOD-1)$stop;
endmodule