elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Curso de javascript por TickTack


+  Foro de elhacker.net
|-+  Informática
| |-+  Electrónica
| | |-+  duda contador 0-99 con Xilinx
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: duda contador 0-99 con Xilinx  (Leído 5,161 veces)
Carlosnuel


Desconectado Desconectado

Mensajes: 527


https://www.quobit.mx/


Ver Perfil WWW
duda contador 0-99 con Xilinx
« en: 10 Mayo 2006, 15:50 pm »

hola, lo que pasa es que tengo que implementar en una tarjeta de Xinix un contador de 0 a 99 pero no me sale porque al habilitar cada uno de los display para mandar la señal tengo en los 4 display el mismo numero, entonces tan solo quiero habilitar 2 display para que cuenten del 0 al 99 pero no me sale.

alguien puede ayudarme. El codigo que llevo es el sig.

Código:

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 instantiating
---- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;

entity cotador is
    Port ( reloj : in std_logic;
           reset : in std_logic;
           habent : in std_logic;
           habsal : out std_logic;
         cuentamax: in std_logic_vector (3 downto 0);
           selec, selec1:in std_logic;
  anodo, anodo1:out std_logic;
  salida, salida1 : out std_logic_vector (6 downto 0));
end cotador;

architecture Behavioral of cotador is
 signal clock:std_logic;
 signal count, count2 :std_logic_vector (3 downto 0);
 begin

process(reloj)
   variable conta : integer range 0 to 50000000 :=0;
     begin
        if reloj = '1' and reloj'event then
            if conta =50000000 then
conta :=0;
clock <='1';
else
conta:=conta+1;
clock<='0';
end if;
  end if;
 end process; 




   process (cuentamax, clock, reset)
     variable cuenta: std_logic_vector (3 downto 0):="0000";
      begin
         if reset = '1' then
          count<="0000";
            elsif clock='1' and clock'event then
               if habent='0' then
                 if count = cuentamax then
                    count<="0000";
                 else
                     count<=count+1;
                 end if;
if count=cuentamax then
    count2<=count2+1;
               else
    if count2= cuentamax then
count2<="0000";
end if;
               end if;


                end if;
          end if;


   
   
   if count=cuentamax and habent = '0' and clock = '1' then
     habsal<='0';
      else
        habsal<='1';
 
end if;

  end process;

with count select
salida<="1111001" when "0001",
  "0100100" when "0010",
  "0110000" when "0011",
  "0011001" when "0100",
  "0010010" when "0101",
  "0000010" when "0110",
  "1111000" when "0111",
  "0000000" when "1000",
  "0010000" when "1001",
  "1000000" when others;
   

anodo<=selec;
 with count2 select
salida1<="1111001" when "0001",
  "0100100" when "0010",
  "0110000" when "0011",
  "0011001" when "0100",
  "0010010" when "0101",
  "0000010" when "0110",  
  "1111000" when "0111",
  "0000000" when "1000",
  "0010000" when "1001",
  "1000000" when others;
anodo1<=selec.-;

end Behavioral;



Ojala alguien pueda ayudarme... gracias.


« Última modificación: 12 Mayo 2006, 15:59 pm por CarlosNuel » En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
[DUDA] Contador de vocales. Medio-Solucionado xD
Programación C/C++
pitka 9 8,965 Último mensaje 4 Diciembre 2010, 18:18 pm
por EddyC
duda contador
Desarrollo Web
K-roleck 1 1,892 Último mensaje 16 Noviembre 2011, 21:19 pm
por #!drvy
Duda contador 74169
Electrónica
JonaLamper 3 6,320 Último mensaje 13 Febrero 2014, 02:40 am
por pax01
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines