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

Subversion Repositories wb_uart

[/] [wb_uart/] [trunk/] [src/] [slib_edge_detect.vhd] - Blame information for rev 13

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 13 federico.a
--
2
-- Signal edge detect
3
--
4
-- Author:   Sebastian Witt
5
-- Data:     27.01.2008
6
-- Version:  1.1
7
--
8
-- This code is free software; you can redistribute it and/or
9
-- modify it under the terms of the GNU Lesser General Public
10
-- License as published by the Free Software Foundation; either
11
-- version 2.1 of the License, or (at your option) any later version.
12
--
13
-- This code is distributed in the hope that it will be useful,
14
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
15
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16
-- Lesser General Public License for more details.
17
--
18
-- You should have received a copy of the GNU Lesser General Public
19
-- License along with this library; if not, write to the
20
-- Free Software  Foundation, Inc., 59 Temple Place, Suite 330,
21
-- Boston, MA  02111-1307  USA
22
--
23
 
24
LIBRARY IEEE;
25
USE IEEE.std_logic_1164.all;
26
USE IEEE.numeric_std.all;
27
 
28
entity slib_edge_detect is
29
    port (
30
        CLK         : in std_logic;     -- Clock
31
        RST         : in std_logic;     -- Reset
32
        D           : in std_logic;     -- Signal input
33
        RE          : out std_logic;    -- Rising edge detected
34
        FE          : out std_logic     -- Falling edge detected
35
    );
36
end slib_edge_detect;
37
 
38
architecture rtl of slib_edge_detect is
39
    signal iDd : std_logic;             -- D register
40
begin
41
    -- Store D
42
    ED_D: process (RST, CLK)
43
    begin
44
        if (RST  = '1') then
45
            iDd <= '0';
46
        elsif (CLK'event and CLK='1') then
47
            iDd <= D;
48
        end if;
49
    end process;
50
 
51
    -- Output ports
52
    RE <= '1' when iDd = '0' and D = '1' else '0';
53
    FE <= '1' when iDd = '1' and D = '0' else '0';
54
 
55
end rtl;
56
 
57
 

powered by: WebSVN 2.1.0

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