Professional Documents
Culture Documents
-- Company:
-- Engineer:
--
-- Create Date: 13.11.2022 22:11:21
-- Design Name:
-- Module Name: div_clk - arch_div_clk
-- Project Name:
-- Target Devices:
-- Tool Versions:
-- Description:
--
-- Dependencies:
--
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity div_clk is
Port ( clk : in STD_LOGIC;
rst : in STD_LOGIC;
clk_out_1 : out STD_LOGIC;
clk_out_2 : out STD_LOGIC);
end div_clk;
sl when (sel="1101")else
sh when (sel="1011")else
m;
end arch_mux
//////////////////////////////////////////////////////////
entity reg_bal is
Port ( clk: : in STD_LOGIC ;
sel: out STD_LOGIC_VECTOR(3 down to 0));
end reg_bal;
architecture arch_reg_bal of reg_bal is
signal reg:STD_LOGIC_VECTOR(3 down to 0):="1110";
begin
process(clk)
if (clk'event' and clk='1')then
reg<=reg(2 down to 0); !!(3)
end if
end process
sel<=reg
end arch_reg_bal
//////////////////////////////////////////
entity chrono is
Port ( clk,rst,st,ar: : in STD_LOGIC ;
m,sh,sl,d: out STD_LOGIC_VECTOR(3 down to 0));
end chrono;
///////////////////////////////////////////////////
architecture arch_chrono of chrono is
begin
process(rst,st,ar)
begin
if (rst='1') then ce='0';
else
if(st='1')then ce='1';
end if
end process
slkd<=clk when ce='1';
else'0'
process(clkd,rst)
begin
if(rst='1') then
d1<="1001";
if(d1="1001")then
d1<="0000";
clksl<=not(clksl)
else
d1<=d1+1
end if
end process
process(clksl,rst)
begin
if(rst='1') then
sl1<="0000";
elsif(clksl'event' and clksl='1')
then
if (sl1="1001")then
sl1<="0000";
clksh<not(clksh)
else sl1<=sl1+1;
end if
end if
end process
process(clksh,rst)
begin
if(rst='1')then
sh="0000"
elsif (clksh'event'andclksh='1')
then
if(sh1="0101")then
sh1<="0000";
clkm<=not(clkm)
else sh1<=sh1+1;
end if
end if
end process
process(clkm,rst)
begin
if(rst='1')then m<="0000")
elsif (clkm'event' and clkm='1')then
if (m1="1001") then
m1<="0000";
else
m1<=m1+1;
end if
end if
end process
m<=m1
sh<=sh1
sl<=sl1
d<=d1
end erch_chrono;