delay.v
来自「DesignWave 2005 8 Verilog Example」· Verilog 代码 · 共 38 行
V
38 行
/* -------------------------------------------------------------
Synthesis & Fitter tool = "QuartusII5.0WE"
FileName = Delay.v
M.YOSHIDA 15.MAY.2005 REV 1.0
------------------------------------------------------------- */
// Module Declaration
module Delay ( clk,
rstn,
start
);
// port declaration
input clk, rstn;
output start;
// reg & wire declaration
reg [15:0] cnt;
always @( posedge clk or negedge rstn ) begin
if( !rstn ) begin
cnt <= 16'h0;
end
else begin
if( cnt == 16'hffff ) begin
cnt <= cnt;
end
else begin
cnt <= cnt + 1'b1;
end
end
end
assign start = ( cnt == 16'hffff );
endmodule
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?