URL
https://opencores.org/ocsvn/dallas_one-wire/dallas_one-wire/trunk
[/] [dallas_one-wire/] [trunk/] [clk_divider.vhd] - Diff between revs 2 and 4
Show entire file |
Details |
Blame |
View Log
Rev 2 |
Rev 4 |
Line 1... |
Line 1... |
|
library ieee;
|
|
use ieee.std_logic_1164.all;
|
|
|
No newline at end of file
|
No newline at end of file
|
|
entity clk_divider is
|
|
port
|
|
(
|
|
clk : IN std_logic;
|
|
oneus_plus : INOUT std_logic
|
|
);
|
|
end entity;
|
|
|
|
|
|
architecture structural of clk_divider is
|
|
|
|
signal counter : integer range 0 to 16;
|
|
|
|
begin
|
|
|
|
process ( clk )
|
|
begin
|
|
if rising_edge(clk) then
|
|
counter <= counter + 1;
|
|
if (counter mod 16) = 0 then
|
|
oneus_plus <= not oneus_plus;
|
|
end if;
|
|
end if;
|
|
end process;
|
|
|
|
end architecture;
|
|
|
|
PACKAGE TIMER_PKG IS
|
|
COMPONENT clk_divider
|
|
END COMPONENT;
|
|
END TIMER_PKG;
|
No newline at end of file
|
No newline at end of file
|
© copyright 1999-2025
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.