summaryrefslogtreecommitdiff
path: root/techlibs/cmos/counter.v
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-09-14 11:23:45 +0200
committerClifford Wolf <clifford@clifford.at>2013-09-14 11:23:45 +0200
commitbbe5aa446b413c6298a4b0b13f6fabcd6c984cb6 (patch)
tree1553bf01f0c804ae86f887a0304e70395f15052c /techlibs/cmos/counter.v
parent70476e24314454d1cc95a4cba24a3c5efce64d64 (diff)
Added spice backend
Diffstat (limited to 'techlibs/cmos/counter.v')
-rw-r--r--techlibs/cmos/counter.v12
1 files changed, 12 insertions, 0 deletions
diff --git a/techlibs/cmos/counter.v b/techlibs/cmos/counter.v
new file mode 100644
index 00000000..72208bd8
--- /dev/null
+++ b/techlibs/cmos/counter.v
@@ -0,0 +1,12 @@
+module counter (clk, rst, en, count);
+
+ input clk, rst, en;
+ output reg [3:0] count;
+
+ always @(posedge clk)
+ if (rst)
+ count <= 4'd0;
+ else if (en)
+ count <= count + 4'd1;
+
+endmodule