diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-01-29 12:15:38 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-01-29 12:15:38 +0100 |
commit | cbe77bf84465ea0c4120e865189b07329b862468 (patch) | |
tree | 17728929b55a1ea72fb62b40b7d22a3989ab6de7 /manual/PRESENTATION_Intro/counter.v | |
parent | aceab5fc08ccba493b81cced8f24406ae76ac7bc (diff) |
presentation progress
Diffstat (limited to 'manual/PRESENTATION_Intro/counter.v')
-rw-r--r-- | manual/PRESENTATION_Intro/counter.v | 12 |
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 |