Guest User

Untitled

a guest
Feb 1st, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.32 KB | None | 0 0
  1. ----------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date:    10:13:50 12/22/2011
  6. -- Design Name:
  7. -- Module Name:    biestable1 - 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_ARITH.ALL;
  23. -- use IEEE.STD_LOGIC_UNSIGNED.ALL;
  24.  
  25. -- Uncomment the following library declaration if instantiating
  26. -- any Xilinx primitives in this code.
  27. -- library UNISIM;
  28. -- use UNISIM.VComponents.all;
  29.  
  30. entity biestable1 is
  31.     Port ( suma : in  STD_LOGIC_VECTOR (15 downto 0);
  32.            clk : in  STD_LOGIC;
  33.               rst : in  STD_LOGIC;
  34.            cnt : in  STD_LOGIC_VECTOR (2 downto 0);
  35.            sumacu : out  STD_LOGIC_VECTOR (15 downto 0));
  36. end biestable1;
  37.  
  38. architecture Behavioral of biestable1 is
  39. begin
  40.     process(clk, rst, cnt, suma)
  41.     begin
  42.         if(rst = '1') then
  43.             sumacu <= (others => '0');
  44.         elsif clk'event and clk = '1' then
  45.             if(cnt = "111") then
  46.                 sumacu <= (others => '0');
  47.             else
  48.                 sumacu <= suma;
  49.             end if;
  50.         end if;
  51.     end process;
  52. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment