Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --circuito combinatorio
- library IEEE;
- use IEEE.std_logic_1164.all;
- use ieee.numeric_std.all;
- entity combinatorio is
- port (
- estados: in std_logic_vector(2 downto 0);
- VdA_s, AmA_s, VmA_s, VdB_s, AmB_s, VmB_s, VmP_s, VdP_s: out std_logic;
- conta: out std_logic_vector(1 downto 0)
- );
- end combinatorio;
- ----------------------------------------------------------
- -------------- Arquitetura --------------------------------
- architecture comportamental_comb of combinatorio is
- --------- Declaracao de sinais usados -------
- signal output : std_logic_vector(7 downto 0);
- ---------------------------------------------------
- ---------------------------------------------
- -------- Descricao do comportamento
- begin
- saidaoutput: with estados select
- output <= "10000110" when "000",
- "01000110" when "001",
- "00101010" when "010",
- "00110010" when "011",
- "00000000" when "100",--apagado
- "00100101" when "101",--pedestres
- "01001010" when "110",
- "01001010" when others;
- --- Saidas (Via A e Via B)
- VdA_s <= output(7);
- AmA_s <= output(6);
- VmA_s <= output(5);
- VdB_s <= output(4);
- AmB_s <= output(3);
- VmB_s <= output(2);
- -- Saidas pedestres
- VmP_s <= output(1);
- VdP_s <= output(0);
- -- Trigger
- saidaconta: with estados select
- conta <= "11" when "000",--1min
- "01" when "001",--5s
- "01" when "010",--5s
- "11" when "011",--1min
- "11" when "101",--1min
- "00" when others; --1s
- end architecture;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement