Was ist falsch ?=) (kurz)

Gast #1922423
Lesenswert?
• ▲
▼
Hallo zusammen,

habe seit einer std die fehlermeldungen:

ERROR:HDLCompiler:806 Line 48: Syntax error near "=".
ERROR:HDLCompiler:9  Line 46: Found 0 definitions for operator "=".
ERROR:HDLCompiler:854  Line 41: Unit <behavior> ignored due to previous 
errors.

ich weiss nicht mehr wirklich weiter...

hilfe ?:/  danke schonmal
1
entity mehrBitAdder is
2
    Port ( a : in  unsigned (31 downto 0);
3
           b : in  unsigned (31 downto 0);
4
           cout : out  unsigned (31 downto 0);
5
           controlBit : in  STD_LOGIC);
6
end mehrBitAdder;
7

8
architecture behavior of mehrBitAdder is
9

10
begin
11
    process(controlBit)
12
begin
13
if controlBit ="0" then
14
    cout <= a+b;
15
  else controlBit ="1" then
16
    cout <= a-b;
17
end if;
18
    end process;
19
end behavior;
Gast #1922458
Lesenswert?
• ▲
▼
mh... ist schon weniger aber nun bekomm ich noch diese fehlermeldungen.



ERROR:HDLCompiler:806 Line 48: Syntax error near "=".
ERROR:HDLCompiler:854  Line 41: Unit <behavior> ignored due to previous 
errors.


1
library IEEE;
2
use IEEE.STD_LOGIC_1164.ALL;
3

4
use IEEE.NUMERIC_STD.ALL;
5

6
-- Uncomment the following library declaration if instantiating
7
-- any Xilinx primitives in this code.
8
--library UNISIM;
9
--use UNISIM.VComponents.all;
10

11
entity mehrBitAdder is
12
    Port ( a : in  unsigned (31 downto 0);
13
           b : in  unsigned (31 downto 0);
14
           cout : out  unsigned (31 downto 0);
15
           controlBit : in  STD_LOGIC);
16
end mehrBitAdder;
17

18
architecture behavior of mehrBitAdder is
19

20
begin
21
    process(controlBit,a,b)
22
begin
23
if controlBit ='0' then
24
    cout <= a+b;
25
(44)  else controlBit ='1' then
26
    cout <= a-b;
27
end if;
28
    end process;
29
end behavior;
Moderator (Firma: Titel) Persönliche Seite #1922483
Lesenswert?
• ▲
▼
Duke Scarring schrieb:
> end architecture behavior;
Das ist nicht nötig...
nicht Gast schrieb:
> Du solltest zwischen = und ' ein Leerzeichen machen!!!!!!!!!!!!!!
Auch das ist nicht nötig...

Die Fehlerursache wurde schon genannt:
Florian V. schrieb:
> Da sollte sicherlich ein "elsif" anstatt ein "else" hin.

gabs schrieb:
> mh... ist schon weniger aber nun bekomm ich noch diese fehlermeldungen.
Naja....
Kauf dir mal das Buch "VHDL-Synthese" oder leih es dir aus...
Gast #1922516
Lesenswert?
• ▲
▼
hatte zu anfang elseif benutzt anstatt elsif und mich gewundert wieso 
xilinx es nich als schlüsselwort erkannte...

hat das problem aber nicht gelöst. ...

hab tutorials durchgeschaut und finde :

process (sel, a, b)
begin
  if sel = '1' then
    f <= a;
  else
    f <= b;
  end if;
end process;

sieht nich unbedingt sehr anders zu meinem aus...

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren