Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Tarea 3
Tarea 3
Circuitos Lógicos II
Grupo: 4CM23
Tarea 3 VHDL
Boleta: 2018350712
04/10/2019
1. Mediante with – select, elaborar en VHDL el siguiente multiplexor, que
cumpla la siguiente tabla.
E selección salida_f
0 00 N1
0 01 N2
0 10 N3
0 11 N4
1 xx 0
Código en VHDL
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity mux_e is
Port ( N1 : in STD_LOGIC_VECTOR (7 downto 0);
N2 : in STD_LOGIC_VECTOR (7 downto 0);
N3 : in STD_LOGIC_VECTOR (7 downto 0);
N4 : in STD_LOGIC_VECTOR (7 downto 0);
seleccion : in STD_LOGIC_VECTOR (1 downto 0);
E : in STD_LOGIC;
salida_f : out STD_LOGIC_VECTOR(7 downto 0));
end mux_e;
begin
with seleccion select
salida_E <= N1 when "00",
N2 when "01",
N3 when "10",
N4 when others;
with E select
salida_f <= salida_E when'0',
"00000000" when others;
end Behavioral;
Simulación:
2. Mediante la instrucción “Lista sensible” (Sensitivity list) realizar en VHDL un
código que cumpla con la siguiente tabla (donde Q = estado anterior).
N1 N2 F
XX 00 Q
XX 01 Q
XX 10 Q
XX 11 Q
00 XX N1 and N2
01 XX N1 and N2
10 XX N1 and N2
11 XX N1 and N2
Código en VHDL
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity Ejercicio_process is
Port ( N1 : in STD_LOGIC_VECTOR (1 downto 0);
N2 : in STD_LOGIC_VECTOR (1 downto 0);
F : out STD_LOGIC_VECTOR (1 downto 0));
end Ejercicio_process;
end Behavioral;
Simulación:
3. Usando la sentencia if-else realizar en VHDL un código que cumpla con la
siguiente tabla de verdad:
sel f
00 N3
01 N1
10 N4
11 N2
Código VHDL
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity if_mux is
Port ( N1 : in STD_LOGIC_VECTOR (7 downto 0);
N2 : in STD_LOGIC_VECTOR (7 downto 0);
N3 : in STD_LOGIC_VECTOR (7 downto 0);
N4 : in STD_LOGIC_VECTOR (7 downto 0);
sel : in STD_LOGIC_VECTOR (1 downto 0);
f : out STD_LOGIC_VECTOR(7 downto 0));
end if_mux;
end Behavioral;
Simulación:
4. Usando la sentencia case realizar en VHDL un código que cumpla con la
siguiente tabla de verdad:
sel f
00 N4
01 N3
10 N2
11 N1
Código VHDL
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity mux_case is
Port ( N1 : in STD_LOGIC_VECTOR (7 downto 0);
N2 : in STD_LOGIC_VECTOR (7 downto 0);
N3 : in STD_LOGIC_VECTOR (7 downto 0);
N4 : in STD_LOGIC_VECTOR (7 downto 0);
sel : in STD_LOGIC_VECTOR (1 downto 0);
f : out STD_LOGIC_VECTOR(7 downto 0));
end mux_case;