- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Hi,
Actually this is a question about VHDL. I need a counter which is loaded with two different initial values T1 or T2 in different cases and then counts down to 0. How do I specify the range of the counter in declaration? constant T1 : integer := AA; constant T2 : integer := BB; signal cnt : integer range 0 to ??; (here I need an expression to find the larger number of AA and BB) Is it possible to do it in VHDL?- Etiquetas:
- Intel® Quartus® Prime Software
Enlace copiado
2 Respuestas
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
function find_larger(a, b : integer) return integer is
begin
if a >= b then return a
else return b;
end if;
end function find_larger;
....
signal cnt : integer range 0 to find_larger(T1, T2);
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
The IEEE library has a MAX function for the same purpose.
Responder
Opciones de temas
- Suscribirse a un feed RSS
- Marcar tema como nuevo
- Marcar tema como leído
- Flotar este Tema para el usuario actual
- Favorito
- Suscribir
- Página de impresión sencilla