forked from smSafiHaider/Physiotherapic-TRex-Game
-
Notifications
You must be signed in to change notification settings - Fork 0
/
segmentDecoder.v
41 lines (31 loc) · 1.22 KB
/
segmentDecoder.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
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 12/15/2021 06:59:25 AM
// Design Name:
// Module Name: segmentDecoder
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module segmentDecoder(D,S);
input [3:0] D;
output [6:0] S;
assign S[0] = (~D[3]&~D[2]&~D[1]&D[0]) | (D[3]&D[2]&~D[1]&D[0]) | (~D[3]&D[2]&~D[1]&~D[0]) | (D[3]&~D[2]&D[1]&D[0]);
assign S[1] = (~D[3]&D[2]&~D[1]&D[0]) | (D[3]&D[1]&D[0]) | (D[3]&D[2]&~D[0]) | (D[2]&D[1]&~D[0]);
assign S[2] = (D[3]&D[2]&~D[0]) | (~D[3]&~D[2]&D[1]&~D[0]) | (D[3]&D[2]&D[1]);
assign S[3] = (~D[3]&~D[2]&~D[1]&D[0]) | (~D[3]&D[2]&~D[1]&~D[0]) | (D[3]&~D[2]&D[1]&~D[0]) | (D[2]&D[1]&D[0]);
assign S[4] = (~D[3]&D[0]) | (~D[2]&~D[1]&D[0]) | (~D[3]&D[2]&~D[1]);
assign S[5] = (~D[3]&~D[2]&D[0]) | (~D[3]&~D[2]&D[1]) | (~D[3]&D[1]&D[0]) | (D[3]&D[2]&~D[1]&D[0]);
assign S[6] = (~D[3]&~D[2]&~D[1]) | (D[3]&D[2]&~D[1]&~D[0]) | (~D[3]&D[2]&D[1]&D[0]);
endmodule