Está en la página 1de 5

MIELOAP03

Implementación de sistemas digitales VHDL

TAREA 5__Sanchez _1937480

Nombre completo del alumno: Raúl Sanchez Hernandez


Número de matrícula del alumno: 1937480

Fecha: 12 febrero 2019

Anexos a esta tarea: resumen

Nombre del archivo (con extensión) Descripción


Tarea5.mp4

Practica 5 Instrucción
• El contador de 4 bits, para ver los leds contar se requiere dividir la frecuencia del
reloj para que los leds cuenten aproximadamente cada segundo
• Se debe dividir la señal entre 100,000,000
Dado que 2^27 = 134,217,728 es aproximado a la cantidad que queremos entonces se agrega un
contador de 27 bits.

ARCHIVO VHDL

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.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 ejemplo5 is
Port ( clk : in STD_LOGIC;
sw0 : in STD_LOGIC;
led : out STD_LOGIC_VECTOR (3 downto 0));
end ejemplo5;
MIELOAP03

Implementación de sistemas digitales VHDL

architecture Behavioral of ejemplo5 is


signal divisor:std_logic_vector(25 downto 0);
signal count_int:std_logic_vector(3 downto 0):= "0000";
signal one:std_logic;
begin
process (clk)
begin
if clk='1' and clk'event then
divisor <= divisor + 1;
if divisor>= "10111110101111000010000000" then
divisor<="00000000000000000000000000";
one<= not one;
end if;
end if;
end process;
process (one)
begin
if one='1' and one'event then
if sw0='1'then
count_int <= count_int + 1;
else
count_int <= count_int - 1;
end if;

end if;

end process;

led<= count_int;

end Behavioral;

ARCHIVO CONSTRS

# Clock signal
set_property PACKAGE_PIN W5 [get_ports clk]
set_property IOSTANDARD LVCMOS33 [get_ports clk]
create_clock -add -name sys_clk_pin -period 10.00 -waveform {0 5} [get_ports clk]

# Switches
set_property PACKAGE_PIN V17 [get_ports {sw0}]
set_property IOSTANDARD LVCMOS33 [get_ports {sw0}]

# LEDs
set_property PACKAGE_PIN U16 [get_ports {led[0]}]
set_property IOSTANDARD LVCMOS33 [get_ports {led[0]}]
set_property PACKAGE_PIN E19 [get_ports {led[1]}]
set_property IOSTANDARD LVCMOS33 [get_ports {led[1]}]
set_property PACKAGE_PIN U19 [get_ports {led[2]}]
set_property IOSTANDARD LVCMOS33 [get_ports {led[2]}]
MIELOAP03

Implementación de sistemas digitales VHDL

set_property PACKAGE_PIN V19 [get_ports {led[3]}]


set_property IOSTANDARD LVCMOS33 [get_ports {led[3]}]

Evidencias photographical:

OBSERVACIONES.
Con el contador swtch en modo off los led operan de la siguiente forma
1111
1110
1101
1100
1011
1010
1001
0111
0110
0101
0100
0011
0010
0001
0000
Con el contador swtch en modo ON los led operan de la siguiente forma
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
MIELOAP03

Implementación de sistemas digitales VHDL

EVIDENCIAS
Algunas muestras de los leds

1101 SWO MODO OFF

1110 SWO MODO OFF

1111 SWO MODO OFF


MIELOAP03

Implementación de sistemas digitales VHDL

0000 SWO MODO ON

0001 SWO MODO ON

También podría gustarte