Multiplexor 2 A 1
Multiplexor 2 A 1
--------------------------------------------------------------------
--Documento:1065639519
--Fecha:18/10/2019
--Proyecto:Tarea 2
--------------------------------------------------------------------
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
use IEEE.std_logic_unsigned.all;
entity Multiplexor2a1 is
);
end Multiplexor2a1;
begin
E1 when others;
end Behavioral;
-- Code your testbench here
library IEEE;
use IEEE.std_logic_1164.all;
entity simulacion is
--
end simulacion;
component Multiplexor2a1
end component;
--Señales de entrada
--Señales de salida
E0 => E0,
E1 => E1,
Salida=> Salida
process begin
E0 <= '0';
E1 <= "0000";
E0 <= '1';
E1 <= "0001";
E0 <= '0';
E1 <= "0110";
wait for 100 ns;
wait;
end process;
end Behavioral;
--------------------------------------------------------------------
--Documento:1065639519
--Fecha:18/10/2019
--Proyecto:Tarea 2
--------------------------------------------------------------------
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
use IEEE.std_logic_unsigned.all;
entity Multiplexor4a1 is
);
end Multiplexor4a1;
begin
E1 when "01",
E0 when "10",
E1 when "11",
E0 when others;
end Behavioral;
--------------------------------------------------------------------
--Documento:1065639519
--Fecha:18/10/2019
--Proyecto:Tarea 2
--------------------------------------------------------------------
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
use IEEE.std_logic_unsigned.all;
entity Multiplexor4a1 is
);
end Multiplexor4a1;
begin
E1 when "01",
E0 when "10",
E1 when "11",
E0 when others;
end Behavioral;
library IEEE;
use IEEE.std_logic_1164.all;
entity simulacion is
--
end simulacion;
component Multiplexor4a1
end component;
--Señales de entrada
--Señales de salida
begin
E0 => E0,
E1 => E1,
E2 => E2,
E3 => E3,
Salida=> Salida
process begin
E0 <= "00001111";
E0 <= "10001111";
E0 <= "00101011";
E0 <= "10001111";
end process;
end Behavioral;
--------------------------------------------------------------------
--Documento:8851831
--Fecha:19/10/2019
--Proyecto:Tarea 2
--------------------------------------------------------------------
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
use IEEE.std_logic_unsigned.all;
entity Multiplexor8a1 is
);
end Multiplexor8a1;
begin
E1 when "001",
E2 when "010",
E3 when "011",
E4 when "100",
E5 when "101",
E6 when "110",
E7 when "111",
E0 when others;
end Behavioral;
library IEEE;
use IEEE.std_logic_1164.all;
entity simulacion is
--
end simulacion;
component Multiplexor8a1
end component;
--Señales de entrada
--Señales de salida
E0 => E0,
E1 => E1,
E2 => E2,
E3 => E3,
E4 => E4,
E5 => E5,
E6 => E6,
E7 => E7,
F => F
);
process begin
E0 <= "0000011111";
E0 <= "1000011111";
E0 <= "0001010111";
E0 <= "1000011111";
wait;
end process;
end Behavioral;
EJERCICIO 6 COMPONENTS
--------------------------------------------------------------------------------
-- Documento:8851831
-- Fecha:20/10/2019
-- Proyecto:Tarea 2
--------------------------------------------------------------------------------
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
use IEEE.std_logic_unsigned.all;
entity sumador is
);
end sumador;
begin
F <= A + B;
end Behavioral;
RESTADOR
------------
-- Documento:8851831
-- Fecha:20/10/2019
-- Proyecto:Tarea 2
--------------------------------------------------------------------------------
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
use IEEE.std_logic_unsigned.all;
entity restador is
);
end restador;
begin
F <= A - B;
end Behavioral;
MULTIPLEXOR
--------------------------------------------------------------------------------
-- Documento:8851831
-- Fecha:20/10/2019
-- Proyecto:Tarea 2
--------------------------------------------------------------------------------
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
use IEEE.std_logic_unsigned.all;
entity sumador is
sel : in STD_LOGIC;
);
end sumador;
begin
I1 when others;
end Behavioral;
DESING
---------
//-- Documento:8851831
//-- Fecha:20/10/2019
//-- Proyecto:Tarea 2
//----------------------------------------------------------------------
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
use IEEE.std_logic_unsigned.all;
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
use IEEE.std_logic_unsigned.all;
entity design is
sel_alu : in STD_LOGIC_VECTOR;
);
end design ;
);
end component;
component restador
);
end component;
component multiplexor
sel : in STD_LOGIC;
);
end component ;
--Señales internas
begin
A => A_alu,
B => B_alu,
F => suma
);
A => A_alu,
B => B_alu,
F => resta
);
I0 => A_alu,
I1 => B_alu,
);
end Behavioral;
TESTBENCH
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity Simulacion is
--
end Simulacion;
component design
sel_alu : in STD_LOGIC_VECTOR;
);
end component ;
-- Señales de salidas
begin
);
process begin
wait;
end process;
end Behavioral;