OpenCores
URL https://opencores.org/ocsvn/numbert_sort_device/numbert_sort_device/trunk

Subversion Repositories numbert_sort_device

[/] [numbert_sort_device/] [trunk/] [utility/] [SEG7_LUT.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 leshabiruk
 
2
module dbg_7seg ( val, show_next, part, is_first );
3
 
4
input wire [ 63 :0 ] val;
5
input wire show_next;
6
output wire [15:0]part= curr[1]==0 ?
7
                                                                        ( curr[0]==0 ? val[15:0] : val[31:16] ) :
8
                                                                        ( curr[0]==0 ? val[47:32] : val[63:48] );
9
output wire is_first= (curr==0);
10
 
11
 
12
reg [1:0] curr;
13
initial curr= 0;
14
 
15
always @(posedge show_next)
16
begin
17
        curr <= curr+1;
18
end
19
 
20
endmodule
21
 
22
module SEG7_LUT_4 (     oSEG0,oSEG1,oSEG2,oSEG3,iDIG );
23
input   [15:0]   iDIG;
24
output  [6:0]    oSEG0,oSEG1,oSEG2,oSEG3;
25
 
26
SEG7_LUT        u0      (       oSEG0,iDIG[3:0]  );
27
SEG7_LUT        u1      (       oSEG1,iDIG[7:4] );
28
SEG7_LUT        u2      (       oSEG2,iDIG[11:8]        );
29
SEG7_LUT        u3      (       oSEG3,iDIG[15:12]       );
30
 
31
endmodule
32
 
33
module SEG7_LUT (       oSEG,iDIG       );
34
input   [3:0]    iDIG;
35
output reg      [6:0]    oSEG;
36
 
37
always @(iDIG)
38
begin
39
                case(iDIG)
40
                4'h1: oSEG = 7'b1111001;        // ---t----
41
                4'h2: oSEG = 7'b0100100;        // |      |
42
                4'h3: oSEG = 7'b0110000;        // lt    rt
43
                4'h4: oSEG = 7'b0011001;        // |      |
44
                4'h5: oSEG = 7'b0010010;        // ---m----
45
                4'h6: oSEG = 7'b0000010;        // |      |
46
                4'h7: oSEG = 7'b1111000;        // lb    rb
47
                4'h8: oSEG = 7'b0000000;        // |      |
48
                4'h9: oSEG = 7'b0011000;        // ---b----
49
                4'ha: oSEG = 7'b0001000;
50
                4'hb: oSEG = 7'b0000011;
51
                4'hc: oSEG = 7'b1000110;
52
                4'hd: oSEG = 7'b0100001;
53
                4'he: oSEG = 7'b0000110;
54
                4'hf: oSEG = 7'b0001110;
55
                4'h0: oSEG = 7'b1000000;
56
                endcase
57
end
58
 
59
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.