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

Subversion Repositories btc_dsha256

[/] [btc_dsha256/] [trunk/] [rtl/] [vhdl/] [misc/] [edgedtc.vhd] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 nuxi1209
------------------------------------------------------------------- 
2
--                                                               --
3
--  Copyright (C) 2013 Author and VariStream Studio              --
4
--  Author : Yu Peng                                             --
5
--                                                               -- 
6
--  This source file may be used and distributed without         -- 
7
--  restriction provided that this copyright statement is not    -- 
8
--  removed from the file and that any derivative work contains  -- 
9
--  the original copyright notice and the associated disclaimer. -- 
10
--                                                               -- 
11
--  This source file is free software; you can redistribute it   -- 
12
--  and/or modify it under the terms of the GNU Lesser General   -- 
13
--  Public License as published by the Free Software Foundation; -- 
14
--  either version 2.1 of the License, or (at your option) any   -- 
15
--  later version.                                               -- 
16
--                                                               -- 
17
--  This source is distributed in the hope that it will be       -- 
18
--  useful, but WITHOUT ANY WARRANTY; without even the implied   -- 
19
--  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      -- 
20
--  PURPOSE.  See the GNU Lesser General Public License for more -- 
21
--  details.                                                     -- 
22
--                                                               -- 
23
--  You should have received a copy of the GNU Lesser General    -- 
24
--  Public License along with this source; if not, download it   -- 
25
--  from http://www.opencores.org/lgpl.shtml                     -- 
26
--                                                               -- 
27
------------------------------------------------------------------- 
28
--  Description:
29
--      Edge detector
30
--      If iEdge = 1 > rising edge detect
31
--      If iEdge = 0 > falling edge detect
32
-------------------------------------------------------------------
33 2 nuxi1209
 
34
library ieee;
35
use ieee.std_logic_1164.all;
36
use ieee.std_logic_unsigned.all;
37
 
38
entity edgedtc is port
39
        (
40
                iD                              : in            std_logic;
41
                iClk                    : in            std_logic;
42
                iResetSync_Clk  : in            std_logic;
43
                iEdge                   : in            std_logic;
44
                oQ                              : out           std_logic := '0'
45
        );
46
end edgedtc;
47
 
48
architecture edgedtc of edgedtc is
49
 
50
 
51
        signal sFf      : std_logic_vector(1 downto 0) := "00";
52
 
53
begin
54
 
55
        edgedtc:process(iClk)
56
                begin
57
                if rising_edge(iCLk) then
58
                        if iResetSync_Clk = '1' THEN
59
                                oQ <= '0';
60
                                sFf <= iEdge & iEdge;--"00";
61
                        else
62
                                sFf(0) <= iD;
63
                                sFf(1) <= sFf(0);
64
 
65
                                oQ <= (not iEdge xor sFf(0)) and (iEdge xor sFf(1));
66
                        end if;
67
                end if;
68
 
69
        end process;
70
 
71
 
72
 
73
end edgedtc;
74
 

powered by: WebSVN 2.1.0

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