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

Subversion Repositories des

[/] [des/] [trunk/] [rtl/] [verilog/] [common/] [sbox3.v] - Blame information for rev 5

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 rudi
/////////////////////////////////////////////////////////////////////
2
////                                                             ////
3
////  SBOX                                                       ////
4
////  The SBOX is essentially a 64x4 ROM                         ////
5
////                                                             ////
6
////  Author: Rudolf Usselmann                                   ////
7
////          rudi@asics.ws                                      ////
8
////                                                             ////
9
/////////////////////////////////////////////////////////////////////
10
////                                                             ////
11
//// Copyright (C) 2001 Rudolf Usselmann                         ////
12
////                    rudi@asics.ws                            ////
13
////                                                             ////
14
//// This source file may be used and distributed without        ////
15
//// restriction provided that this copyright statement is not   ////
16
//// removed from the file and that any derivative work contains ////
17
//// the original copyright notice and the associated disclaimer.////
18
////                                                             ////
19
////     THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY     ////
20
//// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED   ////
21
//// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS   ////
22
//// FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR      ////
23
//// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,         ////
24
//// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES    ////
25
//// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE   ////
26
//// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR        ////
27
//// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF  ////
28
//// LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT  ////
29
//// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT  ////
30
//// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE         ////
31
//// POSSIBILITY OF SUCH DAMAGE.                                 ////
32
////                                                             ////
33
/////////////////////////////////////////////////////////////////////
34
 
35
module  sbox3(addr, dout);
36
input   [1:6] addr;
37
output  [1:4] dout;
38
reg     [1:4] dout;
39
 
40
always @(addr) begin
41
    case ({addr[1], addr[6], addr[2:5]})        //synopsys full_case parallel_case
42
         0:  dout = 10;
43
         1:  dout =  0;
44
         2:  dout =  9;
45
         3:  dout = 14;
46
         4:  dout =  6;
47
         5:  dout =  3;
48
         6:  dout = 15;
49
         7:  dout =  5;
50
         8:  dout =  1;
51
         9:  dout = 13;
52
        10:  dout = 12;
53
        11:  dout =  7;
54
        12:  dout = 11;
55
        13:  dout =  4;
56
        14:  dout =  2;
57
        15:  dout =  8;
58
 
59
        16:  dout = 13;
60
        17:  dout =  7;
61
        18:  dout =  0;
62
        19:  dout =  9;
63
        20:  dout =  3;
64
        21:  dout =  4;
65
        22:  dout =  6;
66
        23:  dout = 10;
67
        24:  dout =  2;
68
        25:  dout =  8;
69
        26:  dout =  5;
70
        27:  dout = 14;
71
        28:  dout = 12;
72
        29:  dout = 11;
73
        30:  dout = 15;
74
        31:  dout =  1;
75
 
76
        32:  dout = 13;
77
        33:  dout =  6;
78
        34:  dout =  4;
79
        35:  dout =  9;
80
        36:  dout =  8;
81
        37:  dout = 15;
82
        38:  dout =  3;
83
        39:  dout =  0;
84
        40:  dout = 11;
85
        41:  dout =  1;
86
        42:  dout =  2;
87
        43:  dout = 12;
88
        44:  dout =  5;
89
        45:  dout = 10;
90
        46:  dout = 14;
91
        47:  dout =  7;
92
 
93
        48:  dout =  1;
94
        49:  dout = 10;
95
        50:  dout = 13;
96
        51:  dout =  0;
97
        52:  dout =  6;
98
        53:  dout =  9;
99
        54:  dout =  8;
100
        55:  dout =  7;
101
        56:  dout =  4;
102
        57:  dout = 15;
103
        58:  dout = 14;
104
        59:  dout =  3;
105
        60:  dout = 11;
106
        61:  dout =  5;
107
        62:  dout =  2;
108
        63:  dout = 12;
109
 
110
    endcase
111
    end
112
 
113
endmodule

powered by: WebSVN 2.1.0

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