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

Subversion Repositories pairing

[/] [pairing/] [trunk/] [rtl/] [tate_pairing.v] - Diff between revs 8 and 10

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 8 Rev 10
Line 88... Line 88...
 
 
// do Tate pairing, hahahaha
// do Tate pairing, hahahaha
module tate_pairing(clk, reset, x1, y1, x2, y2, done, sel, out);
module tate_pairing(clk, reset, x1, y1, x2, y2, done, sel, out);
    input clk, reset;
    input clk, reset;
    input [`WIDTH:0] x1, y1, x2, y2;
    input [`WIDTH:0] x1, y1, x2, y2;
    input [2:0] sel;
    input [7:0] sel;
    output reg done;
    output reg done;
    output reg [149:0] out;
    output reg [149:0] out;
 
 
    reg delay1, rst1;
    reg delay1, rst1;
    wire done1, rst2;
    wire done1, rst2;
Line 125... Line 125...
    always @ (posedge clk)
    always @ (posedge clk)
        if (reset) done <= 0;
        if (reset) done <= 0;
        else if (K[0]) begin done <= 1; o <= out2; end
        else if (K[0]) begin done <= 1; o <= out2; end
 
 
    always @ (o, sel)
    always @ (o, sel)
        case (sel)
        out = (sel[0] ? o[150-1:0] : 0) |
            3'd0: out = o[150-1:0];
              (sel[1] ? o[300-1:150] : 0) |
            3'd1: out = o[300-1:150];
              (sel[2] ? o[450-1:300] : 0) |
            3'd2: out = o[450-1:300];
              (sel[3] ? o[600-1:450] : 0) |
            3'd3: out = o[600-1:450];
              (sel[4] ? o[750-1:600] : 0) |
            3'd4: out = o[750-1:600];
              (sel[5] ? o[900-1:750] : 0) |
            3'd5: out = o[900-1:750];
              (sel[6] ? o[1050-1:900] : 0) |
            3'd6: out = o[1050-1:900];
              (sel[7] ? o[`W6-1:1050] : 0) ;
            3'd7: out = o[`W6-1:1050];
 
            default: out = 0;
 
        endcase
 
endmodule
endmodule
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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