-
Notifications
You must be signed in to change notification settings - Fork 0
/
seven_seg.v
40 lines (37 loc) · 950 Bytes
/
seven_seg.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
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 10/26/2022 07:04:40 PM
// Design Name:
// Module Name: seven_seg
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module seven_seg(
input wire[3:0] bcd,
output wire[6:0] segment
);
assign segment =
(bcd == 0) ? 7'b1111110 :
(bcd == 1) ? 7'b0110000 :
(bcd == 2) ? 7'b1101101 :
(bcd == 3) ? 7'b1111001 :
(bcd == 4) ? 7'b0110011 :
(bcd == 5) ? 7'b1011011 :
(bcd == 6) ? 7'b1011111 :
(bcd == 7) ? 7'b1110000 :
(bcd == 8) ? 7'b1111111 :
(bcd == 9) ? 7'b1110011 :
7'b0000000;
endmodule