Addition en VHDL
Répondre à la discussion
Affichage des résultats 1 à 4 sur 4

Addition en VHDL



  1. #1
    invitef9e6be50

    Addition en VHDL


    ------

    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

    -----

  2. #2
    jiherve

    Re : Addition en VHDL

    Bonsoir
    Avec les bonnes librairies: numeric_std et std_logic_1164:
    comptage<= std_logic_vector(unsigned(comp tage) + 1);
    JR

  3. #3
    invitef9e6be50

    Re : Addition en VHDL

    merci mais j ai retaper mais il me marque toujours la meme erreur


    voila ce que j ai retaper
    --
    -- File: C:\Documents and Settings\Usman\Bureau\graph\af ficheur.vhd
    -- created: 04/27/07 20:07:13
    -- from: 'C:\Documents and Settings\Usman\Bureau\graph\af ficheur.asf'
    -- by fsm2hdl - version: 2.0.1.45
    --
    library IEEE;
    use IEEE.std_logic_1164.all;
    use numeric_std et 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<= std_logic_vector(unsigned(comp tage) + 1);
    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 (line 46, col 23): (E601) Bad operand types 'std_logic_vector(9 downto 0)' and 'string(1 to 10)' for operator '+'.

  4. #4
    invitef9e6be50

    Re : Addition en VHDL

    voila c bon c ca merciiiiiiiiiiii
    Cependant tu pourrais me passer ton e-mail de msn ou autre comme ca je pourrais te demander ( c si tuveus je te pousser pas mais merci pour le trucccccc )




    library IEEE;
    use IEEE.std_logic_1164.all;
    use IEEE.numeric_std.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);
    signal reference: 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<= std_logic_vector(unsigned(comp tage) + 1);
    if sortiesonar = '0' then
    affichagedesled <= affichage;
    end if;
    when RAZCOMPTEUR =>
    comptage<= "0000000000";
    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;

  5. A voir en vidéo sur Futura

Discussions similaires

  1. Addition de vitesse
    Par invitee2a10d83 dans le forum Physique
    Réponses: 8
    Dernier message: 18/02/2007, 02h32
  2. addition de vitesse
    Par invite4e724df6 dans le forum Physique
    Réponses: 2
    Dernier message: 26/08/2006, 00h41
  3. addition electropile
    Par invite657b0ad0 dans le forum Chimie
    Réponses: 11
    Dernier message: 10/05/2006, 21h01
  4. addition de potasse
    Par invite657b0ad0 dans le forum Chimie
    Réponses: 6
    Dernier message: 09/05/2006, 21h01
  5. addition syn addition anti
    Par invite613a4e44 dans le forum Chimie
    Réponses: 1
    Dernier message: 04/03/2006, 00h01
Dans la rubrique Tech de Futura, découvrez nos comparatifs produits sur l'informatique et les technologies : imprimantes laser couleur, casques audio, chaises gamer...