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

Subversion Repositories sha3

[/] [sha3/] [trunk/] [low_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
/*
18
 *     in      byte_num     out
19
 * 0x11223344      0    0x01000000
20
 * 0x11223344      1    0x11010000
21
 * 0x11223344      2    0x11220100
22
 * 0x11223344      3    0x11223301
23
 */
24
 
25
module padder1(in, byte_num, out);
26
    input      [31:0] in;
27
    input      [1:0]  byte_num;
28
    output reg [31:0] out;
29
 
30
    always @ (*)
31
      case (byte_num)
32
        0: out = 32'h1000000;
33
        1: out = {in[31:24], 24'h010000};
34
        2: out = {in[31:16], 16'h0100};
35
        3: out = {in[31:8],   8'h01};
36
      endcase
37
endmodule

powered by: WebSVN 2.1.0

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