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

Subversion Repositories tiny_tate_bilinear_pairing

[/] [tiny_tate_bilinear_pairing/] [trunk/] [group_size_is_151_bits/] [rtl/] [const.v] - Blame information for rev 15

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 homer.hsin
/*
2 15 homer.hsin
 * Copyright 2012, 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 2 homer.hsin
 
17
/*
18
 * the module of constants
19
 *
20
 * addr  out  effective
21
 *    1   0     1
22
 *    2   1     1
23
 *    4   +     1
24
 *    8   -     1
25
 *   16 cubic   1
26
 * other  0     0
27
 */
28
module const (clk, addr, out, effective);
29
    input clk;
30 3 homer.hsin
    input [5:0] addr;
31 2 homer.hsin
    output reg [197:0] out;
32
    output reg effective; // active high if out is effective
33
 
34
    always @ (posedge clk)
35
      begin
36 3 homer.hsin
         effective <= 1;
37
         case (addr)
38 4 homer.hsin
            1:  out <= 198'd0;
39
            2:  out <= 198'd1;
40 3 homer.hsin
            4:  out <= {6'b000101, 192'd0};
41
            8:  out <= {6'b001001, 192'd0};
42
            16: out <= {6'b010101, 192'd0};
43
            default:
44 4 homer.hsin
               begin out <= 198'd0; effective <= 0; end
45 3 homer.hsin
         endcase
46 2 homer.hsin
      end
47
endmodule

powered by: WebSVN 2.1.0

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