2. Diseñe un registro de 8 bits con reset activo en alto.
a. Un diagrama de bloques.
b. Una impresión de pantalla con la descripción en VHDL
c. Una impresión de pantalla con la simulación generada en EDA PLAYGROUND.
Ejercicio 2
--------------------------------------------------------------------------------
-- Nombre:Whilintong Guzman
-- Documento:94228739
-- Fecha:17-04-2020
-- Proyecto:tarea3
--------------------------------------------------------------------------------
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
use IEEE.std_logic_unsigned.all;
entity ejrcicio2 is
Port ( clek : in STD_LOGIC;
reset : in STD_LOGIC;
entrada : in STD_LOGIC_VECTOR (7 downto 0);
salida : out STD_LOGIC_VECTOR (7 downto 0)
);
end ejrcicio2;
architecture Behavioral of ejrcicio2 is
begin
process (clk)
begin
if <clk>'event and <clk>='1' then
if <reset>='1' then
salida <= (others =>'0');
else
salida <= entrada;
end if;
end if;
end process;
end Behavioral;
Lado derecho
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity Simulacion is
--
end Simulacion;
architecture Behavioral of Simulacion is
component ejrcicio2
port (clek : in STD_LOGIC;
reset : in STD_LOGIC;
entrada : in STD_LOGIC_VECTOR (7 downto 0);
salida : out STD_LOGIC_VECTOR (7 downto 0)
);
end component;
-- Señales de las entradas
signal clk, reset : STD_LOGIC:= '0';
signal entrada : STD_LOGIC_VECTOR (3 downto 0);
-- Señales de salidas
signal salida : STD_LOGIC_VECTOR (3 downto 0);
constant PERIOD : time := 10 ns;
begin
UO: ejrcicio2 Port map (
clk =>clk,
reset => reset,
entrada => entrada,
salida1=> salida1
);
process begin
clk <= '0';
wait for PERIOD/2;
clk <= '1';
wait for PERIOD/2;
end process;
process begin
--- Estímulos de la simulación wait for 100 ns;
wait for 100 ns;
reset <= '1';
wait for 20 ns;
reset <= '0';
wait for 20 ns;
entrada2 <= "00110011";
wait for 100 ns;
entrada2 <= "10001101";
wait for 100 ns;
entrada2 <= "11100101";
wait for 100 ns;
entrada2 <= "10101111";
wait for 100 ns;
entrada2 <= "11111111";
wait for 100 ns;
entrada1 <= '0';
entrada2 <= "0110";
wait for 100 ns;
reset <= '1';
wait for 20 ns;
reset <= '0';
wait for 20 ns;
wait;
end process;
end Behavioral;