Advertisement
CoMoDoS

top_reception

May 15th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 2.05 KB | None | 0 0
  1. ----------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date: 05/09/2017 06:25:09 PM
  6. -- Design Name:
  7. -- Module Name: top_reception - Behavioral
  8. -- Project Name:
  9. -- Target Devices:
  10. -- Tool Versions:
  11. -- Description:
  12. --
  13. -- Dependencies:
  14. --
  15. -- Revision:
  16. -- Revision 0.01 - File Created
  17. -- Additional Comments:
  18. --
  19. ----------------------------------------------------------------------------------
  20.  
  21.  
  22. library IEEE;
  23. use IEEE.STD_LOGIC_1164.ALL;
  24.  
  25. -- Uncomment the following library declaration if using
  26. -- arithmetic functions with Signed or Unsigned values
  27. --use IEEE.NUMERIC_STD.ALL;
  28.  
  29. -- Uncomment the following library declaration if instantiating
  30. -- any Xilinx leaf cells in this code.
  31. --library UNISIM;
  32. --use UNISIM.VComponents.all;
  33.  
  34. entity top_reception is
  35.    Port (
  36.    Clock : in std_logic;
  37.    Reset : in std_logic;
  38.    Enable : in std_logic;
  39.    Ps2clock : in std_logic;
  40.    Ps2data : in std_logic;
  41.    An : out std_logic_vector(7 downto 0);
  42.    Seg : out std_logic_vector(7 downto 0);
  43.    Error: out std_logic
  44. );
  45. end top_reception;
  46.  
  47. architecture Behavioral of top_reception is
  48. signal sOutput,dataReg: std_logic_vector(7 downto 0):=(others=>'0');
  49. signal sReady: std_logic:='0';
  50. signal Afis: std_logic_vector(7 downto 0):=(others=>'0');
  51. begin
  52.  
  53. display: entity work.display7seg
  54.     port map(
  55.     Clk=>Clock,
  56.     Rst=>Reset,
  57.     Data=>Afis,
  58.     An=>An,
  59.     Seg=>Seg
  60.     );
  61.  
  62. reception: entity work.ps2_keyboard
  63.     port map(
  64.     Clock=>Clock,
  65.     Reset=>Reset,
  66.     Enable=>Enable,
  67.     Ps2clock=>Ps2clock,
  68.     Ps2data=>Ps2data,
  69.     Output=>sOutput,
  70.     Ready=>sReady,
  71.     Error=>Error
  72.     );
  73. process(Clock)
  74. begin
  75.     if rising_edge(Clock) then
  76.         if(Reset='1') then
  77.             dataReg<=(others=>'0');
  78.         elsif(Enable='1') then
  79.             if(sReady='1') then
  80.                 dataReg<=sOutput;
  81.             else
  82.                 dataReg<=dataReg;
  83.             end if;
  84.         end if;
  85.     end if;
  86. end process;
  87. Afis<=dataReg;
  88. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement