diff options
author | Michael Abed <michaelabed@gmail.com> | 2012-03-21 13:17:47 -0400 |
---|---|---|
committer | Michael Abed <michaelabed@gmail.com> | 2012-03-21 13:17:47 -0400 |
commit | 2ac48fa0e44016a6cb49cab84a154eb7ec2dcab4 (patch) | |
tree | 9819721233275cee6e39483867818a54299a4fc1 /Increment.v | |
download | ec311-lab4-2ac48fa0e44016a6cb49cab84a154eb7ec2dcab4.tar.gz ec311-lab4-2ac48fa0e44016a6cb49cab84a154eb7ec2dcab4.tar.bz2 ec311-lab4-2ac48fa0e44016a6cb49cab84a154eb7ec2dcab4.zip |
Initial Commit
Diffstat (limited to 'Increment.v')
-rw-r--r-- | Increment.v | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Increment.v b/Increment.v new file mode 100644 index 0000000..b386d13 --- /dev/null +++ b/Increment.v @@ -0,0 +1,32 @@ +`timescale 1ns / 1ps +////////////////////////////////////////////////////////////////////////////////// +// Company: +// Engineer: +// +// Create Date: 14:21:53 03/16/2012 +// Design Name: +// Module Name: Increment +// Project Name: +// Target Devices: +// Tool versions: +// Description: +// +// Dependencies: +// +// Revision: +// Revision 0.01 - File Created +// Additional Comments: +// +////////////////////////////////////////////////////////////////////////////////// +module Increment( + input btn, + output [3:0] value + ); + +reg [3:0] value = 0; + +always @ ( posedge btn ) begin + value = value == 9 ? 0 : value + 1; +end + +endmodule |