1 --------------------------------
2 ----------shift registers -----
3 --------------------------------
5 use ieee.std_logic_1164.all;
7 entity shift_register is
12 port ( clk : in std_logic;
16 d : in std_logic_vector(dsize - 1 downto 0);
17 q : out std_logic_vector(dsize - 1 downto 0)
21 architecture rtl of shift_register is
32 d : in std_logic_vector (dsize - 1 downto 0);
33 q : out std_logic_vector (dsize - 1 downto 0)
37 signal dff_we_n : std_logic;
38 signal q_out : std_logic_vector(dsize - 1 downto 0);
39 signal df_in : std_logic_vector(dsize - 1 downto 0);
44 dff_we_n <= ce_n and we_n;
45 dff_inst : d_flip_flop generic map (dsize)
46 port map (clk, rst_n, '1', dff_we_n, df_in, q_out);
48 clk_p : process (clk, we_n, ce_n, d)
52 elsif (ce_n = '0') then
53 df_in (dsize - 1 downto dsize - shift) <= (others => '0');
54 df_in (dsize - shift - 1 downto 0) <=
55 q_out(dsize - 1 downto shift);
61 -------------------------------
62 -- LS373 transparent D-latch---
63 -------------------------------
65 use ieee.std_logic_1164.all;
71 port ( c : in std_logic;
73 d : in std_logic_vector(dsize - 1 downto 0);
74 q : out std_logic_vector(dsize - 1 downto 0)
78 architecture rtl of ls373 is
86 d : in std_logic_vector (dsize - 1 downto 0);
87 q : out std_logic_vector (dsize - 1 downto 0)
91 component tri_state_buffer
97 d : in std_logic_vector (dsize - 1 downto 0);
98 q : out std_logic_vector (dsize - 1 downto 0)
102 signal q_out : std_logic_vector (dsize - 1 downto 0);
105 ls373_inst : data_latch generic map (dsize)
106 port map (c, d, q_out);
107 tsb_inst : tri_state_buffer generic map (dsize)
108 port map (oc_n, q_out, q);