entity中定义为:scan_code : out STD_LOGIC_VECTOR(15 DOWNTO 0);
architecture中说明:
scan_code(15 downto 8) <= scan_code(7 downto 0);scan_code(7 downto 0) <= SHIFTIN(7 DOWNTO 0);
将OUT 改成 BUFFER 即可