0% found this document useful (0 votes)
2 views2 pages

p1 ED

Uploaded by

mmroman530
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

p1 ED

Uploaded by

mmroman530
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Library IEEE;

use IEEE.STD_LOGIC_1164.ALL;
entity hex_7seg is

Port ( A : in STD_LOGIC_VECTOR (3 downto 0);


segmentos : out STD_LOGIC_VECTOR (7 downto 0));

end hex_7seg;

architecture Behavioral of hex_7seg is

begin
A<= a & b & c & d & dp;
with A select
segmentos<= "00000011" when "0000" --0--
"10011111" when "0001" --1--
"00100101" when "0010" --2--
"00001101" when "0011" --3--
"10011001" when "0100" --4--
"01001001" when "0101" --5--
"01000001" when "0110" --6--
"00011111" when "0111" --7--
"00000001" when "1000" --8--
"00011001" when "1001" --9--
"00010001" when "1010" --A--
"11000001" when "1011" --B--
"11100101" when "1100" --C--
"10000101" when "1101" --D--
"01100001" when "1110" --E--
"01110001" when "1111" --F--
"11111110" when others;
-- a completar

end Behavioral;

P2

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity deco1_4 is

Port ( I : in STD_LOGIC_VECTOR (1 downto 0);


E : in STD_LOGIC;
O : out STD_LOGIC_VECTOR (3 downto 0));

end deco1_4;

architecture Behavioral of deco1_4 is

begin

with I select
O<= "1110" when "00" AND E='1';
"1101" when "01" AND E='1';
"1011" when "10" AND E='1';
"0111" when "11" AND E='1';
"1111" when others;
-- a completar

end Behavioral;

EP3
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity quadMux4x4 is

Port ( D : in STD_LOGIC_VECTOR (15 downto 0);


S : in STD_LOGIC_VECTOR (1 downto 0);
Q : out STD_LOGIC_VECTOR (3 downto 0));

with S select

Q<= D(7 downto 4) when "01",


D(11 downto 8) when "10",
D(15 downto 12) when "11",
D(3 downto 0) others;

end quadMux4x4;

architecture Behavioral of quadMux4x4 is

-- a completar

end Behavioral;

You might also like