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

Subversion Repositories uos_processor

[/] [vhdl/] [clkdiv.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 droggen
library IEEE;
2
use IEEE.STD_LOGIC_1164.ALL;
3
use IEEE.STD_LOGIC_UNSIGNED.ALL;
4
 
5
entity clkdiv is
6
        generic(N : integer);
7
        port (  clkin : in  STD_LOGIC;
8
                                clkout : out STD_LOGIC
9
                        );
10
end clkdiv;
11
 
12
architecture Behavioral of clkdiv is
13
        signal divider : STD_LOGIC_VECTOR(N-1 downto 0);
14
begin
15
 
16
        process(clkin)
17
        begin
18
                        if rising_edge(clkin) then
19
                                divider<=divider+1;
20
                        end if;
21
   end process;
22
 
23
        clkout<=divider(N-1);
24
 
25
end Behavioral;
26
 

powered by: WebSVN 2.1.0

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