Advertisement
1WaKa_WaKa1

counter

Apr 6th, 2023
788
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. `timescale 1ns / 1ps
  2.  
  3. module counter(clk, rst, en, count);
  4.     input clk, rst, en;
  5.     output reg[31:0] count = 0;
  6.    
  7.     always@ (posedge clk or posedge rst) begin
  8.         if (rst) begin
  9.              count <=0;
  10.         end else if (en) begin
  11.             count <= count +1;
  12.         end
  13.     end    
  14. endmodule
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement