summaryrefslogtreecommitdiffstats
path: root/part_2/ex9_final/verilog_files/counter_16.v.bak
diff options
context:
space:
mode:
authorzedarider <ymherklotz@gmail.com>2016-12-01 23:57:19 +0000
committerzedarider <ymherklotz@gmail.com>2016-12-01 23:57:19 +0000
commit81337eb41dca51fcdba7572b0449927732f4f3b5 (patch)
treee7b0af7afa897e754a423b44b0fcd3849afc367b /part_2/ex9_final/verilog_files/counter_16.v.bak
parent6b492b7687c87f80bd530dda5a769c635b855ea4 (diff)
downloadVerilogCoursework-81337eb41dca51fcdba7572b0449927732f4f3b5.tar.gz
VerilogCoursework-81337eb41dca51fcdba7572b0449927732f4f3b5.zip
adding part 2 and 3
Diffstat (limited to 'part_2/ex9_final/verilog_files/counter_16.v.bak')
-rwxr-xr-xpart_2/ex9_final/verilog_files/counter_16.v.bak21
1 files changed, 21 insertions, 0 deletions
diff --git a/part_2/ex9_final/verilog_files/counter_16.v.bak b/part_2/ex9_final/verilog_files/counter_16.v.bak
new file mode 100755
index 0000000..c0ec549
--- /dev/null
+++ b/part_2/ex9_final/verilog_files/counter_16.v.bak
@@ -0,0 +1,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 \ No newline at end of file