You are on page 1of 2

----------------------------------------------------------------------------------

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity TOP is
Port ( Tdato : in STD_LOGIC_VECTOR (3 downto 0);
TSELECTOR : in STD_LOGIC_VECTOR (3 downto 0);
PUNTO : in STD_LOGIC;
TDISPLAY : out STD_LOGIC_VECTOR (6 downto 0);
AN : out STD_LOGIC_VECTOR (7 downto 0);
P : out STD_LOGIC);
end TOP;
architecture Behavioral of TOP is
COMPONENT deco1
PORT(
dato : IN std_logic_vector(2 downto 0);
disp : OUT std_logic_vector(6 downto 0)
);
END COMPONENT;
COMPONENT mux
PORT(
I0 : IN std_logic_vector(7 downto 0);
I1 : IN std_logic_vector(7 downto 0);
I2 : IN std_logic_vector(7 downto 0);
I3 : IN std_logic_vector(7 downto 0);
I4 : IN std_logic_vector(7 downto 0);
I5 : IN std_logic_vector(7 downto 0);
I6 : IN std_logic_vector(7 downto 0);
I7 : IN std_logic_vector(7 downto 0);
I8 : IN std_logic_vector(7 downto 0);
I9 : IN std_logic_vector(7 downto 0);
I10 : IN std_logic_vector(7 downto 0);
I11 : IN std_logic_vector(7 downto 0);
I12 : IN std_logic_vector(7 downto 0);
I13 : IN std_logic_vector(7 downto 0);
I14 : IN std_logic_vector(7 downto 0);
I15 : IN std_logic_vector(7 downto 0);
SELECTOR : IN std_logic_vector(3 downto 0);
SALIDA : OUT std_logic_vector(7 downto 0)
);
END COMPONENT;
begin
Inst_deco1: deco1 PORT MAP(
dato => Tdato,
disp => TDISPLAY
);
Inst_mux: mux PORT MAP(
I0 => "11111111",
I1 => "11111110" ,
I2 => "11111101",
I3 => "11111011" ,
I4 => "11110111",
I5 => "11101111",
I6 => "11011111",
I7 =>"10111111",
I8 => "01111111" ,
I9 =>"00001111" ,
I10 =>"11110000" ,
I11 =>"10101010" ,
I12 => "11001100" ,
I13 => "10011001",
I14 => "00000001",
I15 =>"00000000" ,
SELECTOR => TSELECTOR,
SALIDA => AN
);
P<=PUNTO;

end Behavioral;

deco
---------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity deco1 is
Port ( dato : in STD_LOGIC_VECTOR (2 downto 0);
disp : out STD_LOGIC_VECTOR (6 downto 0));
end deco1;

architecture Behavioral of deco1 is

begin
with dato select
disp <= "0000001" when "000",---0
"0000110" when "001",--1
"0010010" when "010",--2
"1101101" when "011",--3
"1101001" when "100",--4
"0110011" when "101",--4
"1011011" when "110",--5
"0011110" when "110",--6
"1110001" when others;--7

end Behavioral;

You might also like