Advertisement
salla

decod_with_select

Jul 25th, 2019
589
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.94 KB | None | 0 0
  1. -- Decodificador BCD para display de 7 segmentos
  2. -- Autores: João Vitor e Marcos Meira
  3. -- Portas:
  4. -- bcd  - Vetor de Entrada com 4 posições, ligadas aos switches do devkit
  5. -- HEX0     - Vetor de Saída com 7 posições, relacionadas aos segmentos do display
  6.  
  7. library IEEE;
  8. use ieee.std_logic_1164.all;
  9.  
  10. entity decod_with_select is
  11. port (bcd: in std_logic_vector (3 downto 0);
  12.       HEX0: out std_logic_vector (0 to 6));
  13. end decod_with_select;
  14.  
  15. architecture dataflow of decod_with_select is
  16. begin
  17.  
  18. with bcd select
  19. HEX0 <=   NOT "1111110" when "0000",
  20.           NOT "0110000" when "0001",
  21.           NOT "1101101" when "0010",
  22.           NOT "1111001" when "0011",
  23.           NOT "0110011" when "0100",
  24.           NOT "1011011" when "0101",
  25.           NOT "1011111" when "0110",
  26.           NOT "1110000" when "0111",
  27.           NOT "1111111" when "1000",
  28.           NOT "1110011" when "1001",
  29.           NOT "0000001" when others;
  30.  
  31. end dataflow;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement