Advertisement
Guest User

D33 VHDL Paste

a guest
Nov 27th, 2014
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. library IEEE;
  2. use IEEE.STD_LOGIC_1164.ALL;
  3.  
  4. entity asdf is
  5. PORT (
  6. clk : IN STD_LOGIC;
  7. ena : IN STD_LOGIC;
  8. rst : IN STD_LOGIC;
  9. data_in : IN STD_LOGIC_VECTOR(2 DOWNTO 0);
  10. data_out : OUT STD_LOGIC_VECTOR(8 DOWNTO 0)
  11. );
  12. end asdf;
  13.  
  14. architecture Behavioral of asdf is
  15. SIGNAL reg0 : std_logic_vector(8 DOWNTO 0);
  16. SIGNAL data : std_logic_vector(2 DOWNTO 0);
  17. begin
  18.  
  19. data <= data_in;
  20.  
  21. PROCESS (clk, rst) IS
  22. BEGIN -- PROCESS
  23. IF rst = '1' THEN -- asynchronous reset (active high)
  24. reg0 <= "000000000";
  25. ELSIF clk'EVENT AND clk = '1' THEN -- rising clock edge
  26. reg0 <= reg0(5 downto 0) & data_in;
  27. data_out <= reg0;
  28. END IF;
  29. END PROCESS;
  30.  
  31. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement