summaryrefslogtreecommitdiffstats
path: root/part_2/ex9/verilog_files/counter_16.v.bak
blob: c0ec54918d62b5eae403729e00e121c55c1b06be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
`timescale 1ns / 100ps

module counter_16(clock,enable,reset,count);

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