Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. ----------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date: 08:29:42 03/21/2019
  6. -- Design Name:
  7. -- Module Name: Sum - 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. library IEEE;
  21. use IEEE.STD_LOGIC_1164.ALL;
  22. use IEEE.STD_LOGIC_UNSIGNED.ALL;
  23.  
  24. entity Sum is
  25. port (
  26. A, B : in std_logic_vector(3 downto 0); --Entradas 'A & B'
  27. clock: in STD_LOGIC;
  28. reset: in STD_LOGIC;
  29. an: out STD_LOGIC_VECTOR (3 downto 0);
  30. dec_ddp: out STD_LOGIC_VECTOR (7 downto 0));
  31. end Sum;
  32.  
  33. architecture Behavioral of Sum is
  34. signal som1 : STD_LOGIC_VECTOR(4 downto 0);
  35. signal d01,d02,d03,d04 : STD_LOGIC_VECTOR (5 downto 0);
  36. begin
  37.  
  38. s0 : Entity work.somador port map (A => A, B => B, Soma => som1);
  39.  
  40. --an <= "0111";
  41.  
  42. s1 : Entity work.dspl_drv port map (clock => clock, reset => reset, d1 => d01, d2 => d02, d3 => d03, d4=> d04, an =>an, dec_ddp => dec_ddp);
  43.  
  44. d01(0) <= '0';
  45. d02(0) <= '0';
  46. d03(0) <= '0';
  47. d04(0) <= '0';
  48.  
  49. d01(5) <= '1';
  50. d02(5) <= '1';
  51. d03(5) <= '1';
  52. d04(5) <= '1';
  53.  
  54. d01(4 downto 1) <= som1;--(4 downto 1);
  55. d02(4 downto 1) <= som1;--(4 downto 1);
  56. d03(4 downto 1) <= som1;--(4 downto 1);
  57. d04(4 downto 1) <= som1;--(4 downto 1);
  58.  
  59. -- d01 <= '1' & som1 & '0';
  60.  
  61. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement