Advertisement
CoMoDoS

testarevhdl

May 11th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 2.02 KB | None | 0 0
  1. ----------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date: 05/11/2018 03:24:04 PM
  6. -- Design Name:
  7. -- Module Name: testare - 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 testare is
  35. Port(
  36.         Clk : in STD_LOGIC;
  37.         Rst : in STD_LOGIC;
  38.         Read : in STD_LOGIC;
  39.         Sel : in STD_LOGIC;
  40.         MISO : in STD_LOGIC;
  41.         MOSI : out STD_LOGIC;
  42.         SkLK : out STD_LOGIC;
  43.         SS : out STD_LOGIC;
  44.         An : out STD_LOGIC_VECTOR(7 downto 0);
  45.         Seg : out STD_LOGIC_VECTOR(7 downto 0)
  46.     );
  47.  
  48. end testare;
  49.  
  50. architecture Behavioral of testare is
  51. signal ReadEn : STD_LOGIC := '0';
  52. signal Data : STD_LOGIC_VECTOR(31 downto 0) := (others => '0');
  53. signal Data1 : STD_LOGIC_VECTOR(31 downto 0) := (others => '0');
  54. signal Data2 : STD_LOGIC_VECTOR(31 downto 0) := (others => '0');
  55.  
  56. begin
  57.  
  58. accelerometer_map : entity WORK.adxl port map(
  59.     Clk => Clk,    
  60.     Rst => Rst,    
  61.     Read => ReadEn,
  62.     MISO => MISO,  
  63.     MOSI => MOSI,  
  64.     SKLK => SKLK,  
  65.     SS => SS,      
  66.     Data1 => Data1,
  67.     Data2 => Data2
  68. );
  69.  
  70. Data <= Data1 when Sel = '0' else Data2;
  71.  
  72. debouncer_map : entity WORK.debounce1 port map(
  73.     Clk => Clk,
  74.     Rst => Rst,
  75.     D_in => Read,
  76.     Q_out => ReadEn
  77. );
  78. ssd_map : entity WORK.displ7seg port map(
  79.     Clk => Clk,
  80.     Rst => Rst,
  81.     Data => Data,
  82.     An => An,
  83.     Seg => Seg
  84. );
  85.  
  86. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement