-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclkdiv.vhd
More file actions
52 lines (47 loc) · 1.28 KB
/
clkdiv.vhd
File metadata and controls
52 lines (47 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
----------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Create Date: 10/15/2020 03:52:30 PM
-- Design Name:
-- Module Name: clkdiv - Behavioral
-- Project Name:
-- Target Devices:
-- Tool Versions:
-- Description:
--
-- Dependencies:
--
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_unsigned.all;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;
-- Uncomment the following library declaration if instantiating
-- any Xilinx leaf cells in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity clkdiv is
Port ( mclk : in STD_LOGIC;
clr : in STD_LOGIC;
clk25 : out STD_LOGIC);
end clkdiv;
architecture Behavioral of clkdiv is
signal q: STD_LOGIC_VECTOR(23 downto 0) := x"000000";
begin
process(mclk,clr)
begin
if clr = '1' then
q<=X"000000";
elsif mclk'event and mclk = '1' then
q<=q +1;
end if;
end process;
clk25<=q(1);
end Behavioral;