Professional Documents
Culture Documents
Reloj 24 Hrs VHDL y TINA 6 Displays Con Alarma Configurable
Reloj 24 Hrs VHDL y TINA 6 Displays Con Alarma Configurable
Código VHDL
----------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Create Date: 23:51:23 11/14/2020
-- Design Name:
-- Module Name: reloj - Behavioral
-- Project Name:
-- Target Devices:
-- Tool versions:
-- Description:
--
-- Dependencies:
--
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity reloj is
Port ( clk : in STD_LOGIC;
resetT: in STD_LOGIC;
resetm: in STD_LOGIC;
reseth: in STD_LOGIC;
configh: in STD_LOGIC;
configm: in STD_LOGIC;
aceptar: in STD_LOGIC;
q1 : out STD_LOGIC;
q2 : out STD_LOGIC;
q3 : out STD_LOGIC;
q4 : out STD_LOGIC;
j1 : out STD_LOGIC;
j2 : out STD_LOGIC;
j3 : out STD_LOGIC;
m1 : out STD_LOGIC;
m2 : out STD_LOGIC;
m3 : out STD_LOGIC;
m4 : out STD_LOGIC;
f1 : out STD_LOGIC;
f2 : out STD_LOGIC;
f3 : out STD_LOGIC;
g1 : out STD_LOGIC;
g2 : out STD_LOGIC;
g3 : out STD_LOGIC;
g4 : out STD_LOGIC;
h1 : out STD_LOGIC;
h2 : out STD_LOGIC);
end reloj;
begin
process (clk)
begin
end if;
If cont7 = cont3 and cont8 = cont4 and cont9 = cont5 and configh=
'0' and configm= '0' and aceptar= '1' then
ALARMA <= '1';
end if;
if rising_edge(clk) then
contador <= contador + 1;
if contador = 9 then
contador <= 0;
cont <= cont + 1;
if cont = 5 then
cont <= 0;
If cont = 5 and contador = 9 then
cont2<= cont2 + 1;
if cont2 = 9 then
cont2 <= 0;
cont3 <= cont3 + 1;
if cont3 = 5 then
cont3 <= 0;
if cont4 = 9 then
cont5<= cont5 + 1;
cont4 <= 0;
end if;
end if;
end if;
end if;
end if;
end if;
end if;
end if;
end process;
salida <= CONV_STD_LOGIC_VECTOR(contador,4);
Bout <= CONV_STD_LOGIC_VECTOR(cont,3);
Cout<= CONV_STD_LOGIC_VECTOR(cont2,4);
Dout<= CONV_STD_LOGIC_VECTOR(cont3,3);
Eout<= CONV_STD_LOGIC_VECTOR(cont4,4);
Fout<= CONV_STD_LOGIC_VECTOR(cont5,2);
Gout<= CONV_STD_LOGIC_VECTOR(cont6,4);
Hout<= CONV_STD_LOGIC_VECTOR(cont7,3);
Iout<= CONV_STD_LOGIC_VECTOR(cont8,4);
Jout<= CONV_STD_LOGIC_VECTOR(cont9,2);
q1<= salida(0);
q2<= salida(1);
q3<= salida(2);
q4<= salida(3);
j1<= Bout(0);
j2<= Bout(1);
j3<= Bout(2);
m1<= Cout(0);
m2<= Cout(1);
m3<= Cout(2);
m4<= Cout(3);
f1<= Dout(0);
f2<= Dout(1);
f3<= Dout(2);
g1<= Eout(0);
g2<= Eout(1);
g3<= Eout(2);
g4<= Eout(3);
h1<= Fout(0);
h2<= Fout(1);
alm1<= Gout(0);
alm2<= Gout(1);
alm3<= Gout(2);
alm4<= Gout(3);
alm5<= Hout(0);
alm6<= Hout(1);
alm7<= Hout(2);
almh1<= Iout(0);
almh2<= Iout(1);
almh3<= Iout(2);
almh4<= Iout(3);
almh5<= Jout(0);
almh6<= Jout(1);
end Behavioral;