[an error occurred while processing this directive]
|
Вот. Как курица лапой. Такое ощущение, что язык задумали Бармалеи, чтобы мучить маленьких детей.
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use IEEE.STD_LOGIC_UNSIGNED.all;
entity del_clk is
port(
clk : in std_logic;
set : in std_logic;
prog : in std_logic_vector (15 downto 0);
out_clk : out std_logic
);
end del_clk;
architecture Struct of del_clk is
signal enable : std_logic;
signal ct : std_logic_vector(15 downto 0);
begin
process(clk, set, prog)
begin
if (clk'event and clk = '1') then
if set = '1' then
ct <= prog;
elsif enable = '1' then
ct <= ct - 1;
end if;
if set = '1' then
enable <= '1';
elsif ct = "0000000000000001" then
enable <= '0';
end if;
if ct = "0000000000000001" then
out_clk <= '1';
else
out_clk <= '0';
end if;
end if;
end process;
end Struct;