forked from Spartibartfast/4550-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathled_controller.v
More file actions
59 lines (54 loc) · 1.41 KB
/
led_controller.v
File metadata and controls
59 lines (54 loc) · 1.41 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
module LED_CONTROLLER (
clock27,
led_r,
led_g,
keyPressed,
keyDataOut,
letter,
number
);
reg [9:0] r_led_value = 10'b0000000000;
reg [8:0] g_led_value = 8'b11111111;
input [1:0] clock27;
input [1:0] keyPressed;
input [8:0] keyDataOut;
input [7:0] letter;
input [7:0] number;
output [9:0] led_r; // also 9 corresponding led's (red)
output [7:0] led_g; // the other 9 led's (green)
// The positive edge of clock 27 -> 27Hz clock...
always @ ( posedge clock27 )
begin
r_led_value[9:0] <= keyDataOut;
if ( keyDataOut == 8'h1C || // A
keyDataOut == 8'h32 || // B
keyDataOut == 8'h21 || // C
keyDataOut == 8'h23 || // D
keyDataOut == 8'h24 || // E
keyDataOut == 8'h2B || // F
keyDataOut == 8'h34 || // G
keyDataOut == 8'h33 || // H
keyDataOut == 8'h43 || // I
keyDataOut == 8'h3B || // J
keyDataOut == 8'h16 || // 1
keyDataOut == 8'h1E || // 2
keyDataOut == 8'h26 || // 3
keyDataOut == 8'h25 || // 4
keyDataOut == 8'h2E || // 5
keyDataOut == 8'h36 || // 6
keyDataOut == 8'h3D || // 7
keyDataOut == 8'h3E || // 8
keyDataOut == 8'h46 || // 9
keyDataOut == 8'h45 ) // 0 -> 10
begin
g_led_value = keyDataOut[7:0];
end
/*else
begin
g_led_value = 8'b00000000;
end*/
end
// Assign is a continous non-blocking operation...
assign led_r = r_led_value;
assign led_g = g_led_value ;
endmodule