1
0
mirror of https://github.com/Gehstock/Mist_FPGA.git synced 2026-01-23 02:37:52 +00:00
Gehstock.Mist_FPGA/common/TTL/multi74123.vhd
2019-07-22 23:42:05 +02:00

37 lines
708 B
VHDL

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity multi74123 is
Port ( inh_pos : in STD_LOGIC;
q_neg : out STD_LOGIC;
clk : in STD_LOGIC);
end multi74123;
architecture Behavioral of multi74123 is
constant pulse_len : integer range 0 to 32767 := 20160;
signal cnt : integer range 0 to 32767 := 0;
signal inh_R : std_logic := '0';
signal inh_R_prev : std_logic := '0';
begin
process (clk) is
begin
if rising_edge(clk) then
if cnt>0 then
cnt <= cnt - 1;
end if;
inh_R_prev <= inh_R;
inh_R <= inh_pos;
if inh_R_prev = '0' and inh_R='1' then
cnt <= pulse_len;
end if;
end if;
end process;
q_neg <= '0' when (cnt>0) else '1';
end Behavioral;