-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathColor.v
69 lines (63 loc) · 1.47 KB
/
Color.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
66
67
68
69
`timescale 1ns / 1ps
module Color(
input [2:0] color,
output reg [2:0] santa,
output reg [2:0] intersection,
output reg [2:0] pedestrian
);
//color decoder start
always @ (*)
begin
case(color)
3'b000: //S1
begin
santa = 3'b010;
intersection = 3'b100;
pedestrian = 3'b100;
end
3'b001:
begin
santa = 3'b110; //S2
intersection = 3'b100;
pedestrian = 3'b100;
end
3'b010:
begin
santa = 3'b100;
intersection = 3'b010; //S3
pedestrian = 3'b100;
end
3'b011:
begin
santa = 3'b100; //S4
intersection = 3'b110;
pedestrian = 3'b100;
end
3'b100:
begin //S5
santa = 3'b100;
intersection = 3'b010;
pedestrian = 3'b010;
end
3'b101:
begin
santa = 3'b100;
intersection = 3'b110; //S6
pedestrian = 3'b110;
end
3'b110:
begin
santa = 3'b100; //S7
intersection = 3'b100;
pedestrian = 3'b100;
end
3'b111:
begin
santa = 3'b100;
intersection = 3'b100; //S8
pedestrian = 3'b100;
end
endcase
end
//color decoder end
endmodule