URL
https://opencores.org/ocsvn/pairing/pairing/trunk
[/] [pairing/] [trunk/] [rtl/] [fun.v] - Diff between revs 8 and 24
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 8 |
Rev 24 |
|
/*
|
|
Copyright 2011, City University of Hong Kong
|
|
Author is Homer (Dongsheng) Xing.
|
|
|
|
This file is part of Tate Bilinear Pairing Core.
|
|
|
|
Tate Bilinear Pairing Core is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU Lesser General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
Tate Bilinear Pairing Core is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU Lesser General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with Foobar. If not, see http://www.gnu.org/licenses/lgpl.txt
|
|
*/
|
|
|
// fun.v: Have you got fun reading the code ?
|
// fun.v: Have you got fun reading the code ?
|
`include "inc.v"
|
`include "inc.v"
|
|
|
// turn "00000001111111111111111" into "00000001000000000000000"
|
// turn "00000001111111111111111" into "00000001000000000000000"
|
module func6(clk, reset, in, out);
|
module func6(clk, reset, in, out);
|
input clk, reset, in;
|
input clk, reset, in;
|
output out;
|
output out;
|
reg reg1, reg2;
|
reg reg1, reg2;
|
always @ (posedge clk)
|
always @ (posedge clk)
|
if (reset)
|
if (reset)
|
begin
|
begin
|
reg1 <= 0; reg2 <= 0;
|
reg1 <= 0; reg2 <= 0;
|
end
|
end
|
else
|
else
|
begin
|
begin
|
reg2 <= reg1; reg1 <= in;
|
reg2 <= reg1; reg1 <= in;
|
end
|
end
|
assign out = {reg2,reg1}==2'b01 ? 1 : 0;
|
assign out = {reg2,reg1}==2'b01 ? 1 : 0;
|
endmodule
|
endmodule
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.