summaryrefslogtreecommitdiffstats
path: root/mylib/tick_50000.v
diff options
context:
space:
mode:
Diffstat (limited to 'mylib/tick_50000.v')
-rwxr-xr-xmylib/tick_50000.v31
1 files changed, 31 insertions, 0 deletions
diff --git a/mylib/tick_50000.v b/mylib/tick_50000.v
new file mode 100755
index 0000000..45c4166
--- /dev/null
+++ b/mylib/tick_50000.v
@@ -0,0 +1,31 @@
+module tick_50000(CLOCK_IN, CLK_OUT);
+
+ parameter NBIT = 16;
+
+ input CLOCK_IN;
+ output CLK_OUT;
+
+ reg [NBIT-1:0] count;
+
+ reg CLK_OUT;
+
+ initial
+ begin
+ count = 16'd24999;
+ CLK_OUT = 1'b0;
+ end
+
+ always @ (posedge CLOCK_IN)
+ begin
+ if(count == 16'b0)
+ begin
+ CLK_OUT <= ~CLK_OUT;
+ count <= 16'd24999;
+ end
+ else
+ begin
+ count <= count - 1'b1;
+ end
+ end
+
+endmodule \ No newline at end of file