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

Subversion Repositories gecko4

[/] [gecko4/] [trunk/] [GECKO4com/] [spartan200_an/] [vhdl/] [i2c/] [edge_detector-behavior.vhdl] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 ktt1
--------------------------------------------------------------------------------
2
--            _   _            __   ____                                      --
3
--           / / | |          / _| |  __|                                     --
4
--           | |_| |  _   _  / /   | |_                                       --
5
--           |  _  | | | | | | |   |  _|                                      --
6
--           | | | | | |_| | \ \_  | |__                                      --
7
--           |_| |_| \_____|  \__| |____| microLab                            --
8
--                                                                            --
9
--           Bern University of Applied Sciences (BFH)                        --
10
--           Quellgasse 21                                                    --
11
--           Room HG 4.33                                                     --
12
--           2501 Biel/Bienne                                                 --
13
--           Switzerland                                                      --
14
--                                                                            --
15
--           http://www.microlab.ch                                           --
16
--------------------------------------------------------------------------------
17
--   GECKO4com
18
--  
19
--   2010/2011 Dr. Theo Kluter
20
--  
21
--   This VHDL code is free code: you can redistribute it and/or modify
22
--   it under the terms of the GNU General Public License as published by
23
--   the Free Software Foundation, either version 3 of the License, or
24
--   (at your option) any later version.
25
--  
26
--   This VHDL code is distributed in the hope that it will be useful,
27
--   but WITHOUT ANY WARRANTY; without even the implied warranty of
28
--   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
29
--   GNU General Public License for more details. 
30
--   You should have received a copy of the GNU General Public License
31
--   along with these sources.  If not, see <http://www.gnu.org/licenses/>.
32
--
33
 
34
ARCHITECTURE no_platform_specific OF edge_detector IS
35
 
36
   SIGNAL s_pipe_regs : std_logic_vector( 3 DOWNTO 0 );
37
 
38
BEGIN
39
 
40
   make_pipe_regs : PROCESS( clock , reset , data_in )
41
   BEGIN
42
      IF (clock'event AND (clock = '1')) THEN
43
         IF (reset = '1') THEN s_pipe_regs <= (OTHERS => '1');
44
                          ELSE
45
            s_pipe_regs <= s_pipe_regs( 2 DOWNTO 0 )& data_in;
46
         END IF;
47
      END IF;
48
   END PROCESS make_pipe_regs;
49
 
50
   make_output_regs : PROCESS( clock , reset , s_pipe_regs )
51
   BEGIN
52
      IF (clock'event AND (clock = '1')) THEN
53
         IF (reset = '1') THEN data_out <= '1';
54
                               pos_edge <= '0';
55
                               neg_edge <= '0';
56
                          ELSE data_out <= s_pipe_regs(1);
57
                               pos_edge <= NOT(s_pipe_regs(3)) AND
58
                                           NOT(s_pipe_regs(2)) AND
59
                                           s_pipe_regs(1) AND
60
                                           s_pipe_regs(0);
61
                               neg_edge <= NOT(s_pipe_regs(0)) AND
62
                                           NOT(s_pipe_regs(1)) AND
63
                                           s_pipe_regs(2) AND
64
                                           s_pipe_regs(3);
65
         END IF;
66
      END IF;
67
   END PROCESS make_output_regs;
68
END no_platform_specific;

powered by: WebSVN 2.1.0

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