Está en la página 1de 13

UNIVERSIDAD NACIONAL DE CHIMBORAZO

FACULTAD DE INGENIERIA

GUÍA DE PRÁCTICAS VERSIÓN: 1


PERIODO ACADÉMICO: OCTUBRE 2019-MARZO 2020
Página 1 de 13
CARRERA: DOCENTE: SEMESTRE: DECIMO
TELECOMUNICACIONES LEONARDO RENTERIA PARALELO: A
NOMBRE DE LA ASIGNATURA: CÓDIGO DE LA LABORATORIO A UTILIZAR:
DISPOSITIVOS EMBEBIDOS Y LAB. ASIGNATURA: ELECTRONICA
EETOP10B

Práctica No.: Tema: Duración (horas) No. Grupos No. Estudiantes (por
Codiseño HARDWARE - SOFTWARE Grupo)
4 2 4
Álvarez Daniela
Camas Cristian
Quinche Isaí
Peña Anthony
Garcés Cristian
Objetivos de la Práctica:
Implementar un microprocesador en un FPGA
Equipos, Materiales e Insumos:

- Laboratorio de electrónica
- Osciloscopio, Generador de funciones,
- Multímetro,
- FPGA
- Pc

Procedimiento:

1. Compruebe el resultado mediante el uso del osciloscopio


2. Crear un generador de onda usando la técnica Direct Digital Synthesis (DDS) para generar:
a. Una señal cuadrada
b. Una señal triangular
c. Una señal sinusoidal
3. Utilice el osciloscopio para verificar el resultado.

La síntesis digital directa (DDS) es un método empleado por los sintetizadores de frecuencia utilizados para crear
formas de onda arbitrarias a partir de un único reloj de referencia de frecuencia fija. DDS se utiliza en aplicaciones
como la generación de señales, osciladores locales en sistemas de comunicación, generadores de funciones,
mezcladores, moduladores, sintetizadores de sonido y como parte de un bucle digital de fase bloqueada.

Un sintetizador digital directo básico consiste en una referencia de frecuencia (a menudo un oscilador de cristal,
en nuestro caso el reloj de la tarjeta FPGA) y un convertidor digital a analógico (DAC).

El oscilador de referencia proporciona una base de tiempo estable para el sistema y determina la precisión de
frecuencia del DDS. Proporciona la tarjeta ZYBO en su salida una versión cuantificada de tiempo discreto de la
forma de onda de salida deseada cuyo período es controlado por la programación desarrollada en el software
Vivado 2018.3 contenida en el Registro de Control de Frecuencia. La forma de onda digital muestreada se
convierte en una forma de onda analógica por el DAC.

Resultados:

Las señales generadas se pueden observar a diferentes frecuencias

a. Una señal cuadrada

Ilustración 1. Señal Cuadrada a una frecuencia de 625Hz

Ilustración 2. Señal Cuadrada a una frecuencia de 20Hz


Ilustración 3. Señal cuadrada a una frecuencia de 62.5 Hz

a. Una señal triangular

Ilustración 4. Señal triangular a una frecuencia de 7.8Hz


Ilustración 5. Señal triangular a una frecuencia de 826.4mHz

Ilustración 6.Señal triangular a una frecuencia de 20Hz


Ilustración 7. Señal triangular a una frecuencia de 78.1Hz

a. Una señal senoidal

Ilustración 8. Señal Sinusoidal a una frecuencia de 7.7 Hz


Ilustración 9. Señal Sinusoidal a una frecuencia de 826mHz

Ilustración 10. Señal Sinusoidal a una frecuencia de 20Hz


Ilustración 11.Señal Sinusoidal a una frecuencia de 75.08Hz

Se logró crear un generador de onda usando la técnica DDS, obteniendo las señales sinusoidales, triangular y
cuadrada.

Anexos:

Figura 1. Diagrama completo.

Código Divisores

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.std_logic_unsigned.all;

-- Uncomment the following library declaration if using


-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;
-- Uncomment the following library declaration if instantiating
-- any Xilinx leaf cells in this code.
--library UNISIM;
--use UNISIM.VComponents.all;

entity DIVISOR is
Port (CLK,RESET: in std_logic;
CLKout: out std_logic );
end DIVISOR;

