2014年9月29日 星期一

新手入門

9/30學習內容
主要學會如何使用邏輯閘

module top;  module //xxxß將一個電路板命名為xxx//



wire A, B, OUT   //wire
電路板的線//
system_clock #400 clock1(A);
system_clock #200 clock2(B);

and a1(OUT, A, B);

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>1000)$stop;

endmodule 

沒有留言:

張貼留言