library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity in8out1 is
port( clk,indata,rst: in std_logic;
outdata: out std_logic_vector(7 downto 0));
end in8out1;
architecture sepa of in8out1 is
signal temp_data: std_logic_vector(8 downto 0);
begin
process(clk)
begin
if clk'event and clk='1' then
if rst='0' then
temp_data<=( others=>'0' );
elsif temp_data(0)='0' then
temp_data<=indata&"01111111";
else
temp_data<=indata&temp_data(8 downto 1);
end if;
end if;
end process;
process(temp_data)
begin
if temp_data(0)='0' then
outdata<=temp_data(8 downto 1);
else
outdata<="00000000";
end if;
end process;
end sepa;