程序清单
(十分频)
module count(clk,clk10);
input clk; //输入的标准标准信号
output clk10; //输出的十分频信号
reg [3:0] n; //分频器
always@(posedge clk)
begin
if(n==4'd9) //每当 n==9 的时候置零
n=4'd0;
else //不是 9 则加一
n=n+1'b1;
end
assign clk10=~n[3]; //连线型,输出接口
endmodule
(与)
module andd(clk1s,clkx,s);
input clk1s; //输入的 1s 信号
input clkx; //输入的待测信号
output s; //输出的相与信号
wire si; //定义的连线型信号输出
评论0