[an error occurred while processing this directive]
|
Если set - один такт, нечто подобное.
process(clk,rst)
begin
if rst = '1' then
cnt <= (others => '1');
elsif clk = '1' and clk'event then
if set = '1' then cnt <= '0' & prog;
elsif cnt(16) = '0' then cnt <= cnt - 1;
end if;
end if;
end process;
out_clk <= set when prog = 0 else '1' when cnt = 1 else '0';
Если - это импульс произвольной длины, нужно еще отсчитать эту длину.