diff options
Diffstat (limited to 'mylib/counter_10.v')
-rwxr-xr-x | mylib/counter_10.v | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/mylib/counter_10.v b/mylib/counter_10.v new file mode 100755 index 0000000..72c96fa --- /dev/null +++ b/mylib/counter_10.v @@ -0,0 +1,18 @@ +`timescale 1ns / 100ps
+
+module counter_10(clock,enable,count);
+
+ parameter BIT_SZ = 10;
+ input clock;
+ input enable;
+ output [BIT_SZ-1:0] count;
+
+ reg [BIT_SZ-1:0] count;
+
+ initial count = 0;
+
+ always @ (posedge clock)
+ if(enable == 1'b1)
+ count <= count + 1'b1;
+
+endmodule
\ No newline at end of file |