impact 11 renamed the intel flash...
[fpga-games] / galaxian / src / mc_logic.v
1 //===============================================================================
2 // FPGA MOONCRESTA LOGIC IP MODULE
3 //
4 // Version : 1.00
5 //
6 // Copyright(c) 2004 Katsumi Degawa , All rights reserved
7 //
8 // Important !
9 //
10 // This program is freeware for non-commercial use.
11 // An author does no guarantee about this program.
12 // You can use this under your own risk.
13 //
14 //================================================================================
15
16
17 //================================================
18 // 74xx138
19 // 3-to-8 line decoder
20 //================================================
21 module logic_74xx138(
22
23 I_G1,
24 I_G2a,
25 I_G2b,
26 I_Sel,
27 O_Q
28
29 );
30
31 input I_G1,I_G2a,I_G2b;
32 input [2:0]I_Sel;
33 output [7:0]O_Q;
34
35 reg [7:0]O_Q;
36 wire [2:0]I_G = {I_G1,I_G2a,I_G2b};
37 always@(I_G or I_Sel or O_Q)
38 begin
39 if(I_G == 3'b100 )begin
40 case(I_Sel)
41 3'b000: O_Q = 8'b11111110;
42 3'b001: O_Q = 8'b11111101;
43 3'b010: O_Q = 8'b11111011;
44 3'b011: O_Q = 8'b11110111;
45 3'b100: O_Q = 8'b11101111;
46 3'b101: O_Q = 8'b11011111;
47 3'b110: O_Q = 8'b10111111;
48 3'b111: O_Q = 8'b01111111;
49 endcase
50 end
51 else begin
52 O_Q = 8'b11111111;
53 end
54 end
55
56 endmodule
57
58 //================================================
59 // 74xx139
60 // 2-to-4 line decoder
61 //================================================
62 module logic_74xx139(
63
64 I_G,
65 I_Sel,
66 O_Q
67
68 );
69
70 input I_G;
71 input [1:0]I_Sel;
72 output [3:0]O_Q;
73
74 reg [3:0]O_Q;
75 always@(I_G or I_Sel or O_Q)
76 begin
77 if(I_G == 1'b0 )begin
78 case(I_Sel)
79 2'b00: O_Q = 4'b1110;
80 2'b01: O_Q = 4'b1101;
81 2'b10: O_Q = 4'b1011;
82 2'b11: O_Q = 4'b0111;
83 endcase
84 end
85 else begin
86 O_Q = 4'b1111;
87 end
88 end
89
90 endmodule
Impressum, Datenschutz