Advertisement
OtavioMonteiro

combinatorio

May 21st, 2020
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.54 KB | None | 0 0
  1. --circuito combinatorio
  2.  
  3. library IEEE;
  4. use IEEE.std_logic_1164.all;
  5. use ieee.numeric_std.all;
  6.  
  7. entity combinatorio is
  8.     port (
  9.         estados:      in std_logic_vector(2 downto 0);
  10.         VdA_s, AmA_s, VmA_s, VdB_s, AmB_s, VmB_s, VmP_s, VdP_s:  out std_logic;
  11.         conta:      out std_logic_vector(1 downto 0)
  12.        
  13.     );
  14. end combinatorio;
  15.  
  16.  
  17. ----------------------------------------------------------
  18. -------------- Arquitetura --------------------------------
  19. architecture comportamental_comb of combinatorio is
  20.  
  21.  
  22.     --------- Declaracao de sinais usados -------
  23.     signal output :  std_logic_vector(7 downto 0);
  24.     ---------------------------------------------------
  25.    
  26.  
  27. ---------------------------------------------
  28. -------- Descricao do comportamento
  29. begin
  30.  
  31.     saidaoutput: with estados select
  32.       output <=     "10000110" when "000",
  33.                     "01000110" when "001",
  34.                     "00101010" when "010",
  35.                     "00110010" when "011",
  36.                     "00000000" when "100",--apagado
  37.                     "00100101" when "101",--pedestres
  38.                     "01001010" when "110",
  39.                     "01001010" when others;
  40.                    
  41.    
  42.     --- Saidas (Via A e Via B) 
  43.  
  44.     VdA_s <= output(7);
  45.     AmA_s <= output(6);
  46.     VmA_s <= output(5);
  47.     VdB_s <= output(4);
  48.     AmB_s <= output(3);
  49.     VmB_s <= output(2);
  50.    
  51.     -- Saidas pedestres
  52.     VmP_s <= output(1);
  53.     VdP_s <= output(0);
  54.     -- Trigger
  55.     saidaconta: with estados select
  56.       conta <=    "11" when "000",--1min
  57.                   "01" when "001",--5s
  58.                   "01" when "010",--5s
  59.                   "11" when "011",--1min
  60.                   "11" when "101",--1min
  61.                   "00" when others; --1s
  62.    
  63.    
  64. end architecture;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement