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

Subversion Repositories rtf68ksys

[/] [rtf68ksys/] [trunk/] [rtl/] [verilog/] [VT148.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 robfinch
// ============================================================================
2
//      (C) 2007  Robert Finch
3
//      robfinch@<remove>sympatico.ca
4
//
5
// VT148 - 74LS148 priority encoder
6
//
7
//
8
// This source file is free software: you can redistribute it and/or modify 
9
// it under the terms of the GNU Lesser General Public License as published 
10
// by the Free Software Foundation, either version 3 of the License, or     
11
// (at your option) any later version.                                      
12
//                                                                          
13
// This source file is distributed in the hope that it will be useful,      
14
// but WITHOUT ANY WARRANTY; without even the implied warranty of           
15
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            
16
// GNU General Public License for more details.                             
17
//                                                                          
18
// You should have received a copy of the GNU General Public License        
19
// along with this program.  If not, see <http://www.gnu.org/licenses/>.    
20
//                                                                          
21
// ============================================================================
22
//
23
// Webpack 9.1i  xc3s1000-4ft256
24
// 6 slices / 11 LUTs / 10.860 MHz
25
 
26
module VT148(en, i0, i1, i2, i3, i4, i5, i6, i7, o, gs, eo);
27
input en;       // enable - active low
28
input i0;       // input - active low
29
input i1;
30
input i2;
31
input i3;
32
input i4;
33
input i5;
34
input i6;
35
input i7;
36
output [2:0] o;
37
reg [2:0] o;
38
output gs;
39
output eo;
40
 
41
always @(en or i1 or i2 or i3 or i4 or i5 or i6 or i7)
42
        if (en)
43
                o = 3'd7;
44
        else if (!i7)
45
                o = 3'd0;
46
        else if (!i6)
47
                o = 3'd1;
48
        else if (!i5)
49
                o = 3'd2;
50
        else if (!i4)
51
                o = 3'd3;
52
        else if (!i3)
53
                o = 3'd4;
54
        else if (!i2)
55
                o = 3'd5;
56
        else if (!i1)
57
                o = 3'd6;
58
        else
59
                o = 3'd7;
60
 
61
nand(eo, i0,i1,i2,i3,i4,i5,i6,i7,!en);
62
or(gs, en,!eo);
63
 
64
endmodule

powered by: WebSVN 2.1.0

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