OpenCores

Subversion Repositories pairing

[/] [pairing/] [trunk/] [rtl/] [fun.v] - Blame information for rev 30

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 24 homer.xing
/*
2
    Copyright 2011, City University of Hong Kong
3
    Author is Homer (Dongsheng) Xing.
4
 
5
    This file is part of Tate Bilinear Pairing Core.
6
 
7
    Tate Bilinear Pairing Core is free software: you can redistribute it and/or modify
8
    it under the terms of the GNU Lesser General Public License as published by
9
    the Free Software Foundation, either version 3 of the License, or
10
    (at your option) any later version.
11
 
12
    Tate Bilinear Pairing Core is distributed in the hope that it will be useful,
13
    but WITHOUT ANY WARRANTY; without even the implied warranty of
14
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
    GNU Lesser General Public License for more details.
16
 
17
    You should have received a copy of the GNU General Public License
18 30 homer.xing
    along with Tate Bilinear Pairing Core.  If not, see http://www.gnu.org/licenses/lgpl.txt
19 24 homer.xing
*/
20
 
21 2 homer.xing
// fun.v: Have you got fun reading the code ?
22
`include "inc.v"
23
 
24
// turn "00000001111111111111111" into "00000001000000000000000"
25 8 homer.xing
module func6(clk, reset, in, out);
26
    input clk, reset, in;
27 2 homer.xing
    output out;
28
    reg reg1, reg2;
29
    always @ (posedge clk)
30 8 homer.xing
        if (reset)
31
          begin
32
            reg1 <= 0; reg2 <= 0;
33
          end
34
        else
35
          begin
36
            reg2 <= reg1; reg1 <= in;
37
          end
38 2 homer.xing
    assign out = {reg2,reg1}==2'b01 ? 1 : 0;
39
endmodule
40
 

powered by: WebSVN 2.1.0

© copyright 1999-2014 OpenCores.org, equivalent to ORSoC AB, all rights reserved. OpenCores®, registered trademark.