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

Subversion Repositories sha3

[/] [sha3/] [trunk/] [high_throughput_core/] [rtl/] [padder1.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
module padder1(in, byte_num, out);
18
    input      [63:0] in;
19
    input      [2:0]  byte_num;
20
    output reg [63:0] out;
21
 
22
    always @ (*)
23
      case (byte_num)
24
        0: out =             64'h0100000000000000;
25
        1: out = {in[63:56], 56'h01000000000000};
26
        2: out = {in[63:48], 48'h010000000000};
27
        3: out = {in[63:40], 40'h0100000000};
28
        4: out = {in[63:32], 32'h01000000};
29
        5: out = {in[63:24], 24'h010000};
30
        6: out = {in[63:16], 16'h0100};
31
        7: out = {in[63:8],   8'h01};
32
      endcase
33
endmodule

powered by: WebSVN 2.1.0

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