summaryrefslogtreecommitdiff
path: root/part_3/mylib/divider_5000.v
blob: 2e5e20e6651d968b7781877c6ac4843dd2797ab1 (plain)
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
`timescale 1ns / 100ps


module divider_5000 (
		clock,
		out
		);
		
		parameter BIT_SZ = 16;
		input clock;
		reg [BIT_SZ-1:0] count;
		
		initial count = 0;
		
		output reg out;
		
		
		always @ (posedge clock)
		begin
			if (count < 16'd5000)
				begin
				count <= count + 1'b1;
				out <= 1'b0;
				end
			else
				begin
				out <= 1'b1;
				count <= 1'b0;		
				end
		end
endmodule