-- *********************************************************************** -- -- DESCRIPTION -- -- PISO Register (Parallel In - Serial Out) component. -- -- REQUIRED COMPONENTS -- -- None. -- -- PORTS -- -- (I) Data_In: Parallel Data-In (8 bits) -- (I) Clk: Clock (1 bit) -- (I) Load: Load (1 bit) -- (I) Shift_Right: Shift-Right (1 bit) -- (O) Data_Out: Serial Data-Out (1 bit) -- -- AUTHORS -- -- 14.12.2001 - Xavier Perseguers & Tadeusz Senn -- -- *********************************************************************** -- Declarations ---------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; -- Entity ---------------------------------------------------------------- entity PISO_Register is port (Data_In : in std_logic_vector(7 downto 0); Clk, Load, Shift_Right : in std_logic; Data_Out : out std_logic); end PISO_Register; -- Architecture ---------------------------------------------------------- architecture comportemental of PISO_Register is signal sData : std_logic_vector (7 downto 0); begin process (Clk) begin Data_Out <= sData(0); if (Clk'event and Clk = '1') then if (Load = '1') then sData <= Data_In; elsif (Shift_Right = '1') then sData <= '0' & sData(7 downto 1); end if; end if; end process; end comportemental;