-
Notifications
You must be signed in to change notification settings - Fork 1
/
DisplayDecoder.v
30 lines (29 loc) · 957 Bytes
/
DisplayDecoder.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
module DisplayDecoder(in, out, enable);
input [3:0] in;
input enable;
output reg [6:0] out;
always @(in or enable) begin
if (!enable)
out = 7'b1111111;
else
case (in)
0 : out = 7'b1000000;
1 : out = 7'b1111001;
2 : out = 7'b0100100;
3 : out = 7'b0110000;
4 : out = 7'b0011001;
5 : out = 7'b0010010;
6 : out = 7'b0000010;
7 : out = 7'b1111000;
8 : out = 7'b0000000;
9 : out = 7'b0010000;
10 : out = 7'b0001000;
11 : out = 7'b0000011;
12 : out = 7'b1000110;
13 : out = 7'b0100001;
14 : out = 7'b0000110;
15 : out = 7'b0001110;
default : out = 7'b1111111;
endcase
end
endmodule