architecture Behavioral of DIVISOR is


signal pulso: STD_LOGIC := '0';
signal contador: integer range 0 to 6249 := 0;

begin
process (CLK,RESET)
begin
if (CLK'event and CLK = '1') then
if (RESET = '1') then pulso<='0';
contador<=0;
elsif (contador = 6249) then
pulso <= NOT(pulso);
contador <= 0;
else
contador <= contador+1;
end if;
end if;
end process;
CLKout <= pulso;

end Behavioral;

Código Multiplexor para Frecuencias

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

-- Uncomment the following library declaration if using


-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;

-- Uncomment the following library declaration if instantiating


-- any Xilinx leaf cells in this code.
--library UNISIM;
--use UNISIM.VComponents.all;

entity MUX_F is
Port (F1,F2,F3,F4: in std_logic;
SE: in std_logic_vector(1 downto 0);
Sa: out std_logic );
end MUX_F;

architecture Behavioral of MUX_F is


begin
process(SE,F1,F2,F3,F4) is
begin
case SE is
WHEN "00" => Sa <= F1;
WHEN "01" => Sa <= F2;
WHEN "10" => Sa <= F3;
WHEN "11" => Sa <= F4;
end case;
end process;
end Behavioral;

Código Contador

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

-- Uncomment the following library declaration if using


-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;

-- Uncomment the following library declaration if instantiating


-- any Xilinx leaf cells in this code.
--library UNISIM;
--use UNISIM.VComponents.all;

entity CONTADOR is
Port (CLK,CLR: in std_logic;
Q: out std_logic_vector(7 downto 0));
end CONTADOR;

architecture Behavioral of CONTADOR is


signal tmp: std_logic_vector(7 downto 0);
begin
process (CLK)
begin
if (CLK'event and CLK='1') then
if (CLR='1') then
tmp <= "11111111";
else
tmp <= tmp + 1;
end if;
end if;
end process;

Q <= tmp;

end Behavioral;

Código onda Sinusoidal

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

-- Uncomment the following library declaration if using


-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;

-- Uncomment the following library declaration if instantiating


-- any Xilinx leaf cells in this code.
--library UNISIM;
--use UNISIM.VComponents.all;

entity SENO is
Port (CLK,EN: in std_logic;
ADDR: in std_logic_vector(7 downto 0);
DATA: out std_logic_vector(7 downto 0) );
end SENO;

architecture Behavioral of SENO is


type memoria_rom is array(0 to 127)of std_logic_vector(7 downto 0);
signal ROM: memoria_rom:=(
X"80", X"86", X"8d", X"93", X"99", X"9f", X"a5", X"ab", X"b1", X"b7", X"bd",
X"c2", X"c8", X"cd", X"d2", X"d7", X"db", X"df", X"e4", X"e7", X"eb", X"ee",
X"f1", X"f4", X"f7", X"f9", X"fb", X"fc", X"fe", X"ff", X"ff", X"ff", X"ff",
X"ff", X"ff", X"fe", X"fd", X"fc", X"fa", X"f8", X"f5", X"f3", X"f0", X"ed",
X"e9", X"e5", X"e1", X"dd", X"d9", X"d4", X"cf", X"ca", X"c5", X"c0", X"ba",
X"b4", X"ae", X"a8", X"a2", X"9c", X"96", X"90", X"89", X"83", X"7d", X"77",
X"70", X"6a", X"64", X"5e", X"58", X"52", X"4c", X"46", X"40", X"3b", X"36",
X"31", X"2c", X"27", X"23", X"1f", X"1b", X"17", X"13", X"10", X"0d", X"0b",
X"08", X"06", X"04", X"03", X"02", X"01", X"00", X"00", X"00", X"00", X"01",
X"02", X"04", X"05", X"07", X"09", X"0c", X"0f", X"12", X"15", X"19", X"1c",
X"21", X"25", X"29", X"2e", X"33", X"38", X"3e", X"43", X"49", X"4f", X"55",
X"5b", X"61", X"67", X"6d", X"73", X"7a", X"80"
);
begin
process(clk)
begin
if rising_edge(clk)then
if(EN='1')then
DATA<=ROM(conv_integer(addr));
end if;
end if;
end process;
end Behavioral;

Código onda Triangular


library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;

-- Uncomment the following library declaration if instantiating


-- any Xilinx leaf cells in this code.
--library UNISIM;
--use UNISIM.VComponents.all;

entity TRIANGULAR is
Port (CLK,EN: in std_logic;
ADDR: in std_logic_vector(7 downto 0);
DATA: out std_logic_vector(7 downto 0) );
end TRIANGULAR;

architecture Behavioral of TRIANGULAR is

type memoria_rom is array(0 to 127)of std_logic_vector(7 downto 0);


signal ROM: memoria_rom:=(
X"20", X"22", X"24", X"26", X"28", X"2a", X"2c", X"2e", X"30", X"32", X"34",
X"36", X"38", X"3a", X"3c", X"3e", X"40", X"42", X"44", X"46", X"48", X"4a",
X"4c", X"4e", X"50", X"52", X"54", X"56", X"58", X"5a", X"5c", X"5e", X"61",
X"63", X"65", X"67", X"69", X"6b", X"6d", X"6f", X"71", X"73", X"75", X"77",
X"79", X"7b", X"7d", X"7f", X"81", X"83", X"85", X"87", X"89", X"8b", X"8d",
X"8f", X"91", X"93", X"95", X"97", X"99", X"9b", X"9d", X"9f", X"9f", X"9d",
X"9b", X"99", X"97", X"95", X"93", X"91", X"8f", X"8d", X"8b", X"89", X"87",
X"85", X"83", X"81", X"7f", X"7d", X"7b", X"79", X"77", X"75", X"73", X"71",
X"6f", X"6d", X"6b", X"69", X"67", X"65", X"63", X"61", X"5e", X"5c", X"5a",
X"58", X"56", X"54", X"52", X"50", X"4e", X"4c", X"4a", X"48", X"46", X"44",
X"42", X"40", X"3e", X"3c", X"3a", X"38", X"36", X"34", X"32", X"30", X"2e",
X"2c", X"2a", X"28", X"26", X"24", X"22", X"20"
);
begin
process(clk)
begin
if rising_edge(clk)then
if(EN='1')then
DATA<=ROM(conv_integer(addr));
end if;
end if;
end process;
end Behavioral;
Código onda Cuadrada
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

-- Uncomment the following library declaration if using


-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;

-- Uncomment the following library declaration if instantiating


-- any Xilinx leaf cells in this code.
--library UNISIM;
--use UNISIM.VComponents.all;

entity CUADRADA is
Port (CLK,EN: in std_logic;
ADDR: in std_logic_vector(7 downto 0);
DATA: out std_logic_vector(7 downto 0) );
end CUADRADA;

architecture Behavioral of CUADRADA is


type memoria_rom is array(0 to 15)of std_logic_vector(7 downto 0);
signal ROM: memoria_rom:=(
X"70", X"70", X"70", X"70", X"70", X"70", X"30", X"30", X"30", X"30",
X"30", X"30", X"30", X"30", X"30", X"70"
);
begin
process(clk)
begin
if rising_edge(clk)then
if(EN='1')then
DATA<=ROM(conv_integer(addr));
end if;
end if;
end process;
end Behavioral;
Código Multiplexor para Señales

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

-- Uncomment the following library declaration if using


-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;

-- Uncomment the following library declaration if instantiating


-- any Xilinx leaf cells in this code.
--library UNISIM;
--use UNISIM.VComponents.all;

entity MUX is
Port (A,B,C: in std_logic_vector(7 downto 0);
SEL: in std_logic_vector(1 downto 0);
Sal: out std_logic_vector(7 downto 0));
end MUX;

architecture Behavioral of MUX is


begin

process(SEL,A,B,C) is
begin
case SEL is
WHEN "00" => Sal <= (others => '0');
WHEN "01" => Sal <= A;
WHEN "10" => Sal <= B;
WHEN "11" => Sal <= C;
WHEN OTHERS => Sal <= (others => '0');
end case;
end process;

end Behavioral;

Referencias bibliográficas:

[1]G. Galeano, Programación de sistemas Embebidos en C.

Fecha de Revisión y Aprobación: 27/09/2019

_____________________ __________________

Firma Director de Carrera Firma Docente

También podría gustarte