Memoria
Memoria
Memoria
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
entity aut_duracion is
Port ( CLK : in STD_LOGIC; -- reloj de 1 ms
LIN : in STD_LOGIC; -- lnea de entrada de datos
VALID_INT : out STD_LOGIC; -- salida de validacin de
intervalo
DATO : out STD_LOGIC; -- salida de dato (0 o 1)
DURACION : out STD_LOGIC_VECTOR (15 downto 0)); -- salida de
end aut_duracion; -- duracin del
intervalo
begin
end a_aut_duracion;
Autómata control
Para umbral0 y umbral1 (300 + 100)/2 ms
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
entity aut_control is
end aut_control;
begin
begin
case ST is
n <= 4;
s_ncod<="000";
s_cod<="00000";
ST<=SIMBOLO;
else
ST<=RESET;
end if;
end if;
end process;
end a_aut_control ;
Registro
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
entity registro is
Port ( CLK : in STD_LOGIC; -- Reloj
ENABLE : in STD_LOGIC; -- Enable
D : in STD_LOGIC_VECTOR (7 downto 0); -- Entradas
Q : out STD_LOGIC_VECTOR (7 downto 0)); -- Salidas
end registro;
begin
process(CLK)
begin
if (CLK' event and CLK= '1') then
end if;
end process;
Q<= reg;
end a_registro;
Receptor
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
entity receptor is
Port ( CLK : in STD_LOGIC; -- Entrada de reloj del sistema
LIN : in STD_LOGIC; -- Entrada de lnea
CARACTER : out STD_LOGIC_VECTOR (7 downto 0)); -- Salida:
caracteres
end receptor;
component aut_duracion is
Port ( CLK : in STD_LOGIC; -- reloj de 1 ms
LIN : in STD_LOGIC; -- lnea de entrada de
datos
VALID_INT : out STD_LOGIC; -- salida de validacin de
intervalo
DATO : out STD_LOGIC; -- salida de dato (0 o 1)
DURACION : out STD_LOGIC_VECTOR (15 downto 0)); -- Duracin
intervalo
end component;
component aut_control is
Port ( CLK : in STD_LOGIC; -- reloj
component ROM is
Port (
MORSE : in STD_LOGIC_VECTOR (7 downto 0);
ASCII : out STD_LOGIC_VECTOR (7 downto 0));
end component;
component registro is
Port (
CLK : in STD_LOGIC; -- Reloj
ENABLE : in STD_LOGIC; -- Enable
D : in STD_LOGIC_VECTOR (7 downto 0); -- Entradas
Q : out STD_LOGIC_VECTOR (7 downto 0)); -- Salidas
end component;
begin
end a_receptor;
TB receptor
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY tb_receptor IS
END tb_receptor;
BEGIN
-- Cableado del componente bajo prueba
uut: receptor PORT MAP (
CLK => CLK,
LIN => LIN,
CARACTER => CARACTER );
-- CARACTER R
LIN<='1'; --punto
wait for 100 ms;
LIN<='0'; --pausa
wait for 100 ms;
LIN<='1'; -- RAYA
wait for 300 ms;
LIN<='0'; --pausa
wait for 100 ms;
LIN<='1'; --punto
wait for 100 ms;
LIN<='0'; -- ESPACIO
wait for 300 ms;
-- CARACTER G
LIN<='1'; -- RAYA
wait for 300 ms;
LIN<='0'; --pausa
wait for 100 ms;
LIN<='1'; -- RAYA
wait for 300 ms;
LIN<='0'; --pausa
wait for 100 ms;
LIN<='1'; --punto
wait for 100 ms;
LIN<='0'; -- ESPACIO
wait for 300 ms;
-- Caracter 0
LIN<='1'; -- RAYA
wait for 300 ms;
LIN<='0'; --pausa
wait for 100 ms;
LIN<='1'; -- RAYA
wait for 300 ms;
LIN<='0'; --pausa
wait for 100 ms;
LIN<='1'; -- RAYA
wait for 300 ms;
LIN<='0'; --pausa
wait for 100 ms;
LIN<='1'; -- RAYA
wait for 300 ms;
LIN<='0'; --pausa
wait for 100 ms;
LIN<='1'; -- RAYA
wait for 300 ms;
LIN<='0'; --espacio
wait for 300 ms;
-- Caracter 2
LIN<='1'; -- PUNTO
wait for 100 ms;
LIN<='0'; -- PAUSA
wait for 100 ms;
LIN<='1'; -- PUNTO
wait for 100 ms;
LIN<='0'; -- PAUSA
wait for 100 ms;
LIN<='1'; -- RAYA
wait for 300 ms;
LIN<='0'; --pausa
wait for 100 ms;
LIN<='1'; -- RAYA
wait for 300 ms;
LIN<='0'; --pausa
wait for 100 ms;
LIN<='1'; -- RAYA
wait for 300 ms;
LIN<='0'; --espacio
wait for 300 ms;
-- Caracter 5
LIN<='1'; -- PUNTO
wait for 100 ms;
LIN<='0'; -- PAUSA
wait for 100 ms;
LIN<='1'; -- PUNTO
wait for 100 ms;
LIN<='0'; -- PAUSA
wait for 100 ms;
LIN<='1'; -- PUNTO
wait for 100 ms;
LIN<='0'; -- PAUSA
wait for 100 ms;
LIN<='1'; -- PUNTO
wait for 100 ms;
LIN<='0'; -- PAUSA
wait for 100 ms;
LIN<='1'; -- PUNTO
wait for 100 ms;
LIN<='0'; -- espacio
wait for 300 ms;
wait;
end process;
END;
La duración total se calculó sumando todos los 100 y 300 ms más los
primeros 300 ms, más 1 s para que salga el último símbolo.