byte_counter.v

来自「基于802.3以太网的mac源码」· Verilog 代码 · 共 33 行

V
33
字号
module byte_count_module(CLK, RESET, START, BYTE_COUNTER);// Ports declarationinput CLK;input RESET;input START;output [15:0] BYTE_COUNTER;reg [15:0] BYTE_COUNTER;reg [15:0] counter;always @(posedge CLK or posedge RESET)begin   if (RESET == 1) begin	   counter = 16'h0000;   end   // the ack is delayed which starts the counter   else if (START == 1) begin       counter = counter + 8;   endendalways @(posedge CLK)begin   BYTE_COUNTER = counter;endendmodule // End of Module 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?