Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. library IEEE;
  2. use ieee.std_logic_1164.all;
  3.  
  4. entity desloca is
  5. generic (
  6. n: integer := 16
  7. );
  8. port (
  9. a : in std_logic_vector(n-1 downto 0);
  10. ent : in std_logic;
  11. q : out std_logic_vector (n-1 downto 0)
  12. );
  13. end desloca;
  14.  
  15. architecture comport of desloca is
  16. begin
  17. q(3) <= a(2);
  18. q(2) <= a(1);
  19. q(1) <= a(0);
  20. q(0) <= ent;
  21. end comport;
  22.  
  23. ------------------------------------------------------------------------------------------------
  24.  
  25. library IEEE;
  26. use ieee.std_logic_1164.all;
  27.  
  28. entity deslocador is
  29. generic (
  30. gen : integer := 4
  31. );
  32.  
  33. port (
  34. A : in std_logic_vector (gen-1 downto 0);
  35. ENT : in std_logic;
  36. Q : out std_logic_vector (gen-1 downto 0)
  37. );
  38. end deslocador;
  39.  
  40. architecture rtl of deslocador is
  41. component desloca is
  42. generic (
  43. n: integer := 16
  44. );
  45. port (
  46. a : in std_logic_vector(n-1 downto 0);
  47. ent : in std_logic;
  48. q : out std_logic_vector (n-1 downto 0)
  49. );
  50. end component;
  51.  
  52. begin
  53. r1 : desloca
  54. generic map(
  55. n => gen
  56. )
  57.  
  58. port map (
  59. a => A,
  60. ent => ENT,
  61. q => Q
  62. );
  63. end rtl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement