-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcounter.v
30 lines (30 loc) · 822 Bytes
/
counter.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer: Het soni
//
// Create Date: 17:27:44 10/11/2022
// Design Name:
// Module Name: counter
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module counter(count,enable,clk,rst_n);
input enable,clk,rst_n;
output reg[3:0] count;
always @(posedge clk or negedge rst_n)
begin
if(~rst_n) counter <= 4'b0000;
else if(enable)
counter <= counter + 4'b0001;
end //fpga4student.com: FPga projects, Verilog projects, VHDL projects
endmodule