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

Subversion Repositories sha3

[/] [sha3/] [trunk/] [high_throughput_core/] [rtl/] [rconst2in1.v] - Blame information for rev 6

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 homer.hsin
/*
2
 * Copyright 2013, Homer Hsing <homer.hsing@gmail.com>
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 * http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
 
17
/* round constant (2 in 1 ~ ~) */
18
module rconst2in1(i, rc1, rc2);
19
    input  [11:0] i;
20
    output [63:0] rc1, rc2;
21
    reg    [63:0] rc1, rc2;
22
 
23
    always @ (i)
24
      begin
25
        rc1 = 0;
26
        rc1[0] = i[0] | i[2] | i[3] | i[5] | i[6] | i[7] | i[10] | i[11];
27
        rc1[1] = i[1] | i[2] | i[4] | i[6] | i[8] | i[9];
28
        rc1[3] = i[1] | i[2] | i[4] | i[5] | i[6] | i[7] | i[9];
29
        rc1[7] = i[1] | i[2] | i[3] | i[4] | i[6] | i[7] | i[10];
30
        rc1[15] = i[1] | i[2] | i[3] | i[5] | i[6] | i[7] | i[8] | i[9] | i[10];
31
        rc1[31] = i[3] | i[5] | i[6] | i[10] | i[11];
32
        rc1[63] = i[1] | i[3] | i[7] | i[8] | i[10];
33
      end
34
 
35
    always @ (i)
36
      begin
37
        rc2 = 0;
38
        rc2[0] = i[2] | i[3] | i[6] | i[7];
39
        rc2[1] = i[0] | i[5] | i[6] | i[7] | i[9];
40
        rc2[3] = i[3] | i[4] | i[5] | i[6] | i[9] | i[11];
41
        rc2[7] = i[0] | i[4] | i[6] | i[8] | i[10];
42
        rc2[15] = i[0] | i[1] | i[3] | i[7] | i[10] | i[11];
43
        rc2[31] = i[1] | i[2] | i[5] | i[9] | i[11];
44
        rc2[63] = i[1] | i[3] | i[6] | i[7] | i[8] | i[9] | i[10] | i[11];
45
      end
46
endmodule

powered by: WebSVN 2.1.0

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