-
Notifications
You must be signed in to change notification settings - Fork 0
/
combo.v
65 lines (61 loc) · 1.64 KB
/
combo.v
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
60
61
62
63
64
65
`timescale 1ns / 1ps
module combo(combo,LED);
input [3:0] combo;
output reg[15:0]LED;
reg [6:0]delay;
reg[3:0] LED_delay;
reg bright = 0;
always@(combo or delay)
begin
case(combo)
4'd0: LED = 16'b0000000000000000;
4'd1: LED = 16'b0000000000000001;
4'd2: LED = 16'b0000000000000011;
4'd3: LED = 16'b0000000000000111;
4'd4: LED = 16'b0000000000001111;
4'd5: LED = 16'b0000000000011111;
4'd6: LED = 16'b0000000000111111;
4'd7: LED = 16'b0000000001111111;
4'd8: LED = 16'b0000000011111111;
4'd9: LED = 16'b0000000111111111;
4'd10: LED = 16'b0000001111111111;
4'd11: LED = 16'b0000011111111111;
4'd12: LED = 16'b0000111111111111;
4'd13: LED = 16'b0001111111111111;
4'd14: LED = 16'b0011111111111111;
4'd15: LED = 16'b0111111111111111;
endcase
/*if(combo == 4'd15)
begin
delay = 0;
bright = 1;
end;
if(delay[6] == 0 && bright == 1)
begin
delay = delay +1;
case(LED_delay)
4'd0: LED = 16'b0000000000000000;
4'd1: LED = 16'b0000000000000001;
4'd2: LED = 16'b0000000000000011;
4'd3: LED = 16'b0000000000000111;
4'd4: LED = 16'b0000000000001111;
4'd5: LED = 16'b0000000000011111;
4'd6: LED = 16'b0000000000111111;
4'd7: LED = 16'b0000000001111111;
4'd8: LED = 16'b0000000011111111;
4'd9: LED = 16'b0000000111111111;
4'd10: LED = 16'b0000001111111111;
4'd11: LED = 16'b0000011111111111;
4'd12: LED = 16'b0000111111111111;
4'd13: LED = 16'b0001111111111111;
4'd14: LED = 16'b0011111111111111;
4'd15: LED = 16'b0111111111111111;
endcase
LED_delay = LED_delay+1;
end
if(delay[6] == 1 && bright == 1)
begin
bright = 0;
end*/
end
endmodule