gh_delay.vhd
来自「VHDL Library for 8254 timer/counter core」· VHDL 代码 · 共 59 行
VHD
59 行
-----------------------------------------------------------------------------
-- Filename: gh_delay.vhd
--
-- Description:
-- fixed register delay line
--
-- Copyright (c) 2006 by George Huber
-- an OpenCores.org Project
-- free to use, but see documentation for conditions
--
-- Revision History:
-- Revision Date Author Comment
-- -------- ---------- -------- -----------
-- 1.0 01/14/06 G Huber Initial revision
-- 1.1 06/24/06 G Huber fix typo
--
-----------------------------------------------------------------------------
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY gh_delay IS
GENERIC (clock_delays : INTEGER := 16);
PORT(
clk : IN STD_logic;
rst : IN STD_logic;
srst : IN STD_logic := '0';
D : IN STD_LOGIC;
Q : OUT STD_LOGIC
);
END entity;
ARCHITECTURE a OF gh_delay IS
signal iQ : STD_LOGIC_VECTOR(clock_delays-1 DOWNTO 0);
BEGIN
Q <= iQ(clock_delays-1);
process(clk,rst)
begin
if (rst = '1') then
iQ <= (others => '0');
elsif (rising_edge(clk)) then
if (srst = '1') then
iQ <= (others => '0');
else
iQ(0) <= D;
iQ(clock_delays-1 downto 1) <= iQ(clock_delays-2 downto 0);
end if;
end if;
end process;
END a;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?