summaryrefslogtreecommitdiff
path: root/SevSegDisp.v
diff options
context:
space:
mode:
authorMichael Abed <michaelabed@gmail.com>2012-03-28 09:58:28 -0400
committerMichael Abed <michaelabed@gmail.com>2012-03-28 09:58:28 -0400
commit5d32d4ca9aaf2000e05503457bed1b8f04ca6d62 (patch)
tree1b1d1ff3a6645fd208ae19918d064e2056777e52 /SevSegDisp.v
downloadec311-lab5-5d32d4ca9aaf2000e05503457bed1b8f04ca6d62.tar.gz
ec311-lab5-5d32d4ca9aaf2000e05503457bed1b8f04ca6d62.tar.bz2
ec311-lab5-5d32d4ca9aaf2000e05503457bed1b8f04ca6d62.zip
initial commit
Diffstat (limited to 'SevSegDisp.v')
-rw-r--r--SevSegDisp.v45
1 files changed, 45 insertions, 0 deletions
diff --git a/SevSegDisp.v b/SevSegDisp.v
new file mode 100644
index 0000000..8d2c3b1
--- /dev/null
+++ b/SevSegDisp.v
@@ -0,0 +1,45 @@
+`timescale 1ns / 1ps
+//////////////////////////////////////////////////////////////////////////////////
+// Company:
+// Engineer:
+//
+// Create Date: 16:01:14 03/16/2012
+// Design Name:
+// Module Name: SevSegDisp
+// Project Name:
+// Target Devices:
+// Tool versions:
+// Description:
+//
+// Dependencies:
+//
+// Revision:
+// Revision 0.01 - File Created
+// Additional Comments:
+//
+//////////////////////////////////////////////////////////////////////////////////
+
+module SevSegDisp(
+ input [3:0] A,
+ output [6:0] result
+ );
+
+reg [6:0] result = 0;
+
+always @ ( * ) begin
+ case ( A )
+ 4'b0000 : result = 7'b0000001;
+ 4'b0001 : result = 7'b1001111;
+ 4'b0010 : result = 7'b0010010;
+ 4'b0011 : result = 7'b0000110;
+ 4'b0100 : result = 7'b1001100;
+ 4'b0101 : result = 7'b0100100;
+ 4'b0110 : result = 7'b0100000;
+ 4'b0111 : result = 7'b0001111;
+ 4'b1000 : result = 7'b0000000;
+ 4'b1001 : result = 7'b0001100;
+ default : result = 7'b0011010;
+ endcase
+end
+
+endmodule