summaryrefslogtreecommitdiff
path: root/manual/PRESENTATION_Intro/counter.v
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-01-29 12:15:38 +0100
committerClifford Wolf <clifford@clifford.at>2014-01-29 12:15:38 +0100
commitcbe77bf84465ea0c4120e865189b07329b862468 (patch)
tree17728929b55a1ea72fb62b40b7d22a3989ab6de7 /manual/PRESENTATION_Intro/counter.v
parentaceab5fc08ccba493b81cced8f24406ae76ac7bc (diff)
presentation progress
Diffstat (limited to 'manual/PRESENTATION_Intro/counter.v')
-rw-r--r--manual/PRESENTATION_Intro/counter.v12
1 files changed, 12 insertions, 0 deletions
diff --git a/manual/PRESENTATION_Intro/counter.v b/manual/PRESENTATION_Intro/counter.v
new file mode 100644
index 00000000..36b878e3
--- /dev/null
+++ b/manual/PRESENTATION_Intro/counter.v
@@ -0,0 +1,12 @@
+module counter (clk, rst, en, count);
+
+ input clk, rst, en;
+ output reg [1:0] count;
+
+ always @(posedge clk)
+ if (rst)
+ count <= 2'd0;
+ else if (en)
+ count <= count + 2'd1;
+
+endmodule