-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclockDivider.v
More file actions
33 lines (28 loc) · 918 Bytes
/
clockDivider.v
File metadata and controls
33 lines (28 loc) · 918 Bytes
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
31
32
33
// --------------------------------------------------------------------
// --------------------------------------------------------------------
// Module:clockDivider
//
// Author: george
//
// Description: divide the clock
//
//
// --------------------------------------------------------------------
// Code Revision History :
// --------------------------------------------------------------------
// Version: |Mod. Date: |Changes Made:
// V1.0 |2021/01/11 |Initial ver
// --------------------------------------------------------------------
///////////////////////////
module clockDivider (clk, clk_out);
input clk;
output clk_out;
parameter n = 1;
reg [n-1:0] count;
wire [n-1:0] nextcount;
always @(posedge clk) begin
count <= nextcount;
end
assign nextcount = count + 1'b1;
assign clk_out = count[n-1];
endmodule