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

Subversion Repositories des

[/] [des/] [trunk/] [rtl/] [verilog/] [common/] [sbox7.v] - Diff between revs 5 and 9

Only display areas with differences | Details | Blame | View Log

Rev 5 Rev 9
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
////                                                             ////
////                                                             ////
////  SBOX                                                       ////
////  SBOX                                                       ////
////  The SBOX is essentially a 64x4 ROM                         ////
////  The SBOX is essentially a 64x4 ROM                         ////
////                                                             ////
////                                                             ////
////  Author: Rudolf Usselmann                                   ////
////  Author: Rudolf Usselmann                                   ////
////          rudi@asics.ws                                      ////
////          rudi@asics.ws                                      ////
////                                                             ////
////                                                             ////
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
////                                                             ////
////                                                             ////
//// Copyright (C) 2001 Rudolf Usselmann                         ////
//// Copyright (C) 2001 Rudolf Usselmann                         ////
////                    rudi@asics.ws                            ////
////                    rudi@asics.ws                            ////
////                                                             ////
////                                                             ////
//// This source file may be used and distributed without        ////
//// This source file may be used and distributed without        ////
//// restriction provided that this copyright statement is not   ////
//// restriction provided that this copyright statement is not   ////
//// removed from the file and that any derivative work contains ////
//// removed from the file and that any derivative work contains ////
//// the original copyright notice and the associated disclaimer.////
//// the original copyright notice and the associated disclaimer.////
////                                                             ////
////                                                             ////
////     THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY     ////
////     THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY     ////
//// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED   ////
//// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED   ////
//// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS   ////
//// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS   ////
//// FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR      ////
//// FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR      ////
//// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,         ////
//// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,         ////
//// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES    ////
//// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES    ////
//// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE   ////
//// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE   ////
//// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR        ////
//// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR        ////
//// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF  ////
//// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF  ////
//// LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT  ////
//// LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT  ////
//// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT  ////
//// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT  ////
//// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE         ////
//// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE         ////
//// POSSIBILITY OF SUCH DAMAGE.                                 ////
//// POSSIBILITY OF SUCH DAMAGE.                                 ////
////                                                             ////
////                                                             ////
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
 
 
module  sbox7(addr, dout);
module  sbox7(addr, dout);
input   [1:6] addr;
input   [1:6] addr;
output  [1:4] dout;
output  [1:4] dout;
reg     [1:4] dout;
reg     [1:4] dout;
 
 
always @(addr) begin
always @(addr) begin
    case ({addr[1], addr[6], addr[2:5]})        //synopsys full_case parallel_case
    case ({addr[1], addr[6], addr[2:5]})        //synopsys full_case parallel_case
         0:  dout =  4;
         0:  dout =  4;
         1:  dout = 11;
         1:  dout = 11;
         2:  dout =  2;
         2:  dout =  2;
         3:  dout = 14;
         3:  dout = 14;
         4:  dout = 15;
         4:  dout = 15;
         5:  dout =  0;
         5:  dout =  0;
         6:  dout =  8;
         6:  dout =  8;
         7:  dout = 13;
         7:  dout = 13;
         8:  dout =  3;
         8:  dout =  3;
         9:  dout = 12;
         9:  dout = 12;
        10:  dout =  9;
        10:  dout =  9;
        11:  dout =  7;
        11:  dout =  7;
        12:  dout =  5;
        12:  dout =  5;
        13:  dout = 10;
        13:  dout = 10;
        14:  dout =  6;
        14:  dout =  6;
        15:  dout =  1;
        15:  dout =  1;
 
 
        16:  dout = 13;
        16:  dout = 13;
        17:  dout =  0;
        17:  dout =  0;
        18:  dout = 11;
        18:  dout = 11;
        19:  dout =  7;
        19:  dout =  7;
        20:  dout =  4;
        20:  dout =  4;
        21:  dout =  9;
        21:  dout =  9;
        22:  dout =  1;
        22:  dout =  1;
        23:  dout = 10;
        23:  dout = 10;
        24:  dout = 14;
        24:  dout = 14;
        25:  dout =  3;
        25:  dout =  3;
        26:  dout =  5;
        26:  dout =  5;
        27:  dout = 12;
        27:  dout = 12;
        28:  dout =  2;
        28:  dout =  2;
        29:  dout = 15;
        29:  dout = 15;
        30:  dout =  8;
        30:  dout =  8;
        31:  dout =  6;
        31:  dout =  6;
 
 
        32:  dout =  1;
        32:  dout =  1;
        33:  dout =  4;
        33:  dout =  4;
        34:  dout = 11;
        34:  dout = 11;
        35:  dout = 13;
        35:  dout = 13;
        36:  dout = 12;
        36:  dout = 12;
        37:  dout =  3;
        37:  dout =  3;
        38:  dout =  7;
        38:  dout =  7;
        39:  dout = 14;
        39:  dout = 14;
        40:  dout = 10;
        40:  dout = 10;
        41:  dout = 15;
        41:  dout = 15;
        42:  dout =  6;
        42:  dout =  6;
        43:  dout =  8;
        43:  dout =  8;
        44:  dout =  0;
        44:  dout =  0;
        45:  dout =  5;
        45:  dout =  5;
        46:  dout =  9;
        46:  dout =  9;
        47:  dout =  2;
        47:  dout =  2;
 
 
        48:  dout =  6;
        48:  dout =  6;
        49:  dout = 11;
        49:  dout = 11;
        50:  dout = 13;
        50:  dout = 13;
        51:  dout =  8;
        51:  dout =  8;
        52:  dout =  1;
        52:  dout =  1;
        53:  dout =  4;
        53:  dout =  4;
        54:  dout = 10;
        54:  dout = 10;
        55:  dout =  7;
        55:  dout =  7;
        56:  dout =  9;
        56:  dout =  9;
        57:  dout =  5;
        57:  dout =  5;
        58:  dout =  0;
        58:  dout =  0;
        59:  dout = 15;
        59:  dout = 15;
        60:  dout = 14;
        60:  dout = 14;
        61:  dout =  2;
        61:  dout =  2;
        62:  dout =  3;
        62:  dout =  3;
        63:  dout = 12;
        63:  dout = 12;
 
 
    endcase
    endcase
    end
    end
 
 
endmodule
endmodule
 
 

powered by: WebSVN 2.1.0

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