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

Subversion Repositories ecg

[/] [ecg/] [trunk/] [rtl/] [fun.v] - Blame information for rev 15

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

Line No. Rev Author Line
1 2 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 15 homer.xing
    along with Tate Bilinear Pairing Core.  If not, see http://www.gnu.org/licenses/lgpl.txt
19 2 homer.xing
*/
20
 
21
// fun.v: Have you got fun reading the code ?
22
`include "inc.v"
23
 
24
// turn "00000001111111111111111" into "00000001000000000000000"
25
module func6(clk, reset, in, out);
26
    input clk, reset, in;
27
    output out;
28
    reg reg1, reg2;
29
    always @ (posedge clk)
30
        if (reset)
31
          begin
32
            reg1 <= 0; reg2 <= 0;
33
          end
34
        else
35
          begin
36
            reg2 <= reg1; reg1 <= in;
37
          end
38
    assign out = {reg2,reg1}==2'b01 ? 1 : 0;
39
endmodule
40
 

powered by: WebSVN 2.1.0

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