Advertisement
sconetto

VHDL HEX

Oct 19th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.26 KB | None | 0 0
  1. ----------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date: 05.10.2016 13:52:49
  6. -- Design Name:
  7. -- Module Name: simula1 - 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. entity simula1 is
  26.     Port( HEX1, HEX2, HEX3, HEX4 : in STD_LOGIC_VECTOR (3 downto 0);
  27.           SEG : out STD_LOGIC_VECTOR (0 to 6);
  28.           an : out STD_LOGIC);
  29. end simula1;
  30.  
  31. architecture Behavioral of simula1 is
  32.  
  33. begin
  34.     with HEX select
  35.      SEG <= "0000001" when "0000",
  36.             "1001111" when "0001",
  37.             "0010010" when "0010",
  38.             "0000110" when "0011",
  39.             "1001100" when "0100",
  40.             "0100100" when "0101",
  41.             "0100000" when "0110",
  42.             "0001111" when "0111",
  43.             "0000000" when "1000",
  44.             "0000100" when "1001",
  45.             "1111111" when OTHERS;                                                                                                
  46. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement