counter.v
来自「design compile synthesis user guide」· Verilog 代码 · 共 29 行
V
29 行
module Counter (count, start, clk, rst);/* Counter module */ input clk; input rst; input start; output [15:0] count; wire clk; reg [15:0] count_N; reg [15:0] count; always @ (posedge clk or posedge rst) begin : counter_S if (rst) begin count = 0; // reset logic for the block end else begin count = count_N; // set specified registers of the block end end always @ (count or start) begin : counter_C count_N = count; // initialize outputs of the block if (start) count_N = 1; // user specified logic for the block else count_N = count + 1; endendmodule
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?