Quantcast
Channel: Altera Forums
Viewing all articles
Browse latest Browse all 19390

VHDL problem

$
0
0
Hi everyone,
I'm a new user of FPGA.
I have 2 LEDs and a clock of 32KHz.
So I wanna light up LED1
then light off LED 1 and light up LED2.
Im trying to do something in VHDL, but it seems it's nonsense what I've done



LIBRARY ieee;
USE ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use IEEE.STD_LOGIC_SIGNED;
use IEEE.STD_LOGIC_UNSIGNED;
use IEEE.STD_LOGIC_ARITH.ALL;


ENTITY TP4LED IS
PORT (
clock : IN std_logic;
s1: OUT std_logic;
s2: OUT std_logic
);
END TP4LED;


ARCHITECTURE behavior OF TP4LED IS -- fonctionnement d'une bascule D


signal count : integer(10 downto 0);
BEGIN


PROCESS (clock) -- liste de sensibilité


BEGIN
count <= '0';
s1<='1';
s2<='0';
if(clock'event and clock='1')then
count <= count + 1;
if (count = '9') then
s1<='0';
s2<='1';
count<=0;
end if;
end if;
END PROCESS;
END behavior;

In addition, I have this mistake that I don't know how to resolve it
Error (10380): VHDL error at TP4LED.vhd(24): integer type is used but not declared as an array type


I know it might be an easy question. Could anyone help me please
thank you very much
Bo

Viewing all articles
Browse latest Browse all 19390

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>