marcoshuck

Sistema de votos

Dec 15th, 2016
6,040
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.87 KB | None | 0 0
  1. library IEEE;
  2. use IEEE.STD_LOGIC_1164.ALL;
  3. use IEEE.STD_LOGIC_ARITH.ALL;
  4. use IEEE.STD_LOGIC_UNSIGNED.ALL;
  5.  
  6. entity base is
  7.     Port (
  8.         led_green : out std_logic;
  9.         led_yellow : out std_logic;
  10.         led_red : out std_logic;
  11.  
  12.         A : in std_logic;
  13.         B : in std_logic;
  14.         C : in std_logic;
  15.         D : in std_logic;
  16.         );
  17. end base;
  18.  
  19. architecture behavioral of base is
  20. begin
  21.     led_green<=((B and C and D) or (A and C and D) or (A and B and D) or (A and B and C));
  22.     led_red<=((not(B) and not(C) and not(D)) or (not(A) and not(C) and not(D)) or (not(A) and not(B) and not(D)) or (not(A) and not(B) and not(C)));
  23.     led_yellow<=((A and B and not(C) and not(D)) or (A and not(B) and C and not(D)) or (A and not(B) and not(C) and D) or (not(A) and B and C and not(D)) or (not(A) and B and not(C) and D) or (not(A) and not(B) and C and D));
  24.     --led_yellow<=(led_green nor led_red);
  25. end behavioral;
Advertisement