summaryrefslogtreecommitdiff
path: root/DisplayController.v
diff options
context:
space:
mode:
authorMichael Abed <michaelabed@gmail.com>2012-03-21 13:17:47 -0400
committerMichael Abed <michaelabed@gmail.com>2012-03-21 13:17:47 -0400
commit2ac48fa0e44016a6cb49cab84a154eb7ec2dcab4 (patch)
tree9819721233275cee6e39483867818a54299a4fc1 /DisplayController.v
downloadec311-lab4-2ac48fa0e44016a6cb49cab84a154eb7ec2dcab4.tar.gz
ec311-lab4-2ac48fa0e44016a6cb49cab84a154eb7ec2dcab4.tar.bz2
ec311-lab4-2ac48fa0e44016a6cb49cab84a154eb7ec2dcab4.zip
Initial Commit
Diffstat (limited to 'DisplayController.v')
-rw-r--r--DisplayController.v48
1 files changed, 48 insertions, 0 deletions
diff --git a/DisplayController.v b/DisplayController.v
new file mode 100644
index 0000000..1ea2bf1
--- /dev/null
+++ b/DisplayController.v
@@ -0,0 +1,48 @@
+`timescale 1ns / 1ps
+//////////////////////////////////////////////////////////////////////////////////
+// Company:
+// Engineer:
+//
+// Create Date: 16:03:47 03/16/2012
+// Design Name:
+// Module Name: DisplayController
+// Project Name:
+// Target Devices:
+// Tool versions:
+// Description:
+//
+// Dependencies:
+//
+// Revision:
+// Revision 0.01 - File Created
+// Additional Comments:
+//
+//////////////////////////////////////////////////////////////////////////////////
+module DisplayController(
+ input [3:0] A,
+ input [3:0] B,
+ input clk_in,
+ input rst,
+ output [6:0] result,
+ output [3:0] AN
+ );
+
+reg [3:0] AN;
+reg [6:0] result = 0;
+
+wire [6:0] ssd1;
+wire [6:0] ssd2;
+
+reg prev = 0;
+
+SevSegDisp d1(.A(A), .out(ssd1));
+SevSegDisp d2(.A(B), .out(ssd2));
+
+always @( posedge clk_in ) begin
+ prev <= ~prev;
+ result <= prev ? ssd1 : ssd2;
+ AN <= { 2'b11, prev, ~prev };
+end
+
+
+endmodule