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

Subversion Repositories adaptive_lms_equalizer

[/] [adaptive_lms_equalizer/] [tags/] [V10/] [code/] [clock_div.vhd] - Blame information for rev 3

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

Line No. Rev Author Line
1 2 digish
--  Copyright (C) 2004-2005 Digish Pandya <digish.pandya@gmail.com>
2
 
3
--  This program is free software; you can redistribute it and/or modify
4
--  it under the terms of the GNU General Public License as published by
5
--  the Free Software Foundation; either version 2 of the License, or
6
--  (at your option) any later version.
7
--
8
--  This program is distributed in the hope that it will be useful,
9
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
10
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
--  GNU General Public License for more details.
12
--
13
--  You should have received a copy of the GNU General Public License
14
--  along with this program; if not, write to the Free Software
15
--  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
16
 
17
-- clock devider routine
18
 
19
library IEEE;
20
use IEEE.STD_LOGIC_1164.ALL;
21
use IEEE.STD_LOGIC_ARITH.ALL;
22
use IEEE.STD_LOGIC_UNSIGNED.ALL;
23
 
24
entity clock_div is
25
    Port ( reset: in std_logic;
26
                 in_clk : in std_logic;
27
           out1 : out std_logic;
28
           out2 : out std_logic);
29
end clock_div;
30
 
31
architecture Behavioral of clock_div is
32
 
33
signal ct: std_logic_vector(19 downto 0);
34
--signal ct: std_logic_vector(1 downto 0);
35
 
36
begin
37
 
38
        process(reset,in_clk)
39
        begin
40
                if reset = '0' then
41
                        ct <= "00000000000000000000";
42
--                      ct <= "00";
43
                elsif in_clk'event and in_clk = '1' then
44
                        ct <= ct + "00000000000000000001";
45
--                      ct <= ct + "01";
46
                end if;
47
        end process;
48
-- Using this value we can adjust different clock speed
49
-- Fast Clock
50
out1 <= ct(5);
51
-- Slow clock
52
out2 <= ct(19);
53
 
54
--out1 <= ct(0);
55
--out2 <= ct(1);
56
 
57
end Behavioral;

powered by: WebSVN 2.1.0

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