Tom's Guide > Forum > Programmation > Vhdl addtion debit vector

Vhdl addtion debit vector

Forum Programmation : Vhdl addtion debit vector

TomsGuide.com : 800 000 inscrits répondent à toutes vos questions high-tech et informatique. Pour obtenir de l'aide, inscrivez-vous gratuitement !
Mot :    Pseudo :           
 

Bonjours a tous ,

on faite j ai un probleme au niveau d'un additon entre deux bit vector car en faite en sortie il faute que je puisse allumer des afficher c est pour pkoi il me faut faire l'additon

VOICI LE PROGRAMME EN VHDL :

library IEEE;
use IEEE.std_logic_1164.all;


entity afficheur is
port (clk: in STD_LOGIC;
entreesonar: in STD_LOGIC;
sortiesonar: in STD_LOGIC;
afficheur: out STD_LOGIC_VECTOR (9 downto 0));
end;

architecture afficheur_arch of afficheur is

--diagram signal declarations
signal comptage: STD_LOGIC_VECTOR (9 downto 0);

-- SYMBOLIC ENCODED state machine: affichagedesled
type affichagedesled_type is (affichage, attente, incrementatoncompteur, RAZCOMPTEUR);
signal affichagedesled: affichagedesled_type;

begin
--concurrent signal assignments
--diagram ACTIONS;


affichagedesled_machine: process (clk)

begin

if clk'event and clk = '1' then
case affichagedesled is
when affichage =>
affichagedesled <= attente;
when attente =>
if entreesonar = '1' then
affichagedesled <= RAZCOMPTEUR;
end if;
when incrementatoncompteur =>
comptage<= comptage + "000000001";
if sortiesonar = '0' then
affichagedesled <= affichage;
end if;
when RAZCOMPTEUR =>
comptage<= "000000000";
if sortiesonar = '1' then
affichagedesled <= incrementatoncompteur;
end if;
when others =>
null;
end case;
end if;
end process;

-- signal assignment statements for combinatorial outputs
afficheur_assignment:
afficheur <= comptage when (affichagedesled = affichage) else
comptage;

end afficheur_arch;


ERREUR :

afficheur.vhd (LIGNE 45) : (E601) Bad operand types 'std_logic_vector(9 downto 0)' and 'string(1 to 9)' for operator '+'.



Merci de bien vouloir m'aider car j ai absolument besoin de faire cette addtion svp :pt1cable: :love:

Liens sponsorisés
Inscrivez-vous ou connectez-vous pour masquer ceci.

Salut,

tu n'as pas inclus les librairies contenant les opérateurs élementaires (addition, soustraction...))

Ajoutes :

use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;

ça devrait mieux fonctionner

------------------------------ J'ai révé d'un monde où les femmes étaient nues et muettes ...
Répondre à bobstar
Tom's Guide > Forum > Programmation > Vhdl addtion debit vector
Aller à :

Il y a 2437 utilisateurs connus et inconnus. Pour voir la liste des connectés connus, cliquez ici.

Attention

Vous allez répondre sur un sujet resté inactif pendant plus de 6 mois.
Assurez-vous d'apporter des éléments nouveaux à la discussion avant de poursuivre.

Répondre Annuler
Liens