OpenCores
URL https://opencores.org/ocsvn/dallas_one-wire/dallas_one-wire/trunk

Subversion Repositories dallas_one-wire

[/] [dallas_one-wire/] [tags/] [arelease/] [clk_divider.vhd] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 bretthowar
library ieee;
2
use ieee.std_logic_1164.all;
3
 
4
entity clk_divider is
5
  port
6
  (
7
        clk                             : IN    std_logic;
8
        oneus_plus              : INOUT std_logic
9
  );
10
end entity;
11
 
12
 
13
architecture structural of clk_divider is
14
 
15
        signal counter          : integer range 0 to 16;
16
 
17
begin
18
 
19
        process ( clk )
20
        begin
21
                if rising_edge(clk) then
22
                        counter <= counter + 1;
23
                        if (counter mod 16) = 0 then
24
                                oneus_plus <= not oneus_plus;
25
                        end if;
26
                end if;
27
        end process;
28
 
29
end architecture;
30
 
31
PACKAGE TIMER_PKG IS
32
                COMPONENT clk_divider
33
                END COMPONENT;
34
END TIMER_PKG;

powered by: WebSVN 2.1.0

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