Previa_P4_4
Previa_P4_4
Previa_P4_4
vhd
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity codificador is
Port (entrada : in STD_LOGIC_VECTOR (7 downto 0);
salida : out STD_LOGIC_VECTOR (11 downto 0));
end codificador;
‐‐completar la arquitectura
end Behavioral;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity mux is
Port ( A : in STD_LOGIC_VECTOR (12 downto 0);
B : in STD_LOGIC_VECTOR (12 downto 0);
sel : in STD_LOGIC;
Y : out STD_LOGIC_VECTOR (12 downto 0));
end mux;
begin
withsel select
Y<= A when '0',
B when other;
end Behavioral;
Ep4_3
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
entity BCD7seg is
Port ( A : in STD_LOGIC_VECTOR (3 downto 0);
segmentos : out STD_LOGIC_VECTOR (6 downto 0));
end BCD7seg;
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
architecture Behavioral of BCD7seg is
begin
with A select
segmentos <=
"0000001" when "0000",
"1001111" when "0001",
"0010010" when "0010",
"0000110" when "0011",
"1001100" when "0100",
"0100100" when "0101",
"0100000" when "0110",
"0001111" when "0111",
"0000000" when "1000",
"0001100" when “1001”,
"1111110" when "1111"
“1111111” when others;
end Behavioral;
EP4_4
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity ca1000 is
Port ( BCDin: in STD_LOGIC_vector (11 downto 0);
BCDout: out STD_LOGIC_VECTOR (11 downto 0));
end ca1000;
component Ca999
port (BCDin: in std_logic_vector (11 downto 0);
BCDout: out std_logic_vector (11 downto 0));
end component;
component sumadorBCD
port ( A : in STD_LOGIC_VECTOR (3 downto 0);
B : in STD_LOGIC_VECTOR (3 downto 0);
Cin : in STD_LOGIC;
Cout : out STD_LOGIC;
S : out STD_LOGIC_VECTOR (3 downto 0));
end component;
begin
U1: Ca999 PORT MAP ( BCDin=> __BCDin____,
BCDout => __BCDout___);
U2: sumadorBCD PORT MAP ( Cin=>__'1'____,
A=> __BCDout(11 dowto 8)____,
B=> _"0000"_____,
S=> ____U1__,
Cout =>______);
U3: sumadorBCD PORT MAP ( Cin=>__Cout____,
A=> __BCDout(7 downto 4)____,
B=> _"0000"_____,
S=> ___D1___,
Cout =>_Cin_____);
U4: sumadorBCD PORT MAP ( Cin=>___Cout___,
A=> __BCDout(3 downto____,
B=> "0000"______,
S=> __C1____);
end Behavioral;