forked from Spartibartfast/4550-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhex_controller.v
More file actions
43 lines (39 loc) · 891 Bytes
/
hex_controller.v
File metadata and controls
43 lines (39 loc) · 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
module HEX_CONTROLLER (
clock27,
numDisplay0,
numDisplay1,
numDisplay2,
numDisplay3,
playerTurn,
keyboardData
);
input [1:0] clock27;
output [6:0] numDisplay0;
output [6:0] numDisplay1; // The number entered in
output [6:0] numDisplay2; // The letter entered in
output [6:0] numDisplay3; // Which player's turn it is
reg [6:0] t_display0;
reg [6:0] t_display1;
reg [6:0] t_display2;
reg [6:0] t_display3;
input playerTurn;
input keyboardData;
always @ ( posedge clock27 )
begin
if ( playerTurn == 0 )
begin
t_display3 = 7'b1111001; // Player 1
end
else
begin
t_display3 = 7'b0100100; // Player 2
end
t_display0 = 7'b1111111;
t_display1 = 7'b1111111;
t_display2 = 7'b1111111;
end
assign numDisplay0 = t_display0;
assign numDisplay1 = t_display1;
assign numDisplay2 = t_display2;
assign numDisplay3 = t_display3;
endmodule