Escolar Documentos
Profissional Documentos
Cultura Documentos
Codigo Contador7seg
Codigo Contador7seg
vhd
----------------------------------------------------------------relojlento
library ieee;
use ieee.std_logic_arith.all;
use ieee.std_logic_1164.all;
entity relojlento is
port(
clkl: in std_logic;
led: buffer std_logic:= '0' );
end relojlento;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity cuenta4 is
Port ( divi : in STD_LOGIC;
reset : in STD_LOGIC;
cyout: out std_logic;
salida : out STD_LOGIC_vector(3 downto 0));
end cuenta4;
begin
process (reset, divi)
variable cuenta: std_logic_vector ( 3 downto 0):= "0000";
begin
if rising_edge (divi) then
if cuenta= "1001" then
cuenta:= "0000";
cyout<='1';
else
cuenta:= cuenta+1;
end if;
end if;
IF reset = '1' then
cuenta:= "0000";
end if;
SALIDA <= cuenta;
end process;
end arqcuenta4;
--------------------------------------------contador
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity contador4 is
Port ( clkl: in STD_LOGIC;
reset : in STD_LOGIC;
cyout: out std_logic;
salida : out STD_LOGIC_vector(3 downto 0));
end contador4;
begin
u1: entity work.RELOJLENTO(ARQRELOJLENTO) port map(clkl,conector);
u2: entity work.cuenta4(arqcuenta4) port map(conector, reset,cyout, salida);
end arqcontador4;
-----------------------------------bcd7seg
library ieee;
use ieee.std_logic_1164.all;
entity bcd7seg is
port(
bcd: in std_logic_vector(3 downto 0);
led: out std_logic_vector(6 downto 0)
);
end bcd7seg ;
architecture arqbcd7seg of bcd7seg is
begin
end arqbcd7seg ;
--------------------------------conta7seg
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity conta7seg is
Port ( clkl: in STD_LOGIC;
reset : in STD_LOGIC;
cyout: out std_logic;
seg7 : out STD_LOGIC_vector(6 downto 0));
end conta7seg;
end arq_conta7seg;